hydra icon indicating copy to clipboard operation
hydra copied to clipboard

feat: basic auth support for hydra cli

Open phsym opened this issue 3 years ago • 8 comments

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

  • [x] I have read the contributing guidelines.
  • [ ] I have referenced an issue containing the design document if my change introduces a new feature.
  • [x] I am following the contributing code guidelines.
  • [x] I have read the security policy.
  • [x] 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 [email protected]) from the maintainers to push the changes.
  • [ ] I have added tests that prove my fix is effective or that my feature works.
  • [x] I have added or changed the documentation.

phsym avatar Mar 15 '22 11:03 phsym

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

phsym avatar Mar 15 '22 11:03 phsym

Codecov Report

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

:exclamation: 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%) :arrow_down:
cmd/clients.go 100.00% <100.00%> (ø)
cmd/cli/handler_janitor.go 78.88% <0.00%> (-2.73%) :arrow_down:
persistence/sql/persister.go 78.57% <0.00%> (-1.09%) :arrow_down:
consent/strategy_default.go 69.70% <0.00%> (-0.62%) :arrow_down:
oauth2/trust/handler.go 75.86% <0.00%> (-0.41%) :arrow_down:
persistence/sql/persister_grant_jwk.go 81.08% <0.00%> (-0.34%) :arrow_down:
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.

codecov[bot] avatar Mar 15 '22 11:03 codecov[bot]

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 avatar Mar 20 '22 12:03 aeneasr

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 avatar Mar 25 '22 10:03 aeneasr

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

phsym avatar Mar 30 '22 16:03 phsym

Is this ready for review? :)

aeneasr avatar Apr 09 '22 22:04 aeneasr

@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?

raman-nbg avatar May 20 '22 11:05 raman-nbg

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 avatar May 20 '22 12:05 phsym