Feature-flag primitive for Flametrench: boolean flags with authz targeting and deterministic percentage rollouts (ADR 0021).
Project description
flametrench-flags
Feature-flag primitive for the Flametrench v0.4 platform (ADR 0021).
What this is
Boolean flags with two targeting rule types:
authz— matches subjects that pass anauthzcheck()(e.g. "editors of org O"). Targeting reuses the application's real authorization model; no separate DSL.percentage— deterministic SHA-256 rollout bucket, sticky and monotonic. Pinned for byte-identical behavior across all Flametrench SDKs.
Install
pip install flametrench-flags
Requires Python ≥ 3.11 and flametrench-ids >= 0.4.0.
Quick start
from flametrench_flags import InMemoryFlagStore
store = InMemoryFlagStore()
store.create_flag(
scope="org_...",
key="new-checkout",
enabled=True,
default_variant=False,
rules=[
{"kind": "authz", "relation": "editor",
"object": {"type": "org", "id": "org_..."}, "variant": True},
{"kind": "percentage", "basis_points": 1000, "variant": True},
],
)
# Evaluate: inject your authz check_fn
result = store.evaluate(
"new-checkout",
subject_id="usr_...",
scope="org_...",
check_fn=lambda subj, rel, ot, oid: authz_store.check(subj, rel, ot, oid),
)
License
Apache-2.0 © NDC Digital, LLC
Project details
Release history Release notifications | RSS feed
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 flametrench_flags-0.4.0.tar.gz.
File metadata
- Download URL: flametrench_flags-0.4.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21bb551bbf05dd18d0879338b3979b91137ff71ca6a0db1f45cb57838e753d0c
|
|
| MD5 |
d67f3b31e25cec479a77880e6e6899d3
|
|
| BLAKE2b-256 |
1dcc637ad13d10c84c691448d986c4202646e32e4f80d4627d93ee73dc2fb56a
|
Provenance
The following attestation bundles were made for flametrench_flags-0.4.0.tar.gz:
Publisher:
publish.yml on flametrench/flags-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flametrench_flags-0.4.0.tar.gz -
Subject digest:
21bb551bbf05dd18d0879338b3979b91137ff71ca6a0db1f45cb57838e753d0c - Sigstore transparency entry: 1752199597
- Sigstore integration time:
-
Permalink:
flametrench/flags-python@13dc1a1c9b61dcea085c43e968bfa5873e57b117 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/flametrench
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@13dc1a1c9b61dcea085c43e968bfa5873e57b117 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file flametrench_flags-0.4.0-py3-none-any.whl.
File metadata
- Download URL: flametrench_flags-0.4.0-py3-none-any.whl
- Upload date:
- Size: 7.6 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 |
eced4ebc397090771ba53b7b0f8055d3f57475878d84c8f0ef1b3b53f27594e2
|
|
| MD5 |
869e89b30c53cd109247ab071d26d804
|
|
| BLAKE2b-256 |
0f7b424c51a49393f02359850339a1743217f8372535d5fc93deb43d129e6c19
|
Provenance
The following attestation bundles were made for flametrench_flags-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on flametrench/flags-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flametrench_flags-0.4.0-py3-none-any.whl -
Subject digest:
eced4ebc397090771ba53b7b0f8055d3f57475878d84c8f0ef1b3b53f27594e2 - Sigstore transparency entry: 1752199616
- Sigstore integration time:
-
Permalink:
flametrench/flags-python@13dc1a1c9b61dcea085c43e968bfa5873e57b117 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/flametrench
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@13dc1a1c9b61dcea085c43e968bfa5873e57b117 -
Trigger Event:
workflow_dispatch
-
Statement type: