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

APP-2887 - Authentication API #173

Merged
merged 22 commits into from
Aug 10, 2020

Conversation

thibauult
Copy link
Member

@thibauult thibauult commented Aug 4, 2020

New BDK Authentication API. At the moment, only the RSA authentication has been implemented for regular and ob-behalf-of (OBO) authentication.

TODO

List sorted by order of priority...

  • Exception management
  • Unit tests (coverage > 90%)
  • Javadoc

/**
*
*/
void refresh() throws AuthenticationException;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it up to the user of the SDK to refresh the authentication, ideally the SDK should handle that himself and refresh auth when needed, what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's my goal indeed (cf. V4MessageService#L42). However, I thought it was interesting to give the ability to the developer to refresh if he wants to.

What could be the right strategy if we want to make this method used internally only? Through an AbstractAuthSession implements AuthSession?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to expose the authsession at all in this case?

@thibauult thibauult marked this pull request as ready for review August 10, 2020 07:45
@thibauult thibauult requested a review from a team August 10, 2020 07:45
@@ -0,0 +1,3 @@
# Authentication

To be done...
Copy link
Contributor

@symphonydarlys symphonydarlys Aug 10, 2020

Choose a reason for hiding this comment

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

create a new story to create the documentation!!! please mention the JIRA story here and put in the ticket as acceptance criteria : "Documentation must contain explanation about Client Provider and what happens if 2 different providers are configured"

* @return true if response status is 401, false otherwise
*/
public boolean isUnauthorized() {
return this.code == 401;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use Enum HttpStatus instead of

*
* @return a new {@link ApiClient} instance.
*/
ApiClient newInstance();
Copy link
Contributor

Choose a reason for hiding this comment

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

really good approach, we can use different libraries to generate clients!!!

<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.11.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

management of version in properties sections is better!!!

<dependency>
<groupId>com.symphony.platformsolutions</groupId>
<artifactId>symphony-bdk-core-invoker-jersey2</artifactId>
<version>1.2.0-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

idem!!!

@API(status = API.Status.EXPERIMENTAL)
public class SymphonyBdk {

private final BdkConfig config;
Copy link
Contributor

Choose a reason for hiding this comment

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

some class attributes can be instanced in the methods, except if you think these class will be inherits by other classes which can use them

symphony-youri
symphony-youri previously approved these changes Aug 10, 2020
private final ApiClient loginApiClient;
private final ApiClient relayApiClient;

private JwtHelper jwtHelper = new JwtHelper();
Copy link
Contributor

Choose a reason for hiding this comment

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

can be final?

*/
@Slf4j
@API(status = API.Status.INTERNAL)
public class BotAuthenticatorRSAImpl implements BotAuthenticator {
Copy link
Contributor

Choose a reason for hiding this comment

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

RSAImpl -> RsaImpl?

Copy link
Contributor

@symphony-elias symphony-elias left a comment

Choose a reason for hiding this comment

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

LGTM

@thibauult thibauult merged commit cfec987 into finos:master Aug 10, 2020
@thibauult thibauult deleted the APP-2887_Auth-API-bootstrap branch August 10, 2020 14:34
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.

5 participants