python-barbicanclient


Namepython-barbicanclient JSON
Version 7.0.0 PyPI version JSON
download
home_pagehttps://docs.openstack.org/python-barbicanclient/latest/
SummaryClient Library for OpenStack Barbican Key Management API
upload_time2024-07-03 09:17:00
maintainerNone
docs_urlNone
authorOpenStack
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            python-barbicanclient
=====================

.. image:: https://img.shields.io/pypi/v/python-barbicanclient.svg
    :target: https://pypi.org/project/python-barbicanclient/
    :alt: Latest Version

This is a client for the `Barbican <https://github.com/openstack/barbican>`__
Key Management API.  There is a Python library for accessing the API
(`barbicanclient` module), and a command-line script (`barbican`).

Installation
------------

The client is
`pip installable <https://pypi.org/project/python-barbicanclient>`__ as
follows:

.. code:: console

  pip install python-barbicanclient


barbicanclient - Python Library
-------------------------------

The full api is
`documented in the official OpenStack documentation site <https://docs.openstack.org/python-barbicanclient/latest/>`__.


Here's an example of storing a secret in barbican using the python library
with keystone authentication:

.. code:: python

    >>> from keystoneclient.auth import identity
    >>> from keystoneauth1 import session
    >>> from barbicanclient import client

    >>> # We'll use Keystone API v3 for authentication
    >>> auth = identity.v3.Password(auth_url='http://localhost:5000/v3',
    ...                             username='admin_user',
    ...                             user_domain_name='Default',
    ...                             password='password',
    ...                             project_name='demo',
    ...                             project_domain_name='Default')

    >>> # Next we'll create a Keystone session using the auth plugin we just created
    >>> sess = session.Session(auth=auth)

    >>> # Now we use the session to create a Barbican client
    >>> barbican = client.Client(session=sess)

    >>> # Let's create a Secret to store some sensitive data
    >>> secret = barbican.secrets.create(name='Self destruction sequence',
    ...                                  payload='the magic words are squeamish ossifrage')

    >>> # Now let's store the secret by using its store() method. This will send the secret data
    >>> # to Barbican, where it will be encrypted and stored securely in the cloud.
    >>> secret.store()
    'http://localhost:9311/v1/secrets/85b220fd-f414-483f-94e4-2f422480f655'

    >>> # The URI returned by store() uniquely identifies your secret in the Barbican service.
    >>> # After a secret is stored, the URI is also available by accessing
    >>> # the secret_ref attribute.
    >>> print(secret.secret_ref)
    http://localhost:9311/v1/secrets/091adb32-4050-4980-8558-90833c531413

    >>> # When we need to retrieve our secret at a later time, we can use the secret_ref
    >>> retrieved_secret = barbican.secrets.get('http://localhost:9311/v1/secrets/091adb32-4050-4980-8558-90833c531413')
    >>> # We can access the secret payload by using the payload attribute.
    >>> # Barbican decrypts the secret and sends it back.
    >>> print(retrieved_secret.payload)
    the magic words are squeamish ossifrage

.. note::

    In order for the example above to work Barbican must be running and
    configured to use the Keystone Middleware. For more information on
    setting this up please visit:
    https://docs.openstack.org/barbican/latest/configuration/keystone.html [1]_

barbican - Command Line Client
------------------------------

The command line client is self-documenting. Use the --help flag to access the
usage options

.. code:: console

    $ barbican --help
    usage: barbican [--version] [-v] [--log-file LOG_FILE] [-q] [-h] [--debug]
                    [--no-auth] [--os-identity-api-version <identity-api-version>]
                    [--os-auth-url <auth-url>] [--os-username <auth-user-name>]
                    [--os-user-id <auth-user-id>] [--os-password <auth-password>]
                    [--os-user-domain-id <auth-user-domain-id>]
                    [--os-user-domain-name <auth-user-domain-name>]
                    [--os-tenant-name <auth-tenant-name>]
                    [--os-tenant-id <tenant-id>]
                    [--os-project-id <auth-project-id>]
                    [--os-project-name <auth-project-name>]
                    [--os-project-domain-id <auth-project-domain-id>]
                    [--os-project-domain-name <auth-project-domain-name>]
                    [--endpoint <barbican-url>] [--insecure]
                    [--os-cacert <ca-certificate>] [--os-cert <certificate>]
                    [--os-key <key>] [--timeout <seconds>]

    Command-line interface to the Barbican API.

    optional arguments:
      --version             show program's version number and exit
      -v, --verbose         Increase verbosity of output. Can be repeated.
      --log-file LOG_FILE   Specify a file to log output. Disabled by default.
      -q, --quiet           suppress output except warnings and errors
      -h, --help            show this help message and exit
      --debug               show trace backs on errors
      --no-auth, -N         Do not use authentication.
      --os-identity-api-version <identity-api-version>
                            Specify Identity API version to use. Defaults to
                            env[OS_IDENTITY_API_VERSION] or 3.

      --os-auth-url <auth-url>, -A <auth-url>
                            Defaults to env[OS_AUTH_URL].
      --os-username <auth-user-name>, -U <auth-user-name>
                            Defaults to env[OS_USERNAME].
      --os-user-id <auth-user-id>
                            Defaults to env[OS_USER_ID].
      --os-password <auth-password>, -P <auth-password>
                            Defaults to env[OS_PASSWORD].
      --os-user-domain-id <auth-user-domain-id>
                            Defaults to env[OS_USER_DOMAIN_ID].
      --os-user-domain-name <auth-user-domain-name>
                            Defaults to env[OS_USER_DOMAIN_NAME].
      --os-tenant-name <auth-tenant-name>, -T <auth-tenant-name>
                            Defaults to env[OS_TENANT_NAME].
      --os-tenant-id <tenant-id>, -I <tenant-id>
                            Defaults to env[OS_TENANT_ID].
      --os-project-id <auth-project-id>
                            Another way to specify tenant ID. This option is
                            mutually exclusive with --os-tenant-id. Defaults to
                            env[OS_PROJECT_ID].
      --os-project-name <auth-project-name>
                            Another way to specify tenant name. This option is
                            mutually exclusive with --os-tenant-name. Defaults to
                            env[OS_PROJECT_NAME].
      --os-project-domain-id <auth-project-domain-id>
                            Defaults to env[OS_PROJECT_DOMAIN_ID].
      --os-project-domain-name <auth-project-domain-name>
                            Defaults to env[OS_PROJECT_DOMAIN_NAME].
      --endpoint <barbican-url>, -E <barbican-url>
      --endpoint <barbican-url>, -E <barbican-url>
                            Defaults to env[BARBICAN_ENDPOINT].
      --insecure            Explicitly allow client to perform "insecure" TLS
                            (https) requests. The server's certificate will not be
                            verified against any certificate authorities. This
                            option should be used with caution.
      --os-cacert <ca-certificate>
                            Specify a CA bundle file to use in verifying a TLS
                            (https) server certificate. Defaults to
                            env[OS_CACERT].
      --os-cert <certificate>
                            Defaults to env[OS_CERT].
      --os-key <key>        Defaults to env[OS_KEY].
      --timeout <seconds>   Set request timeout (in seconds).

    See "barbican help COMMAND" for help on a specific command.

    Commands:
      acl get                  Retrieve ACLs for a secret or container by providing its href.
      acl delete               Delete ACLs for a secret or container as identified by its href.
      acl submit               Submit ACL on a secret or container as identified by its href.
      acl user add             Add ACL users to a secret or container as identified by its href.
      acl user remove          Remove ACL users from a secret or container as identified by its href.
      ca get                   Retrieve a CA by providing its URI.
      ca list                  List CAs.
      complete                 print bash completion command
      secret container create  Store a container in Barbican.
      secret container delete  Delete a container by providing its href.
      secret container get     Retrieve a container by providing its URI.
      secret container list    List containers.
      help                     print detailed help for another command
      secret order create      Create a new order.
      secret order delete      Delete an order by providing its href.
      secret order get         Retrieve an order by providing its URI.
      secret order list        List orders.
      secret delete            Delete an secret by providing its href.
      secret get               Retrieve a secret by providing its URI.
      secret list              List secrets.
      secret store             Store a secret in Barbican
      secret update            Update a secret with no payload in Barbican.

* License: Apache License, Version 2.0
* `PyPi`_ - package installation
* `Online Documentation`_
* `Launchpad project`_ - release management
* `Blueprints`_ - feature specifications
* `Bugs`_ - issue tracking
* `Source`_
* `Specs`_
* `Getting involved`_

.. _PyPi: https://pypi.org/project/python-barbicanclient/
.. _Online Documentation: https://docs.openstack.org/python-barbicanclient/latest/
.. _Launchpad project: https://launchpad.net/python-barbicanclient/
.. _Blueprints: https://blueprints.launchpad.net/python-barbicanclient/
.. _Bugs: https://bugs.launchpad.net/python-barbicanclient
.. _Source: https://opendev.org/openstack/python-barbicanclient/
.. _Getting involved: https://docs.openstack.org/barbican/latest/contributor/getting_involved.html
.. _Specs: https://specs.openstack.org/openstack/barbican-specs/


.. [1] Documentation in this link is currently incomplete. Please use the `devstack setup <https://docs.openstack.org/barbican/latest/contributor/devstack.html>`__.




            

Raw data

            {
    "_id": null,
    "home_page": "https://docs.openstack.org/python-barbicanclient/latest/",
    "name": "python-barbicanclient",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "OpenStack",
    "author_email": "openstack-discuss@lists.openstack.org",
    "download_url": "https://files.pythonhosted.org/packages/6b/13/af3408d95dee59b1fc6110ed9c7c75e6374f822994ea9724e22bb5cf63e5/python-barbicanclient-7.0.0.tar.gz",
    "platform": null,
    "description": "python-barbicanclient\n=====================\n\n.. image:: https://img.shields.io/pypi/v/python-barbicanclient.svg\n    :target: https://pypi.org/project/python-barbicanclient/\n    :alt: Latest Version\n\nThis is a client for the `Barbican <https://github.com/openstack/barbican>`__\nKey Management API.  There is a Python library for accessing the API\n(`barbicanclient` module), and a command-line script (`barbican`).\n\nInstallation\n------------\n\nThe client is\n`pip installable <https://pypi.org/project/python-barbicanclient>`__ as\nfollows:\n\n.. code:: console\n\n  pip install python-barbicanclient\n\n\nbarbicanclient - Python Library\n-------------------------------\n\nThe full api is\n`documented in the official OpenStack documentation site <https://docs.openstack.org/python-barbicanclient/latest/>`__.\n\n\nHere's an example of storing a secret in barbican using the python library\nwith keystone authentication:\n\n.. code:: python\n\n    >>> from keystoneclient.auth import identity\n    >>> from keystoneauth1 import session\n    >>> from barbicanclient import client\n\n    >>> # We'll use Keystone API v3 for authentication\n    >>> auth = identity.v3.Password(auth_url='http://localhost:5000/v3',\n    ...                             username='admin_user',\n    ...                             user_domain_name='Default',\n    ...                             password='password',\n    ...                             project_name='demo',\n    ...                             project_domain_name='Default')\n\n    >>> # Next we'll create a Keystone session using the auth plugin we just created\n    >>> sess = session.Session(auth=auth)\n\n    >>> # Now we use the session to create a Barbican client\n    >>> barbican = client.Client(session=sess)\n\n    >>> # Let's create a Secret to store some sensitive data\n    >>> secret = barbican.secrets.create(name='Self destruction sequence',\n    ...                                  payload='the magic words are squeamish ossifrage')\n\n    >>> # Now let's store the secret by using its store() method. This will send the secret data\n    >>> # to Barbican, where it will be encrypted and stored securely in the cloud.\n    >>> secret.store()\n    'http://localhost:9311/v1/secrets/85b220fd-f414-483f-94e4-2f422480f655'\n\n    >>> # The URI returned by store() uniquely identifies your secret in the Barbican service.\n    >>> # After a secret is stored, the URI is also available by accessing\n    >>> # the secret_ref attribute.\n    >>> print(secret.secret_ref)\n    http://localhost:9311/v1/secrets/091adb32-4050-4980-8558-90833c531413\n\n    >>> # When we need to retrieve our secret at a later time, we can use the secret_ref\n    >>> retrieved_secret = barbican.secrets.get('http://localhost:9311/v1/secrets/091adb32-4050-4980-8558-90833c531413')\n    >>> # We can access the secret payload by using the payload attribute.\n    >>> # Barbican decrypts the secret and sends it back.\n    >>> print(retrieved_secret.payload)\n    the magic words are squeamish ossifrage\n\n.. note::\n\n    In order for the example above to work Barbican must be running and\n    configured to use the Keystone Middleware. For more information on\n    setting this up please visit:\n    https://docs.openstack.org/barbican/latest/configuration/keystone.html [1]_\n\nbarbican - Command Line Client\n------------------------------\n\nThe command line client is self-documenting. Use the --help flag to access the\nusage options\n\n.. code:: console\n\n    $ barbican --help\n    usage: barbican [--version] [-v] [--log-file LOG_FILE] [-q] [-h] [--debug]\n                    [--no-auth] [--os-identity-api-version <identity-api-version>]\n                    [--os-auth-url <auth-url>] [--os-username <auth-user-name>]\n                    [--os-user-id <auth-user-id>] [--os-password <auth-password>]\n                    [--os-user-domain-id <auth-user-domain-id>]\n                    [--os-user-domain-name <auth-user-domain-name>]\n                    [--os-tenant-name <auth-tenant-name>]\n                    [--os-tenant-id <tenant-id>]\n                    [--os-project-id <auth-project-id>]\n                    [--os-project-name <auth-project-name>]\n                    [--os-project-domain-id <auth-project-domain-id>]\n                    [--os-project-domain-name <auth-project-domain-name>]\n                    [--endpoint <barbican-url>] [--insecure]\n                    [--os-cacert <ca-certificate>] [--os-cert <certificate>]\n                    [--os-key <key>] [--timeout <seconds>]\n\n    Command-line interface to the Barbican API.\n\n    optional arguments:\n      --version             show program's version number and exit\n      -v, --verbose         Increase verbosity of output. Can be repeated.\n      --log-file LOG_FILE   Specify a file to log output. Disabled by default.\n      -q, --quiet           suppress output except warnings and errors\n      -h, --help            show this help message and exit\n      --debug               show trace backs on errors\n      --no-auth, -N         Do not use authentication.\n      --os-identity-api-version <identity-api-version>\n                            Specify Identity API version to use. Defaults to\n                            env[OS_IDENTITY_API_VERSION] or 3.\n\n      --os-auth-url <auth-url>, -A <auth-url>\n                            Defaults to env[OS_AUTH_URL].\n      --os-username <auth-user-name>, -U <auth-user-name>\n                            Defaults to env[OS_USERNAME].\n      --os-user-id <auth-user-id>\n                            Defaults to env[OS_USER_ID].\n      --os-password <auth-password>, -P <auth-password>\n                            Defaults to env[OS_PASSWORD].\n      --os-user-domain-id <auth-user-domain-id>\n                            Defaults to env[OS_USER_DOMAIN_ID].\n      --os-user-domain-name <auth-user-domain-name>\n                            Defaults to env[OS_USER_DOMAIN_NAME].\n      --os-tenant-name <auth-tenant-name>, -T <auth-tenant-name>\n                            Defaults to env[OS_TENANT_NAME].\n      --os-tenant-id <tenant-id>, -I <tenant-id>\n                            Defaults to env[OS_TENANT_ID].\n      --os-project-id <auth-project-id>\n                            Another way to specify tenant ID. This option is\n                            mutually exclusive with --os-tenant-id. Defaults to\n                            env[OS_PROJECT_ID].\n      --os-project-name <auth-project-name>\n                            Another way to specify tenant name. This option is\n                            mutually exclusive with --os-tenant-name. Defaults to\n                            env[OS_PROJECT_NAME].\n      --os-project-domain-id <auth-project-domain-id>\n                            Defaults to env[OS_PROJECT_DOMAIN_ID].\n      --os-project-domain-name <auth-project-domain-name>\n                            Defaults to env[OS_PROJECT_DOMAIN_NAME].\n      --endpoint <barbican-url>, -E <barbican-url>\n      --endpoint <barbican-url>, -E <barbican-url>\n                            Defaults to env[BARBICAN_ENDPOINT].\n      --insecure            Explicitly allow client to perform \"insecure\" TLS\n                            (https) requests. The server's certificate will not be\n                            verified against any certificate authorities. This\n                            option should be used with caution.\n      --os-cacert <ca-certificate>\n                            Specify a CA bundle file to use in verifying a TLS\n                            (https) server certificate. Defaults to\n                            env[OS_CACERT].\n      --os-cert <certificate>\n                            Defaults to env[OS_CERT].\n      --os-key <key>        Defaults to env[OS_KEY].\n      --timeout <seconds>   Set request timeout (in seconds).\n\n    See \"barbican help COMMAND\" for help on a specific command.\n\n    Commands:\n      acl get                  Retrieve ACLs for a secret or container by providing its href.\n      acl delete               Delete ACLs for a secret or container as identified by its href.\n      acl submit               Submit ACL on a secret or container as identified by its href.\n      acl user add             Add ACL users to a secret or container as identified by its href.\n      acl user remove          Remove ACL users from a secret or container as identified by its href.\n      ca get                   Retrieve a CA by providing its URI.\n      ca list                  List CAs.\n      complete                 print bash completion command\n      secret container create  Store a container in Barbican.\n      secret container delete  Delete a container by providing its href.\n      secret container get     Retrieve a container by providing its URI.\n      secret container list    List containers.\n      help                     print detailed help for another command\n      secret order create      Create a new order.\n      secret order delete      Delete an order by providing its href.\n      secret order get         Retrieve an order by providing its URI.\n      secret order list        List orders.\n      secret delete            Delete an secret by providing its href.\n      secret get               Retrieve a secret by providing its URI.\n      secret list              List secrets.\n      secret store             Store a secret in Barbican\n      secret update            Update a secret with no payload in Barbican.\n\n* License: Apache License, Version 2.0\n* `PyPi`_ - package installation\n* `Online Documentation`_\n* `Launchpad project`_ - release management\n* `Blueprints`_ - feature specifications\n* `Bugs`_ - issue tracking\n* `Source`_\n* `Specs`_\n* `Getting involved`_\n\n.. _PyPi: https://pypi.org/project/python-barbicanclient/\n.. _Online Documentation: https://docs.openstack.org/python-barbicanclient/latest/\n.. _Launchpad project: https://launchpad.net/python-barbicanclient/\n.. _Blueprints: https://blueprints.launchpad.net/python-barbicanclient/\n.. _Bugs: https://bugs.launchpad.net/python-barbicanclient\n.. _Source: https://opendev.org/openstack/python-barbicanclient/\n.. _Getting involved: https://docs.openstack.org/barbican/latest/contributor/getting_involved.html\n.. _Specs: https://specs.openstack.org/openstack/barbican-specs/\n\n\n.. [1] Documentation in this link is currently incomplete. Please use the `devstack setup <https://docs.openstack.org/barbican/latest/contributor/devstack.html>`__.\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Client Library for OpenStack Barbican Key Management API",
    "version": "7.0.0",
    "project_urls": {
        "Homepage": "https://docs.openstack.org/python-barbicanclient/latest/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "54342214dda3a531e970df3655f7baa079a93ba7adc1608e12967aac4c4c0bc5",
                "md5": "e823e7dadd7236c7444909c3066aa6db",
                "sha256": "fea5c9dbcdf3ca2ad2c4abf7472a4cdd36123b5121ee267e09f332c8c1a680e6"
            },
            "downloads": -1,
            "filename": "python_barbicanclient-7.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e823e7dadd7236c7444909c3066aa6db",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 88482,
            "upload_time": "2024-07-03T09:16:58",
            "upload_time_iso_8601": "2024-07-03T09:16:58.893821Z",
            "url": "https://files.pythonhosted.org/packages/54/34/2214dda3a531e970df3655f7baa079a93ba7adc1608e12967aac4c4c0bc5/python_barbicanclient-7.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b13af3408d95dee59b1fc6110ed9c7c75e6374f822994ea9724e22bb5cf63e5",
                "md5": "fe8c5ccee65db40ec1262878ce17aafa",
                "sha256": "316af38a76d65a4af9135c700a7f3a46e2a5ab0485e93969687f6b62317295c7"
            },
            "downloads": -1,
            "filename": "python-barbicanclient-7.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "fe8c5ccee65db40ec1262878ce17aafa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 128741,
            "upload_time": "2024-07-03T09:17:00",
            "upload_time_iso_8601": "2024-07-03T09:17:00.783481Z",
            "url": "https://files.pythonhosted.org/packages/6b/13/af3408d95dee59b1fc6110ed9c7c75e6374f822994ea9724e22bb5cf63e5/python-barbicanclient-7.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-03 09:17:00",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "python-barbicanclient"
}
        
Elapsed time: 0.38812s