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

feat: P4PU-329 save access token #43

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

oleksiybozhykntt
Copy link
Collaborator

List of Changes

Added feature that saves each access token with relative user data in in-memory storage

Motivation and Context

For the future purpose we should have a store where all active access_token shoud be stored

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.


@Override
public IamUserInfoDTO getUserInfo(String accessToken) {
return tokens.getOrDefault(accessToken, null);
Copy link
Contributor

Choose a reason for hiding this comment

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

consider the use of Optional as return param

}
@Test
void givenAuthenticationRequestThenInResponseGetCustomTokenResponse() throws IOException {
String sample_id_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ik1hcmNvIiwiaWF0IjoxNTE2MjM5MDIyLCJmaXNjYWxOdW1iZXIiOiI3ODkwMTIiLCJmYW1pbHlOYW1lIjoiUG9sbyIsImVtYWlsIjoibWFyY28ucG9sb0BleGFtcGxlLmNvbSIsImlzcyI6Imlzc3VlciJ9.AErwXpbHrT_0WvN86QuQ0nvnZndVxt8jnmiD1lfj1_A";
Copy link
Contributor

Choose a reason for hiding this comment

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

Sonar points out the naming of sample_id_token as issue. Try with camelCase

Copy link

sonarqubecloud bot commented Aug 1, 2024

@oleksiybozhykntt oleksiybozhykntt marked this pull request as ready for review August 1, 2024 08:45
@oleksiybozhykntt oleksiybozhykntt requested a review from a team as a code owner August 1, 2024 08:45
@oleksiybozhykntt oleksiybozhykntt merged commit 05e7112 into develop Aug 1, 2024
7 checks passed
@oleksiybozhykntt oleksiybozhykntt deleted the P4PU-329-save-access-token branch August 1, 2024 08:48
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