Environment variable secret adapter for Fujin
Project description
Fujin Secrets - Environment Variable
Environment variable secret adapter for Fujin deployment tool. Reads secrets from a JSON-formatted environment variable, making it ideal for CI systems like GitHub Actions.
Installation
pip install fujin-secrets-env
Or with uv:
uv pip install fujin-secrets-env
Configuration
Add the following to your fujin.toml file:
[secrets]
adapter = "env"
[secrets.options]
source = "FUJIN_SECRETS"
The source option specifies the name of the environment variable containing the JSON-formatted secrets.
Usage
GitHub Actions
In your workflow file, pass all secrets as JSON using toJSON(secrets):
- name: Deploy
run: uvx --from fujin-cli --with fujin-secrets-env fujin deploy
env:
FUJIN_SECRETS: ${{ toJSON(secrets) }}
Environment File
In your environment configuration (via env in fujin.toml), prefix secret values with $:
DEBUG=False
SECRET_KEY=$SECRET_KEY
DATABASE_URL=$DATABASE_URL
AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
The $ prefix indicates to Fujin that the value should be resolved from the secrets source.
How it Works
The adapter:
- Reads the JSON string from the configured environment variable
- Parses the JSON into a dictionary
- For each secret reference (prefixed with
$), looks up the value in the parsed JSON - Returns the resolved environment variables
Example
Given this GitHub Actions secret setup:
SECRET_KEY:my-secret-keyDATABASE_URL:postgres://...
And this fujin.toml env configuration:
[[hosts]]
env = """
DEBUG=False
SECRET_KEY=$SECRET_KEY
DATABASE_URL=$DATABASE_URL
"""
The adapter will resolve $SECRET_KEY and $DATABASE_URL from the JSON passed via FUJIN_SECRETS.
Related
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 fujin_secrets_env-0.25.0.tar.gz.
File metadata
- Download URL: fujin_secrets_env-0.25.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45806941ca33c6dedd292a0711db4778507ed54dff415fd22c2aeca0807179b3
|
|
| MD5 |
4c691732f18b5ba001450af3bd03321b
|
|
| BLAKE2b-256 |
b2a0c47d0e87931479a0047c32b593bd6257a030f917befbe9284627702733d0
|
Provenance
The following attestation bundles were made for fujin_secrets_env-0.25.0.tar.gz:
Publisher:
publish.yml on Tobi-De/fujin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fujin_secrets_env-0.25.0.tar.gz -
Subject digest:
45806941ca33c6dedd292a0711db4778507ed54dff415fd22c2aeca0807179b3 - Sigstore transparency entry: 1154484500
- Sigstore integration time:
-
Permalink:
Tobi-De/fujin@92cee98e8369c7dfee18ac15ea787598e8956b5a -
Branch / Tag:
refs/tags/v0.25.0 - Owner: https://github.com/Tobi-De
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@92cee98e8369c7dfee18ac15ea787598e8956b5a -
Trigger Event:
push
-
Statement type:
File details
Details for the file fujin_secrets_env-0.25.0-py3-none-any.whl.
File metadata
- Download URL: fujin_secrets_env-0.25.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d12ca0ce88ca42e2cd3705e279216799f484cc046b130b86ccf4f0bc1c86f4b4
|
|
| MD5 |
11a675e7c2fb86ff2e9314be1dac03d5
|
|
| BLAKE2b-256 |
57433c17a38177ccf6129eaf485b74a95219bba8902c877d78a59eacf9185377
|
Provenance
The following attestation bundles were made for fujin_secrets_env-0.25.0-py3-none-any.whl:
Publisher:
publish.yml on Tobi-De/fujin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fujin_secrets_env-0.25.0-py3-none-any.whl -
Subject digest:
d12ca0ce88ca42e2cd3705e279216799f484cc046b130b86ccf4f0bc1c86f4b4 - Sigstore transparency entry: 1154484506
- Sigstore integration time:
-
Permalink:
Tobi-De/fujin@92cee98e8369c7dfee18ac15ea787598e8956b5a -
Branch / Tag:
refs/tags/v0.25.0 - Owner: https://github.com/Tobi-De
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@92cee98e8369c7dfee18ac15ea787598e8956b5a -
Trigger Event:
push
-
Statement type: