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: basic auth support for hydra cli #3035

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

phsym
Copy link

@phsym phsym commented Mar 15, 2022

Required for example in case where hydra admin endpoint
is protected behind a reverse proxy that enforces basic auth.
If --access-token arg is set, it takes precedence over basic auth

It does not apply to the token revoke command which goes though the public endpoint and already uses basic auth with clientId and clientSecret

Related issue(s)

#2880

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security. vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

@phsym phsym requested a review from aeneasr as a code owner March 15, 2022 11:20
@phsym
Copy link
Author

phsym commented Mar 15, 2022

Not sure how to proceed with the 3 remaining checkboxes for such a minor change

@codecov
Copy link

codecov bot commented Mar 15, 2022

Codecov Report

Merging #3035 (534a4d4) into master (a383b5a) will decrease coverage by 0.14%.
The diff coverage is 57.14%.

❗ Current head 534a4d4 differs from pull request most recent head 5d1332f. Consider uploading reports for the commit 5d1332f to get more accurate results

@@            Coverage Diff             @@
##           master    #3035      +/-   ##
==========================================
- Coverage   79.52%   79.37%   -0.15%     
==========================================
  Files         112      112              
  Lines        7967     7895      -72     
==========================================
- Hits         6336     6267      -69     
  Misses       1225     1225              
+ Partials      406      403       -3     
Impacted Files Coverage Δ
cmd/cli/handler_helper.go 57.14% <0.00%> (-2.56%) ⬇️
cmd/clients.go 100.00% <100.00%> (ø)
cmd/cli/handler_janitor.go 78.88% <0.00%> (-2.73%) ⬇️
persistence/sql/persister.go 78.57% <0.00%> (-1.09%) ⬇️
consent/strategy_default.go 69.70% <0.00%> (-0.62%) ⬇️
oauth2/trust/handler.go 75.86% <0.00%> (-0.41%) ⬇️
persistence/sql/persister_grant_jwk.go 81.08% <0.00%> (-0.34%) ⬇️
oauth2/handler.go 68.27% <0.00%> (ø)
hsm/manager_nohsm.go 0.00% <0.00%> (ø)
oauth2/trust/manager.go 100.00% <0.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9bc59be...5d1332f. Read the comment docs.

@aeneasr

This comment was marked as duplicate.

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Thank you! This look great :) Could you please add documentation to the commands (for example) explaining how to use this feature? Because right now it's very hidden in the code base and noone will really know how to use it!

@aeneasr aeneasr self-assigned this Mar 22, 2022
@aeneasr
Copy link
Member

aeneasr commented Mar 25, 2022

While the PR is being worked on I will mark it as a draft. That declutters our review backlog :)

Once you're done with your changes and would like someone to review them, mark the PR as ready and request a review from one of the maintainers.

Thank you!

@aeneasr aeneasr marked this pull request as draft March 25, 2022 10:19
@phsym
Copy link
Author

phsym commented Mar 30, 2022

Thank you! This look great :) Could you please add documentation to the commands (for example) explaining how to use this feature? Because right now it's very hidden in the code base and noone will really know how to use it!

Hi, coming back on this (sorry, I was busy with other stuff). Sure, I'll add some doc to the command

Required for example in case where hydra admin endpoint
is protected behind a reverse proxy that enforces basic auth.
If --access-token arg is set, it takes precedence over basic auth

It does not apply to token revoke command
@aeneasr
Copy link
Member

aeneasr commented Apr 9, 2022

Is this ready for review? :)

@raman-nbg
Copy link
Contributor

@aeneasr what kind of documentation is required to complete this? Only in cmd/clients.go or also somewhere else?

Anyway, shouldn't the changes of cmd/clients.go should be added to other files (e.g. cmd/keys.go), too?

@phsym
Copy link
Author

phsym commented May 20, 2022

Oh crap, this PR went totally out of my radar for some reason. @aeneasr I believe it's ready for review unless you see other parts that need to be documented

@phsym phsym marked this pull request as ready for review May 20, 2022 12:17
@phsym phsym requested a review from aeneasr May 20, 2022 12:17
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.

None yet

3 participants