Shared Cedar authorization helpers for Veracity services.
Project description
veracityLabAuthZ
Shared Cedar authorization helpers for Veracity services.
Local development
pip install -e packages/veracityLabAuthZ
Cedar evaluation (cedarpy)
pip install -e "packages/veracityLabAuthZ[cedarpy]"
from veracity_authz import CedarClient, CedarPyConfig, CedarPyEngine
from veracity_authz.context_builder import build_request
policies = """permit(principal, action, resource);"""
entities = []
engine = CedarPyEngine(CedarPyConfig(policies=policies, entities=entities))
client = CedarClient(engine)
request = build_request(
principal={"type": "User", "id": "user-1"},
action={"type": "Action", "id": "workspace:read"},
resource={"type": "Workspace", "id": "ws-1"},
)
decision = client.evaluate(request)
print(decision.allowed)
Tests
python -m unittest discover -s packages/veracityLabAuthZ/tests
Publishing (PyPI)
GitHub Actions is configured to publish to PyPI using trusted publishing. PyPI project page (used for the GitHub Actions environment URL): https://pypi.org/p/veracitylabauthz
Manual publish from the repo root (user API token):
# optional: clean old artifacts
rm -rf packages/veracityLabAuthZ/dist
# build tooling
python -m pip install --upgrade pip build twine
# optional: run tests
python -m unittest discover -s packages/veracityLabAuthZ/tests
# build
python -m build packages/veracityLabAuthZ
# publish (PyPI)
export TWINE_USERNAME="__token__"
export TWINE_PASSWORD="<pypi-api-token>"
python -m twine upload --repository pypi packages/veracityLabAuthZ/dist/*
Notes:
- Create a PyPI API token in your PyPI account settings and use it for
TWINE_PASSWORD. - Each publish must use a new version; bump
versioninpackages/veracityLabAuthZ/pyproject.tomlbefore rebuilding. - For CI, configure a trusted publisher in PyPI for this repo and workflow.
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 veracitylabauthz-0.2.0.tar.gz.
File metadata
- Download URL: veracitylabauthz-0.2.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18b9b8ba79996dbcead5f1ecc1e24a5d3e8a41af2691f85579c1b1b3a31ee769
|
|
| MD5 |
3712cfe7f72879eebea9f32e0dae3d9e
|
|
| BLAKE2b-256 |
d9bbfefae1ef06e37e196bf355e549add1f3eedd2213a9f8a45692322970088d
|
Provenance
The following attestation bundles were made for veracitylabauthz-0.2.0.tar.gz:
Publisher:
publish-authz-package.yml on Asset-Integrity-Engineering/veracity-lab-workspaces
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veracitylabauthz-0.2.0.tar.gz -
Subject digest:
18b9b8ba79996dbcead5f1ecc1e24a5d3e8a41af2691f85579c1b1b3a31ee769 - Sigstore transparency entry: 854983748
- Sigstore integration time:
-
Permalink:
Asset-Integrity-Engineering/veracity-lab-workspaces@5cf037bed9ee5591d06121f06df6e1e91f431da4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Asset-Integrity-Engineering
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-authz-package.yml@5cf037bed9ee5591d06121f06df6e1e91f431da4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file veracitylabauthz-0.2.0-py3-none-any.whl.
File metadata
- Download URL: veracitylabauthz-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.9 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 |
4a8ce6bb325bab07d5a9711468dcdc3a56944100ddf82f7b1144efbcfef5e825
|
|
| MD5 |
126d3b1f2af8be6110459778eb459887
|
|
| BLAKE2b-256 |
c06a60e0e01dc933e72c63b218988e9e60f81d29740bcbf5dd7aee6a2572580f
|
Provenance
The following attestation bundles were made for veracitylabauthz-0.2.0-py3-none-any.whl:
Publisher:
publish-authz-package.yml on Asset-Integrity-Engineering/veracity-lab-workspaces
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veracitylabauthz-0.2.0-py3-none-any.whl -
Subject digest:
4a8ce6bb325bab07d5a9711468dcdc3a56944100ddf82f7b1144efbcfef5e825 - Sigstore transparency entry: 854983750
- Sigstore integration time:
-
Permalink:
Asset-Integrity-Engineering/veracity-lab-workspaces@5cf037bed9ee5591d06121f06df6e1e91f431da4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Asset-Integrity-Engineering
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-authz-package.yml@5cf037bed9ee5591d06121f06df6e1e91f431da4 -
Trigger Event:
push
-
Statement type: