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

# Install uv if not already installed
pip install uv

# Create a virtual environment and install dependencies
uv sync

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.0.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.0.tar.gz.

File metadata

File hashes

Hashes for clear_skies_akeyless_custom_openapi-2.0.0.tar.gz
Algorithm Hash digest
SHA256 7d7272c2be4af347f1195a722819c6c6f17d183577adcb5a1309a45cefece49d
MD5 dae41a701da03446c95153a7524ad95b
BLAKE2b-256 adacecba4a4007aaea7138d48ea9234a9eb86720b6e62802c3a55c1a269f8ffa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clear_skies_akeyless_custom_openapi-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86d59964360c9b03d73ed9b7a8d9119d4eb5dee3e6428b2eda4c6b7f26011f41
MD5 71e104b0f23af16c332f8908b6167b45
BLAKE2b-256 b0d8b6f414aecb516387e4181bf78fdb2d7c5d475196a78423ca67053c5856e4

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