Skip to main content

httpie-keystone-auth

OpenStack Keystone auth plugin for HTTPie.

Installation

$ pip install --upgrade httpie-keystone-auth

You should now see keystone under --auth-type / -A in $ http --help output.

Usage

Plugin uses openstacksdk library to parse the clouds.yaml file and get the token from Keystone.

A simple example of a clouds.yaml file is:

clouds:
  mycloud:
    auth:
      auth_url: <url of keystone endpoint>
      username: <username>
      password: <password>
      user_domain_name: <user domain name>
      project_name: <name of the project to authorize to>
      project_domain_name: <domain of the project>
 othercloud:
   auth:
     . . .

Read more about the format of the file and where to place it in openstacksdk docs

Using env var

You can set OS_CLOUD env var to a name of one of the clouds in the clouds.yaml file, which will be then used by plugin:

export OS_CLOUD=mycloud
http -A keystone devstack.local/images/v2/images

Passing cloud name explicitly

Alternatively you can pass the name of the cloud from the clouds.yaml file to use as ‘username’ to HTTPie:

https -A keystone -a myothercloud images.othercloud.com/v2/images

Using service type instead of full service URL

This plugin also simplifies working with OpenStack APIs by allowing you to specify only the service type instead of full URL, e.g

https -A keystone compute/servers

Under the hood, the plugin will check if there’s any service in the OpenStack service catalog of your cloud that has the service type as specified in the first part (netloc) of your URL, and replace this with the endpoint URL for this service as defined in the catalog for the region and endpoint type (interface) as set in your clouds.yaml. It will use API version as defined in the clouds.yaml file and openstacksdk defaults.

Additionally, instead of service type that is actually registered in the service catalog of the cloud, you can also use any of:

  • official service type (like block-storage)

  • official service type alias (like volumev3)

  • OpenStack community project name (like cinder)

  • service name as registered in the catalog (can be whatever cloud operator decided to name it)

If a single endpoint matching such criteria is found, it will be used.

OpenStack API microversions

Several OpenStack services use API microversions to alter the API behavior. The actual header is pretty long and cumbersome to type, and it can vary for some older versions of some services.

Instead, you can specify a simple header v, and appropriate microversion header will be included, together with legacy ones if required, e.g.

https -A keystone compute/servers v:2.59 -v
GET /v2.1/servers HTTP/1.1
...
OpenStack-API-Version: compute 2.59 # modern API microversion header
X-OpenStack-Nova-API-Version: 2.59 # legacy API microversion header
...

Note that this only works when using a service type etc instead of full URL.

Limitations

If you are using cloud that needs custom CA bundle file to verify the TLS connection, you will still have to pass it explicitly to HTTPie even if it is already set in the clouds.yaml file.

Metadata

Release files for httpie-keystone-auth 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for httpie-keystone-auth 0.3.1
File Size Uploaded Provenance Actions
httpie-keystone-auth-0.3.1.tar.gz 5.9 kB Without provenance Details for httpie-keystone-auth-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for httpie-keystone-auth 0.3.1
File Interpreter ABI Platform Actions
httpie_keystone_auth-0.3.1-py3-none-any.whl Python 3 none any Details for httpie_keystone_auth-0.3.1-py3-none-any.whl

Total release size: 11.3 kB

Release files / httpie-keystone-auth-0.3.1.tar.gz

Download URL httpie-keystone-auth-0.3.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
668f50d7a31194f63b478f3e879ac32fd1802e066b098fab8151163fd3f375b8
BLAKE2b-256 checksum
How to use checksums
5f9bc9325409053613a09a6bb017d8e0bf74351852538008e4fee1997461c662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / httpie_keystone_auth-0.3.1-py3-none-any.whl

Download URL httpie_keystone_auth-0.3.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82bdf65c2a36ff25881c701c61be56496411066d3003cc25920dec8857261b76
BLAKE2b-256 checksum
How to use checksums
8694390f92e7f1bdacff244f0ea94a63283c4f56492f32081296e11cc0a32d6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Security for httpie-keystone-auth 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page