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

assignment of sseAwsKeyManagementParams does not work #9

Open
pvrock123 opened this issue Feb 10, 2021 · 2 comments
Open

assignment of sseAwsKeyManagementParams does not work #9

pvrock123 opened this issue Feb 10, 2021 · 2 comments

Comments

@pvrock123
Copy link

AmazonSNSExtendedClient constructor calls one of the S3BackedPayloadStore constructor which always set the sseAwsKeyManagementParams to null. So there is no point of setting this param. one of the solutions could be to call the second parameterized constructor of S3BackedPayloadStore which accepts the sseAwsKeyManagementParams.

@AskerSi
Copy link

AskerSi commented Feb 2, 2024

The withServerSideEncryption method in ExtendedClientConfiguration is not functioning correctly because the appropriate constructor in AmazonSNSExtendedClient.java is not being invoked. This call should be altered from:
S3Dao s3Dao = new S3Dao(this.snsExtendedClientConfiguration.getS3Client());
to:
S3Dao s3Dao = new S3Dao(clientConfiguration.getS3Client(),
clientConfiguration.getServerSideEncryptionStrategy(),
clientConfiguration.getObjectCannedACL());
as it is implemented in AmazonSQSExtendedClient.

@AskerSi
Copy link

AskerSi commented Feb 2, 2024

Created a fix for this here
#20
Till it is merged and this workaround can be used create a custom AmazonSNSExtendedClient say AmazonSNSExtendedClientCustom with the following constructor
public AmazonSNSExtendedClientCustom(SnsClient snsClient, SNSExtendedClientConfiguration snsExtendedClientConfiguration,
PayloadStore payloadStore) {

super(snsClient, snsExtendedClientConfiguration, payloadStore);

}
and create the object as following
final S3Dao s3Dao = new S3Dao(extendedClientConfig.getS3Client(),
extendedClientConfig.getServerSideEncryptionStrategy(),
extendedClientConfig.getObjectCannedACL());
final PayloadStore payloadStore = new S3BackedPayloadStore(s3Dao, extendedClientConfig.getS3BucketName());

client = new AmazonSNSExtendedClientCustom(SnsClient.builder()
    .region(Region.EU_WEST_1)
    .build(),
    extendedClientConfig,
    payloadStore);

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

No branches or pull requests

2 participants