jmgilman / vaultrs

An asynchronous Rust client library for the Hashicorp Vault API
https://docs.rs/vaultrs
MIT License
93 stars 60 forks source link

Hashicorp cloud platform (HCP) login #101

Open andrewbaxter opened 1 month ago

andrewbaxter commented 1 month ago

Edit: I noticed that there's already similar code in here for jwt/oidc, so updating the issue accordingly.

Hashicorp cloud has an oauth2 browser login method that I'd like to use. I see this has a jwt/oidc that looks similar, but I can't tell if that's the same. The HCP thing doesn't appear to be oidc (maybe?) and the port, some of the endpoints, etc are different (i.e. it uses oauth2/auth for the auth url, but the oidc method implemented here seems to use oidc/auth_url?).

For reference, the code the hcp uses is here:

I'd be happy to try implementing it if you have any suggestions on how to structure it.

Haennetz commented 1 month ago

Hey @andrewbaxter, did I assume that right that you plan to use this create for accessing a HCP vault instance?

andrewbaxter commented 1 month ago

Yeah, precisely. Although the more I use it the more it seems different from the self hosted vault I'm used to...

Haennetz commented 1 month ago

I also found a documentation about autenticate to HCP. If you want fell free to add it you can use the new modul named hcp for that. I don't have any expierence with the HCP.