Skip to main content

Akeyless+Clearskies Custom OpenApi Producer/Rotator

Project description

openapi

OpenApi dynamic producer for Akeyless

The payload for this producer looks like:

{"api_key": "ADMIN_API_KEY_HERE", "id": "ID_FOR_THE_ADMIN_API_KEY}

Call clearskies_akeyless_custom_openapi.build_openapi_producer() to initialize the create/revoke endpoints. You can optionally provide the url parameter which will add a prefix to the endpoints. This can then be attached to a clearskies context or an endpoint group:

If used as a producer, it will use the provided credentials to fetch and return a temporary OpenApi admin key. It can also be used as a rotator, in which case it will generate a new admin key and revoke the old one.

Installation

pip install clear-skies-akeyless-custom-openapi

Usage Example

import clearskies
import clearskies_akeyless_custom_openapi

wsgi = clearskies.contexts.WsgiRef(
    clearskies_akeyless_custom_openapi.build_openapi_producer()
)
wsgi()

Which you can test directly using calls like:

curl 'http://localhost:8080/sync/create' -d '{"payload":"{\"api_key\":\"YOUR_ADMIN_API_KEY_HERE\",\"id\":\"ID_OF_ADMIN_API_KEY_HERE\"}"}'




curl 'http://localhost:8080/sync/revoke' -d '{"payload":"{\"api_key\":\"YOUR_ADMIN_API_KEY_HERE\",\"id\":\"ID_OF_ADMIN_API_KEY_HERE\"}"}'

NOTE: Akeyless doesn't store your payload as JSON, even when you put in a JSON payload. Instead, it ends up as a stringified-json (hence the escaped apostrophes in the above example commands). This is normal, and normally invisible to you, unless you try to invoke the endpoints yourself.

Development

To set up your development environment with pre-commit hooks:

# Install uv if not already installed
pip install uv

# Create a virtual environment and install all dependencies (including dev)
uv sync

# Install pre-commit hooks
uv run pre-commit install

# Optionally, run pre-commit on all files
uv run pre-commit run --all-files

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clear_skies_akeyless_custom_openapi-2.0.1.tar.gz (39.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file clear_skies_akeyless_custom_openapi-2.0.1.tar.gz.

File metadata

File hashes

Hashes for clear_skies_akeyless_custom_openapi-2.0.1.tar.gz
Algorithm Hash digest
SHA256 1273c1f527cf1bb233aabfe209eca20658db364c730b8186f9cbe054955a0301
MD5 aa10868efd115ce16773a36b0442d568
BLAKE2b-256 3791e9218dba44ecf6ffa55fcb075be8dadf414e028d22fe4a1f815d71350bc9

See more details on using hashes here.

File details

Details for the file clear_skies_akeyless_custom_openapi-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for clear_skies_akeyless_custom_openapi-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67a310ec94d747ace1ec3c10688c064a9ef9d1d351d2d05e41feeead6acdb834
MD5 5fe29709bb1d035391fced575f53f57c
BLAKE2b-256 8cc08364e45dcbe5b5d63b7b477a444bbb36780e9980643ca95670071ee57752

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page