Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 KMS condition has incorrect capitalization #1333

Closed
gbaso opened this issue Jan 29, 2025 · 2 comments · Fixed by #1337
Closed

S3 KMS condition has incorrect capitalization #1333

gbaso opened this issue Jan 29, 2025 · 2 comments · Fixed by #1337
Labels
component: s3 S3 integration related issue type: bug Something isn't working
Milestone

Comments

@gbaso
Copy link
Contributor

gbaso commented Jan 29, 2025

Type: Bug

Component:
S3

Describe the bug
S3EncryptionConditional has a nested condition KmsKeyProperty which is conditional on property spring.cloud.aws.s3.encryption.keyId. According to property binding rules, keyId should be key-id. This is also reflected in the following section of the autogenerated spring-configuration-metadata.json:

{
  "name": "spring.cloud.aws.s3.encryption.key-id",
  "type": "java.lang.String",
  "sourceType": "io.awspring.cloud.autoconfigure.s3.properties.S3EncryptionProperties"
}

which is the property name suggested by the IDE. Unfortunately this causes the condition not to match, leading to the creation of an S3Client without client-side encryption enabled. To match the condition, keyId must be used in the application.yaml instead of key-id.

Sample

spring:
  cloud:
    aws:
      credentials:
        ...
      s3:
        encryption:
          key-id: aaaaaaaa-bbbb-4444-cccc-dddddddddddd
@Autowired
S3Client s3Client;

assert s3Client instanceof S3EncryptionClient; // fails
@maciejwalkowiak
Copy link
Contributor

@gbaso would you like to contribute a fix?

@maciejwalkowiak maciejwalkowiak added this to the 3.3.1 milestone Feb 1, 2025
@maciejwalkowiak maciejwalkowiak added component: s3 S3 integration related issue type: bug Something isn't working labels Feb 1, 2025
@gbaso
Copy link
Contributor Author

gbaso commented Feb 1, 2025

@maciejwalkowiak yes, I will submit a PR in the following days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: s3 S3 integration related issue type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants