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 (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 orgs with users in the upload URL.
  • Each publish must use a new version; bump version in packages/veracityLabAuthZ/pyproject.toml before rebuilding.
  • For CI, add PACKAGES_PAT as a GitHub Actions secret with write:packages.

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.1.0.tar.gz (5.0 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.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

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

Hashes for veracitylabauthz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2d58239941d29acf3862b964798b7aa3aff12d707b97e885948b5d9bf81e60dd
MD5 540d166addcf68e1137e51fc37575fbd
BLAKE2b-256 de0b0911f436092e92a359844e933f718346f622f1df07c1fc5c095dc788cf01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for veracitylabauthz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0638162c28e299af4b492f431854fdd68a6396c722eb1520ae74f1bdd4408171
MD5 9fd8b4c4dbbf522477378bd82285a3a4
BLAKE2b-256 23ca27f6fadb0c7255e0ca745eee09184cfbbd14bc9e82759e637947f43f4e92

See more details on using hashes here.

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