Reactive layer for interacting with barbican
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
actions
lib/charms/layer
reactive
.gitignore
LICENSE
Makefile
README.md
actions.yaml
config.yaml
layer.yaml
metadata.yaml
tox.ini
wheelhouse.txt

README.md

Juju Layer Barbican Client

This layer enables an application to plugin to Barbican!

This layer will block until it has secrets provisioned, either manually via action, or by pre-defined container-ref specified in charm config.yaml.

Actions

Two actions accompany this layer that can be used to get and set secrets in Barbican.

  • set-secrets
  • get-secrets

States

  • 'secrets.available' - This flag is set when the layer verifies it has a secret container href.

Api

  • 'get_barbican_secrets()' is exposed through charms.layer.barbican_client, and can be used like so:
from charms.reactive import when, when_not, set_state
from charmhelpers.core.templating import render

from charms.layer.barbican_client import get_barbican_secrets


@when('secrets.available')
@when_not('secrets.set')
def get_the_secrets():
    """Render secrets from barbican into template for
    application to use
    """

    secrets = get_barbican_secrets()
    render(source='my-template.yaml', target='/tmp/config.yaml',
           perms=0o644, context=secrets)
    set_state('secrets.set')

Authors

Copyright

Copyright (c) 2016 James Beedy jamesbeedy@gmail.com