Easy manipulation of RFC8959 secret-token URIs
Project description
secret-token
This is a utility library for working with RFC8959 secret-token URIs.
It provides 3 functions:
encode- Encodes a generated secret into a URIdecode- Decodes a URI for passing secrets to systems that do not support URI datavalidate- Checks if a secret-token URI is conforms to the spec
There are two main expected use cases for this library:
- Creating a service that generates and validates user secrets such as an API server. As per the RFC all secrets should be stored at rest encoded as URIs, so the
encodefunction is used immediately after generating tokens and thevalidatefunction is called when recieving tokens from users. - Use in a service that talks to external services that do not support RFC8959 but where you would like to store all your secrets using it. For example, in an environment with an appropriate secret token present:
export API_TOKEN='secret-token:E92FB7EB-D882-47A4-A265-A0B6135DC842%20foo'
The decoding code will look like this:
import os
import secret_token
API_TOKEN = secret_token.decode(os.environ.get["API_TOKEN"])
print(API_TOKEN)
The code prints
E92FB7EB-D882-47A4-A265-A0B6135DC842 foo
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file secret_token-1.2.0.tar.gz.
File metadata
- Download URL: secret_token-1.2.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87bb2ee01cd8b712147fbc0fe953a1cfeda5b60c6f1b4326419a3d606eb4dbba
|
|
| MD5 |
77a5591b2810f8e8feb0d48d34eaa228
|
|
| BLAKE2b-256 |
ac0fff62dbc6bc42bef4f465368c3feb517fcab858e2a330041c05d5c9b437ee
|
Provenance
The following attestation bundles were made for secret_token-1.2.0.tar.gz:
Publisher:
release.yml on Lexicality/secret-token
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
secret_token-1.2.0.tar.gz -
Subject digest:
87bb2ee01cd8b712147fbc0fe953a1cfeda5b60c6f1b4326419a3d606eb4dbba - Sigstore transparency entry: 1780934076
- Sigstore integration time:
-
Permalink:
Lexicality/secret-token@52f0333d803205be2928693dceb1583519ced4bf -
Branch / Tag:
refs/tags/v1.2.0_1 - Owner: https://github.com/Lexicality
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@52f0333d803205be2928693dceb1583519ced4bf -
Trigger Event:
release
-
Statement type:
File details
Details for the file secret_token-1.2.0-py3-none-any.whl.
File metadata
- Download URL: secret_token-1.2.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fe18f2985eceb9e55358c0f32aa2fdef952678d8b8614108cca07390ad8d9cf
|
|
| MD5 |
065c4e1e16de91b589e243d669497281
|
|
| BLAKE2b-256 |
9b2e074c958e46c505aad7684ae47d4aebc2fd7eee093f67442f53bf55667b8c
|
Provenance
The following attestation bundles were made for secret_token-1.2.0-py3-none-any.whl:
Publisher:
release.yml on Lexicality/secret-token
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
secret_token-1.2.0-py3-none-any.whl -
Subject digest:
8fe18f2985eceb9e55358c0f32aa2fdef952678d8b8614108cca07390ad8d9cf - Sigstore transparency entry: 1780934115
- Sigstore integration time:
-
Permalink:
Lexicality/secret-token@52f0333d803205be2928693dceb1583519ced4bf -
Branch / Tag:
refs/tags/v1.2.0_1 - Owner: https://github.com/Lexicality
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@52f0333d803205be2928693dceb1583519ced4bf -
Trigger Event:
release
-
Statement type: