Skip to content

fix(workloadapi): reject X.509 updates the SVID picker selects nothing from - #540

Open
cvas22 wants to merge 1 commit into
spiffe:mainfrom
cvas22:fix/x509-source-picker-no-svid
Open

cvas22 wants to merge 1 commit into
spiffe:mainfrom
cvas22:fix/x509-source-picker-no-svid

Conversation

@cvas22

@cvas22 cvas22 commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #539

setX509Context stored whatever the svidPicker returned, so a picker that selects nothing left the source holding a null SVID and getX509Svid() returned null. A picker that throws was worse: the exception escaped onUpdate into the gRPC stream observer, the call got cancelled, and since CANCELLED ends the watch the source stopped getting rotations.

Now setX509Context rejects an update with no selected SVID, and the watcher's onUpdate sends any exception from applying an update to onError as an X509ContextException, the same path a malformed update takes since #487. So the current SVID and bundles stay, the watch keeps running, and newSource fails if the first update is rejected. Documented that on the svidPicker option too.

Tests cover a picker that returns null after init (update rejected, the next one applied) and on the first update (newSource fails). Changelog entry under Fixed.

Notes

Ran the Build workflow on my fork: linux JDK 17/21/25 passed, the macOS jobs were still waiting for a runner, so CI here will cover those.

…g from

DefaultX509Source stored a null SVID when the svidPicker returned null,
and an exception from the picker escaped onUpdate and cancelled the
watch. Both are now handled as a rejected update: the current SVID and
bundles are kept, and newSource fails if it's the first update.

Fixes spiffe#539

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DefaultX509Source keeps a null SVID when the svidPicker picks nothing

1 participant