Conversation
…mple fields to example yaml
|
Report: Report: api - scala:2.12.17
|
dk1844
left a comment
There was a problem hiding this comment.
I originally wondered if no mention of "parameter store" is an issue, but looking at how the AWS API is named, it makes sense that "SSM" and "getParameter" makes this clear enough.
Nicely done, just please add some of the tests suggested below if possible
| #aws-systems-manager-account | ||
| #parameter: "parameter path" | ||
| #decrypt-if-secure: true | ||
| #username-field-name: "username" | ||
| #password-field-name: "password" |
There was a problem hiding this comment.
I like the fact that you made it more configurable than other internal tools that can rely more directly on how the username+password fields are, this is welcome for an OSS project!
api/src/main/scala/za/co/absa/loginsvc/rest/config/auth/ServiceAccountConfig.scala
Outdated
Show resolved
Hide resolved
api/src/main/scala/za/co/absa/loginsvc/rest/config/auth/ServiceAccountConfig.scala
Show resolved
Hide resolved
…com/AbsaOSS/login-service into feature/129-ls-pwd-rotation-support
dk1844
left a comment
There was a problem hiding this comment.
Sorry for bashing, but let's use mocking instead of custom-tailored TestClass implementation approach
api/src/main/scala/za/co/absa/loginsvc/rest/config/auth/ServiceAccountConfig.scala
Show resolved
Hide resolved
api/src/test/scala/za/co/absa/loginsvc/rest/config/auth/AwsSecretsLdapUserConfigTest.scala
Show resolved
Hide resolved
...rc/test/scala/za/co/absa/loginsvc/rest/config/auth/AwsSystemsManagerLdapUserConfigTest.scala
Outdated
Show resolved
Hide resolved
dk1844
left a comment
There was a problem hiding this comment.
LGTM
(the thenAnswer/thenReturn difference is a small thing not blocking merge in my view)
| .thenAnswer(_ => | ||
| Some(AwsSecret(Map( | ||
| "accountName" -> "ldap-user123", | ||
| "accountPwd" -> "password456"), | ||
| Instant.now()))) |
There was a problem hiding this comment.
Why have you decided to complicate with thenAnswer? (multiple places)
I mean:
when(...).thenAnswer(_ => ...) when the simpler when(...).thenResult(...) would have sufficed.
But at least I learned a bit more about thenAnswer (I have not used that that much before).
| .thenAnswer(_ => | |
| Some(AwsSecret(Map( | |
| "accountName" -> "ldap-user123", | |
| "accountPwd" -> "password456"), | |
| Instant.now()))) | |
| .thenResult( | |
| Some(AwsSecret(Map( | |
| "accountName" -> "ldap-user123", | |
| "accountPwd" -> "password456"), | |
| Instant.now()))) |
There was a problem hiding this comment.
I wasn't aware of .thenResult as the practice I've had withMockito only used .theAnswer.
Will keep it in mind for future.
Release Notes: