{"id":20111212,"url":"https://github.com/openstack/python-barbicanclient","last_synced_at":"2025-04-06T22:10:05.706Z","repository":{"id":17344349,"uuid":"20115730","full_name":"openstack/python-barbicanclient","owner":"openstack","description":"Client library for Barbican API. Mirror of code maintained at opendev.org.","archived":false,"fork":false,"pushed_at":"2025-03-21T10:14:54.000Z","size":1221,"stargazers_count":48,"open_issues_count":0,"forks_count":20,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-30T21:08:08.142Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://opendev.org/openstack/python-barbicanclient","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openstack.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-05-23T22:16:17.000Z","updated_at":"2025-03-12T15:28:43.000Z","dependencies_parsed_at":"2024-03-12T14:03:02.963Z","dependency_job_id":"c8a4ff50-26e0-4129-aefd-d05a08cfed8d","html_url":"https://github.com/openstack/python-barbicanclient","commit_stats":null,"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fpython-barbicanclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fpython-barbicanclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fpython-barbicanclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openstack%2Fpython-barbicanclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openstack","download_url":"https://codeload.github.com/openstack/python-barbicanclient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T18:14:54.223Z","updated_at":"2025-04-06T22:10:05.649Z","avatar_url":"https://github.com/openstack.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"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 \u003chttps://github.com/openstack/barbican\u003e`__\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 \u003chttps://pypi.org/project/python-barbicanclient\u003e`__ 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 \u003chttps://docs.openstack.org/python-barbicanclient/latest/\u003e`__.\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    \u003e\u003e\u003e from keystoneclient.auth import identity\n    \u003e\u003e\u003e from keystoneauth1 import session\n    \u003e\u003e\u003e from barbicanclient import client\n\n    \u003e\u003e\u003e # We'll use Keystone API v3 for authentication\n    \u003e\u003e\u003e 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    \u003e\u003e\u003e # Next we'll create a Keystone session using the auth plugin we just created\n    \u003e\u003e\u003e sess = session.Session(auth=auth)\n\n    \u003e\u003e\u003e # Now we use the session to create a Barbican client\n    \u003e\u003e\u003e barbican = client.Client(session=sess)\n\n    \u003e\u003e\u003e # Let's create a Secret to store some sensitive data\n    \u003e\u003e\u003e secret = barbican.secrets.create(name='Self destruction sequence',\n    ...                                  payload='the magic words are squeamish ossifrage')\n\n    \u003e\u003e\u003e # Now let's store the secret by using its store() method. This will send the secret data\n    \u003e\u003e\u003e # to Barbican, where it will be encrypted and stored securely in the cloud.\n    \u003e\u003e\u003e secret.store()\n    'http://localhost:9311/v1/secrets/85b220fd-f414-483f-94e4-2f422480f655'\n\n    \u003e\u003e\u003e # The URI returned by store() uniquely identifies your secret in the Barbican service.\n    \u003e\u003e\u003e # After a secret is stored, the URI is also available by accessing\n    \u003e\u003e\u003e # the secret_ref attribute.\n    \u003e\u003e\u003e print(secret.secret_ref)\n    http://localhost:9311/v1/secrets/091adb32-4050-4980-8558-90833c531413\n\n    \u003e\u003e\u003e # When we need to retrieve our secret at a later time, we can use the secret_ref\n    \u003e\u003e\u003e retrieved_secret = barbican.secrets.get('http://localhost:9311/v1/secrets/091adb32-4050-4980-8558-90833c531413')\n    \u003e\u003e\u003e # We can access the secret payload by using the payload attribute.\n    \u003e\u003e\u003e # Barbican decrypts the secret and sends it back.\n    \u003e\u003e\u003e 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 \u003cidentity-api-version\u003e]\n                    [--os-auth-url \u003cauth-url\u003e] [--os-username \u003cauth-user-name\u003e]\n                    [--os-user-id \u003cauth-user-id\u003e] [--os-password \u003cauth-password\u003e]\n                    [--os-user-domain-id \u003cauth-user-domain-id\u003e]\n                    [--os-user-domain-name \u003cauth-user-domain-name\u003e]\n                    [--os-tenant-name \u003cauth-tenant-name\u003e]\n                    [--os-tenant-id \u003ctenant-id\u003e]\n                    [--os-project-id \u003cauth-project-id\u003e]\n                    [--os-project-name \u003cauth-project-name\u003e]\n                    [--os-project-domain-id \u003cauth-project-domain-id\u003e]\n                    [--os-project-domain-name \u003cauth-project-domain-name\u003e]\n                    [--endpoint \u003cbarbican-url\u003e] [--insecure]\n                    [--os-cacert \u003cca-certificate\u003e] [--os-cert \u003ccertificate\u003e]\n                    [--os-key \u003ckey\u003e] [--timeout \u003cseconds\u003e]\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 \u003cidentity-api-version\u003e\n                            Specify Identity API version to use. Defaults to\n                            env[OS_IDENTITY_API_VERSION] or 3.\n\n      --os-auth-url \u003cauth-url\u003e, -A \u003cauth-url\u003e\n                            Defaults to env[OS_AUTH_URL].\n      --os-username \u003cauth-user-name\u003e, -U \u003cauth-user-name\u003e\n                            Defaults to env[OS_USERNAME].\n      --os-user-id \u003cauth-user-id\u003e\n                            Defaults to env[OS_USER_ID].\n      --os-password \u003cauth-password\u003e, -P \u003cauth-password\u003e\n                            Defaults to env[OS_PASSWORD].\n      --os-user-domain-id \u003cauth-user-domain-id\u003e\n                            Defaults to env[OS_USER_DOMAIN_ID].\n      --os-user-domain-name \u003cauth-user-domain-name\u003e\n                            Defaults to env[OS_USER_DOMAIN_NAME].\n      --os-tenant-name \u003cauth-tenant-name\u003e, -T \u003cauth-tenant-name\u003e\n                            Defaults to env[OS_TENANT_NAME].\n      --os-tenant-id \u003ctenant-id\u003e, -I \u003ctenant-id\u003e\n                            Defaults to env[OS_TENANT_ID].\n      --os-project-id \u003cauth-project-id\u003e\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 \u003cauth-project-name\u003e\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 \u003cauth-project-domain-id\u003e\n                            Defaults to env[OS_PROJECT_DOMAIN_ID].\n      --os-project-domain-name \u003cauth-project-domain-name\u003e\n                            Defaults to env[OS_PROJECT_DOMAIN_NAME].\n      --endpoint \u003cbarbican-url\u003e, -E \u003cbarbican-url\u003e\n      --endpoint \u003cbarbican-url\u003e, -E \u003cbarbican-url\u003e\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 \u003cca-certificate\u003e\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 \u003ccertificate\u003e\n                            Defaults to env[OS_CERT].\n      --os-key \u003ckey\u003e        Defaults to env[OS_KEY].\n      --timeout \u003cseconds\u003e   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 \u003chttps://docs.openstack.org/barbican/latest/contributor/devstack.html\u003e`__.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenstack%2Fpython-barbicanclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenstack%2Fpython-barbicanclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenstack%2Fpython-barbicanclient/lists"}