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

add option to provide a cipher #59 #60

Merged
merged 0 commits into from
Jun 2, 2023
Merged

add option to provide a cipher #59 #60

merged 0 commits into from
Jun 2, 2023

Conversation

mdpadberg
Copy link
Contributor

add option to provide a cipher #59

Copy link
Contributor

@martinvisser martinvisser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, but I have some questions/remarks. I do not see a reason why we need an interface for the encryption service. We could opt for the current EncryptionService and if no Cipher is defined it would use the current default Cipher. If the "old" withEncryption(PublicKey) is used, it could init the Cipher and basically call withCipher(Cipher) method. This would mean there is no need for multiple classes to implement an interface, the EncryptionService will always be initialized with a Cipher.

We also might need to clarify that calling both withEncryption and withCipher will override each other, that's not clear in the docs.

@mdpadberg
Copy link
Contributor Author

Thanks for the PR, but I have some questions/remarks. I do not see a reason why we need an interface for the encryption service. We could opt for the current EncryptionService and if no Cipher is defined it would use the current default Cipher. If the "old" withEncryption(PublicKey) is used, it could init the Cipher and basically call withCipher(Cipher) method. This would mean there is no need for multiple classes to implement an interface, the EncryptionService will always be initialized with a Cipher.

We also might need to clarify that calling both withEncryption and withCipher will override each other, that's not clear in the docs.

Updated the javadocs. Also changed the design from the EncryptionService interface to the builder, like you suggested

@sonarcloud
Copy link

sonarcloud bot commented Jun 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@martinvisser martinvisser self-requested a review June 2, 2023 13:07
@martinvisser martinvisser merged this pull request into rabobank:main Jun 2, 2023
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.

3 participants