GithubHelp home page GithubHelp logo

thedac / charm-interface-vault-kv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openstack-charmers/charm-interface-vault-kv

0.0 1.0 0.0 24 KB

Vault interface for simple KV secrets management

License: Other

Python 100.00%

charm-interface-vault-kv's Introduction

Overview

This interface handles the communication with the vault charm using the vault-kv interface type.

Vault will enable simple KV based secrets backends with AppRole based authentication and policies to allow consuming charms to store and retrieve secrets in Vault.

Access to the backend will be limited to the network address binding of of the relation endpoint name and ownership of a secret_id which the consuming application must retrieve using a one-shot token out-of-band from Juju.

Usage

Requires

The interface layer will set the following reactive states, as appropriate:

  • {relation_name}.connected The relation is established and ready for the local charm to make a request for access to a secrets backend using the request_secret_backend method.

  • {relation_name}.available When vault has created the backend and an associated AppRole to allow the local charm to store and retrieve secrets in vault - the vault_url and unit_role_id properties will be set.

For example:

from charms.reactive.flags import endpoint_from_flag

 @when('secrets-storage.connected')
 def ss_connected():
 	secrets = endpoint_from_flag('secrets-storage.connected')
 	secrets.request_secret_backend('charm-vaultlocker', isolated=True)


 @when('secrets-storage.available')
 def ss_ready_for_use():
 	secrets = endpoint_from_flag('secrets-storage.connected')
 	configure_my_local_service(
 		vault_url=secrets.vault_url,
 		role_id=secrets.unit_role_id,
        secret_id=vault.get_response(secrets.unit_token),
 		backend='charm-vaultlocker',
 	)

Note that the backend name must be prefixed with 'charm-' otherwise the vault charm will skip creation of the secrets backend and associated access.

charm-interface-vault-kv's People

Contributors

dosaboy avatar fnordahl avatar javacruft avatar johnsca avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.