Skip to content

GH-1018: Allow null secret values in SecretLeaseCreatedEvent - #1019

Open
kalayciburak wants to merge 1 commit into
spring-projects:mainfrom
kalayciburak:fix/gh-1018-null-secret-values
Open

GH-1018: Allow null secret values in SecretLeaseCreatedEvent#1019
kalayciburak wants to merge 1 commit into
spring-projects:mainfrom
kalayciburak:fix/gh-1018-null-secret-values

Conversation

@kalayciburak

Copy link
Copy Markdown

Summary

SecretLeaseCreatedEvent currently copies secrets with Map.copyOf, which rejects null values. Vault secret payloads can contain null entries (for example AWS iam_user credentials with a null session_token), so lease create/rotate paths throw NullPointerException after Spring Vault 4.0.0.

Restore the previous null-tolerant unmodifiable LinkedHashMap copy. SecretLeaseRotatedEvent inherits the same constructor path.

Fixes #1018

Test plan

  • ./mvnw -pl spring-vault-core -Dtest=SecretLeaseCreatedEventUnitTests,SecretLeaseContainerUnitTests test (36/36 GREEN)
    • new unit tests cover null values for create and rotate events plus unmodifiable map contract
    • existing SecretLeaseContainerUnitTests regression suite

…dEvent

Restore a null-tolerant unmodifiable copy so Map.copyOf no longer
rejects Vault payloads that include null entries (for example AWS
iam_user credentials with a null session_token).

Signed-off-by: Burak KALAYCI <kalayciburak1996@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.

SecretLeaseCreatedEvent throws NullPointerException for secrets containing null values (regression in 4.0.0)

1 participant