8000 Add decode token API endpoint by alainchiasson · Pull Request #1185 · hvac/hvac · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add decode token API endpoint #1185

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

alainchiasson
Copy link

Adding decode-token to key.py simplifying the final decrypting/decoding of a generated root token. This uses the API endpoint sys/decode-token present since at least 1.13.x

Other than the function, I had rewritten two test cases to use decode token instead of the util.decode_genreated_root_token codethat forked a Vault CLI call ( vault operator ... ), that in the end called the same API
endpoint.

util.decode_generated_root_token was also removed, as it is only used by the test.

This also resolves #1184

@alainchiasson alainchiasson requested a review from a team as a code owner August 6, 2024 11:47
@alainchiasson
Copy link
Author

Also added and tested the documentation.

@briantist briantist added enhancement a new feature or addition system backend generally related to the Vault system backend routes minor Used as part of release-drafter's version-resolver configuration labels Aug 6, 2024
@alainchiasson
Copy link
Author
alainchiasson commented Aug 7, 2024

I see that tests fail as the sys/decode-token was only added in 1.13.x

While I added the util.decode_generated_root_token and added an if lt 1.13 to select the util or my new code. The two questions are:

  • 1.13 is more than 3 versions back, do we stil need it ? I already made the change in the tests.
  • How do implement that at the code level - or just let it do a "Path not supported" exception ? Should I make an effort to add to an exception ?

The failing documentation testing though, I'm not certain what version is being used - my installed version is 1.16

edit: just saw doctest is run agains 1.7 enterprise (the last free one)

Copy link
codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.57%. Comparing base (2d2c80e) to head (4f5d767).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1185      +/-   ##
==========================================
+ Coverage   87.56%   87.57%   +0.01%     
==========================================
  Files          67       67              
  Lines        3288     3292       +4     
==========================================
+ Hits         2879     2883       +4     
  Misses        409      409              
Files Coverage Δ
hvac/api/system_backend/key.py 87.91% <100.00%> (+0.55%) ⬆️

@alainchiasson
Copy link
Author

Just a quick follow-up. I stopped "fidling" with the code. Is there anything I can do to help move this forward? I have implemented a decode that can be done locally in HVAC - the code implements what is being done server side ( though go -> python ).

@briantist
Copy link
Contributor

thanks @alainchiasson ! I do apologize for the slow turnaround, just have a bit too much going on lately and that leaves less time I can dedicate to projects like this but hopefully I'll see some time opening up soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a new feature or addition minor Used as part of release-drafter's version-resolver configuration system backend generally related to the Vault system backend routes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use decode-token as part of root token generation
2 participants
0