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

Fixes authtoken endpoint #4628

Conversation

DarshitChanpura
Copy link
Member

@DarshitChanpura DarshitChanpura commented Aug 8, 2024

Description

This change ensures that authtoken endpoint works to vend authtoken for internalusers API.
The issue was root-caused to improperly handled generateAuthToken(). This PR modifies the associated method and adds missing tests for /authtoken endpoint.

Also fixes a small issue where timeout parameter is not working as expected for certificates API.

Issues Resolved

Testing

  • integration testing

Check List

  • New functionality includes testing
    - [ ] New functionality has been documented
    - [ ] New Roles/Permissions have a corresponding security dashboards plugin PR
    - [ ] API changes companion pull request created
  • 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.

Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 65.28%. Comparing base (e73fc24) to head (cc26b94).

Files Patch % Lines
...java/org/opensearch/security/user/UserService.java 16.66% 5 Missing ⚠️
.../security/dlic/rest/api/CertificatesApiAction.java 0.00% 1 Missing ⚠️
...security/dlic/rest/api/InternalUsersApiAction.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4628      +/-   ##
==========================================
- Coverage   65.29%   65.28%   -0.01%     
==========================================
  Files         317      317              
  Lines       22309    22309              
  Branches     3588     3588              
==========================================
- Hits        14566    14564       -2     
- Misses       5949     5950       +1     
- Partials     1794     1795       +1     
Files Coverage Δ
.../security/dlic/rest/api/CertificatesApiAction.java 35.13% <0.00%> (-0.98%) ⬇️
...security/dlic/rest/api/InternalUsersApiAction.java 76.85% <66.66%> (ø)
...java/org/opensearch/security/user/UserService.java 44.92% <16.66%> (-0.40%) ⬇️

... and 1 file with indirect coverage changes

Copy link
Contributor

@stephen-crawford stephen-crawford left a comment

Choose a reason for hiding this comment

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

A whale-come change

      ♥
      .
     ":"
   ___:____    |"\/"|
 ,'        `.   \  /
 |  O       \___/  |

^^^^^^^^^^^^^^^^~

@DarshitChanpura DarshitChanpura merged commit 9e62096 into opensearch-project:main Aug 9, 2024
40 of 42 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 9, 2024
Signed-off-by: Darshit Chanpura <[email protected]>
(cherry picked from commit 9e62096)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] /authtoken endpoint isn't working
5 participants