Skip to main content

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 version in packages/veracityLabAuthZ/pyproject.toml before rebuilding.
  • For CI, configure a trusted publisher in PyPI for this repo and workflow.

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

veracitylabauthz-0.2.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

veracitylabauthz-0.2.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

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

Hashes for veracitylabauthz-0.2.0.tar.gz
Algorithm Hash digest
SHA256 18b9b8ba79996dbcead5f1ecc1e24a5d3e8a41af2691f85579c1b1b3a31ee769
MD5 3712cfe7f72879eebea9f32e0dae3d9e
BLAKE2b-256 d9bbfefae1ef06e37e196bf355e549add1f3eedd2213a9f8a45692322970088d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file veracitylabauthz-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for veracitylabauthz-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a8ce6bb325bab07d5a9711468dcdc3a56944100ddf82f7b1144efbcfef5e825
MD5 126d3b1f2af8be6110459778eb459887
BLAKE2b-256 c06a60e0e01dc933e72c63b218988e9e60f81d29740bcbf5dd7aee6a2572580f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page