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 (GitHub Packages)
Manual publish from the repo root:
# 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 (GitHub Packages API endpoint)
export TWINE_USERNAME="<your-github-username>"
# load PAT from .env (adjust var name if different)
set -a
source .env
set +a
export TWINE_PASSWORD="${PACKAGES_PAT}"
python -m twine upload \
--repository-url https://api.github.com/orgs/<owner>/packages/pypi/upload \
packages/veracityLabAuthZ/dist/*
Notes:
- For a user-owned package, replace
orgswithusersin the upload URL. - Each publish must use a new version; bump
versioninpackages/veracityLabAuthZ/pyproject.tomlbefore rebuilding. - For CI, add
PACKAGES_PATas a GitHub Actions secret withwrite:packages.
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.1.0.tar.gz.
File metadata
- Download URL: veracitylabauthz-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d58239941d29acf3862b964798b7aa3aff12d707b97e885948b5d9bf81e60dd
|
|
| MD5 |
540d166addcf68e1137e51fc37575fbd
|
|
| BLAKE2b-256 |
de0b0911f436092e92a359844e933f718346f622f1df07c1fc5c095dc788cf01
|
File details
Details for the file veracitylabauthz-0.1.0-py3-none-any.whl.
File metadata
- Download URL: veracitylabauthz-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0638162c28e299af4b492f431854fdd68a6396c722eb1520ae74f1bdd4408171
|
|
| MD5 |
9fd8b4c4dbbf522477378bd82285a3a4
|
|
| BLAKE2b-256 |
23ca27f6fadb0c7255e0ca745eee09184cfbbd14bc9e82759e637947f43f4e92
|