Skip to content

Basic implementation#1

Open
rsavko wants to merge 1 commit intoolkooo:masterfrom
rsavko:master
Open

Basic implementation#1
rsavko wants to merge 1 commit intoolkooo:masterfrom
rsavko:master

Conversation

@rsavko
Copy link

@rsavko rsavko commented Apr 23, 2020

No description provided.

@olkooo
Copy link
Owner

olkooo commented Apr 24, 2020

PR comment is missing.

public class AliasCreateResponse {
private String alias;

public AliasCreateResponse(String alias) {
Copy link
Owner

Choose a reason for hiding this comment

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

Should be covered by @RequiredArgsConstructor which is a part of @Data annotation.
Reason why It's not there is the absence of @NotNull annotation.

@rsavko
Copy link
Author

rsavko commented Apr 24, 2020

My bad. Mistakenly assumed I added it. Will consider this case in future.
Thanks for response.

@@ -0,0 +1,15 @@
package com.verygood.security.coding.exception;

public class CipherDecryptException extends RuntimeException {
Copy link
Owner

Choose a reason for hiding this comment

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

Do we really need 2 identical exceptions?
Maybe we can pass MODE in message.

return encrypt(strToEncrypt, secret, DEFAULT_ALGORITHM);
}

public static String encrypt(String whatToEncrypt, String secret, String algorithm) throws CipherEncryptException {
Copy link
Owner

Choose a reason for hiding this comment

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

encrypt and decrypt have a lot of duplication.
Would be nice to have part of It extracted in separate method.

private AliasesService aliasesService = new AliasesServiceImpl(new MockAliasRepository());

@Test
public void inputIsEncryted() {
Copy link
Owner

Choose a reason for hiding this comment

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

Not sure we need @RunWith(SpringRunner.class) here.
We don't need Spring context to test AliasesService logic.

@rsavko
Copy link
Author

rsavko commented Apr 24, 2020

All remarks are reasonable. Thanks a lot for sharing your thoughts on this.

@olkooo
Copy link
Owner

olkooo commented Apr 24, 2020

In general @rsavko no need to resolve PR comments.
Just doing my part of the job - actually reviewing this PR. :-)

@rsavko
Copy link
Author

rsavko commented Apr 24, 2020

You mentioned a lot of great ideas. Thanks a lot, I highly appreciate this! 😄

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.

2 participants