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

Generate auth tokens for service accounts #2697

Closed

Conversation

stephen-crawford
Copy link
Contributor

Description

This is a PR to introduce the functionality for generating an auth token for an extension. The auth token consists of a an encoded basic auth token created from a randomly generated password. The token is then passed back to the client so that changes can be made in core in order to later perform authentication and authorization using the token.

Issues Resolved

This issue addresses This PR covers issue #2611 and issue #2668.

Testing

New tests are added to the UserApiTest file.

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2023

Codecov Report

Merging #2697 (c911ef7) into main (d168c1a) will decrease coverage by 0.08%.
The diff coverage is 50.35%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #2697      +/-   ##
============================================
- Coverage     61.45%   61.38%   -0.08%     
- Complexity     3385     3399      +14     
============================================
  Files           270      272       +2     
  Lines         18694    18804     +110     
  Branches       3279     3292      +13     
============================================
+ Hits          11488    11542      +54     
- Misses         5611     5661      +50     
- Partials       1595     1601       +6     
Impacted Files Coverage Δ
...java/org/opensearch/security/user/UserService.java 46.23% <46.23%> (ø)
...security/dlic/rest/api/InternalUsersApiAction.java 75.86% <52.50%> (-8.14%) ⬇️
.../opensearch/security/OpenSearchSecurityPlugin.java 80.27% <100.00%> (+0.11%) ⬆️
...security/dlic/rest/api/SecurityRestApiActions.java 95.00% <100.00%> (ø)
...opensearch/security/user/UserServiceException.java 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@DarshitChanpura
Copy link
Member

@scrawfor99 What do you think about combining this PR with Security User Refactor as most of the changes are same? I don't mind reviewing here, but would like to know your thoughts

@stephen-crawford
Copy link
Contributor Author

Hi @DarshitChanpura, this is meant to be merged after the security user refactor PR so once that is done, only the new changes will show in the diff. You can review it then if that works.

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