decern — Python client
Website · Repository · Commands · Issues
Ask whether an action is allowed, and get an answer somebody can check afterwards.
Standard library only — no requests, no httpx. Python ≥ 3.11.
uv add decern
# and a server to ask:
cargo install decern-server && decern-serve --trust-proxy
from decern import Client
c = Client("http://127.0.0.1:8080") # optionally: token="…"
d = c.evaluate(
subject={"type": "Principal", "id": "corp"},
action="Read", # or {"name": "Read"}
resource={"type": "Resource", "id": "claim1"},
)
d.allowed # True / False
d.reasons # the policies that decided it, on allow
d.errors # why not, on deny
When token is set it is sent as Authorization: Bearer on every request, for a
deployment that requires bearer tokens on the evaluation endpoint.
Also on the client: c.pubkey() (the Ed25519 key id the log is signed with) and
c.healthy(). A non-2xx response or transport failure raises DecernError with the HTTP
status and body, so a denial is distinguishable from a misconfigured endpoint. context is
advisory — the server overrides anything it derives itself (the clock, the accountable
owner), so a caller cannot talk its way into a decision by supplying them.
What the server gives you
decern is an AuthZEN 1.0 authorization server whose safety rules are machine-checked over every input, and whose decisions land in an append-only, signed, hash-chained log before they are served — a decision that cannot be recorded is refused, and a third party can verify what was decided without trusting the operator:
decern verify --ledger <file> --pubkey <key> # the chain and every signature
decern explain --ledger <file> --seq 12 # one decision, in full
Obtain the public key out of band; a key handed over by the party being audited establishes nothing.
Test
cd sdks/python && python -m unittest discover -v
Apache-2.0. Published from CI by OIDC with no stored credential.
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 decern-0.3.0.tar.gz.
File metadata
- Download URL: decern-0.3.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a56ce920be48f8665fbf8d8f5356950bb38fed003ad7175a21046e1ae6379a9
|
|
| MD5 |
cfa94c0c544498e9911d2f1e65844543
|
|
| BLAKE2b-256 |
fa85ccba8f1e918f2cf171e809f604efc44411d71bc8c6c9db66a8bca3a6120b
|
Provenance
The following attestation bundles were made for decern-0.3.0.tar.gz:
Publisher:
publish-sdks.yml on anivar/decern
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
decern-0.3.0.tar.gz -
Subject digest:
1a56ce920be48f8665fbf8d8f5356950bb38fed003ad7175a21046e1ae6379a9 - Sigstore transparency entry: 2473745769
- Sigstore integration time:
-
Permalink:
anivar/decern@397236ea58a6e8aa90b6949298a1ced9676fd6a3 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/anivar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdks.yml@397236ea58a6e8aa90b6949298a1ced9676fd6a3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file decern-0.3.0-py3-none-any.whl.
File metadata
- Download URL: decern-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8d9bee474c0323d8e87a7c5be5cb6add5bb656cbd0d2c49428f0f53f8d4744b
|
|
| MD5 |
1bcf34fe0f2e76f764d3a8064a099c89
|
|
| BLAKE2b-256 |
1eb692c0e05ae79f66ad80d91f01ab93bbff6fcb0f64f52571c784faba79ee63
|
Provenance
The following attestation bundles were made for decern-0.3.0-py3-none-any.whl:
Publisher:
publish-sdks.yml on anivar/decern
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
decern-0.3.0-py3-none-any.whl -
Subject digest:
f8d9bee474c0323d8e87a7c5be5cb6add5bb656cbd0d2c49428f0f53f8d4744b - Sigstore transparency entry: 2473745830
- Sigstore integration time:
-
Permalink:
anivar/decern@397236ea58a6e8aa90b6949298a1ced9676fd6a3 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/anivar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdks.yml@397236ea58a6e8aa90b6949298a1ced9676fd6a3 -
Trigger Event:
push
-
Statement type: