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

Complex secrets and secret metadata (e.g., lease IDs and TTLs) #7

Open
emk opened this issue Sep 21, 2016 · 2 comments
Open

Complex secrets and secret metadata (e.g., lease IDs and TTLs) #7

emk opened this issue Sep 21, 2016 · 2 comments

Comments

@emk
Copy link
Contributor

emk commented Sep 21, 2016

At some point in the future, I'd also love to port https://github.com/emk/credentials and https://github.com/faradayio/credentials_to_env to use your vault-rs library instead of the dodgy, hand-rolled internal library that I use now.

To do this, I would need to add some new APIs to vault-rs:

  1. APIs for reading and writing compound secrets easily. These would correspond to vault secrets created like this:

    $ vault write secret/test user="foo" pass="bar"
    Success! Data written to: secret/test
    $ vault read secret/test
    Key                 Value
    ---                 -----
    refresh_interval    720h0m0s
    pass                bar
    user                foo

    Code using this API might hypothetically look something like:

    #[derive(RustcEncodable, RustcDecodable)]
    struct Secret {
        user: String,
        pass: String,
    }
    let secret: VaultResponse<Secret> = try!(client.get_secret_data("secret/test"));
  2. APIs for accessing the lease ID, TTL, etc. These could be accessed via the VaultResponse object, I believe, in the example above.

Do these features already exist anywhere in the current release (I didn't see them)? If not, would you be interested in receiving a PR adding APIs along these general lines? Please feel free to suggest better names, API improvements, etc.

Once again, thank you for maintaining this crate!

@emk emk mentioned this issue Sep 21, 2016
@emk
Copy link
Contributor Author

emk commented Sep 21, 2016

(Just for future reference.) Implementing an API along these lines will allow us enable one of the tests added in #6.

@ChrisMacNaughton
Copy link
Owner

I quite like the idea of being able to deserialize data from Vault, as your example demonstrates.

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

No branches or pull requests

2 participants