Skip to main content

ConductorOne Baton adapter for Authority Runtime — plug a baton-github .c1z file into Carryall as an identity-graph backend

Project description

carryall-baton-backend

A Carryall backend that reads ConductorOne Baton .c1z files.

Plugs a Baton sync (produced by any baton-* connector — baton-github, baton-okta, baton-snowflake, …) into Authority Runtime as an identity-graph source of truth for Carryall's runtime authorization layer.

Layer Who owns it What it does
Entitlement graph ConductorOne Baton baton-githubsync.c1z (a gzipped SQLite)
Adapter (this package) you Projects the .c1z into Carryall's Backend Protocol
Runtime authorization Authority Runtime / Carryall Intent → compiled scopes → signed envelope → enforced action

Install

pip install carryall-baton-backend

Requires authority-runtime>=0.4.0 (the release that introduced the Backend Protocol and entry-point-driven backend loading).

Quick start

from carryall_baton import BatonBackend

backend = BatonBackend(
    c1z_path="./sync.c1z",
    agent_to_principal={"release-agent": "alice"},  # Carryall agent_id → GitHub username
)

Or load it the Carryall-idiomatic way via CARRYALL_SLOS_CONFIG:

{
  "backend": "baton",
  "init": {
    "c1z_path": "./sync.c1z",
    "agent_to_principal": { "release-agent": "alice" }
  }
}
export CARRYALL_SLOS_CONFIG=./backend.json
carryall shell                     # or any other CLI subcommand

Under the hood, Authority Runtime's load_backend() resolves the "baton" name via the authority_runtime.backends entry-point group that this package registers.

Producing a .c1z

You need a baton sync to point this backend at. Example for GitHub:

# https://github.com/ConductorOne/baton-github
BATON_TOKEN=<github-pat> baton-github
# produces sync.c1z in the current directory

The adapter works against any .c1z that follows the baton-sdk v1 schema (v1_resources, v1_entitlements, v1_grants).

Access decision model

BatonBackend.check_access(envelope, action, uri) tries three things, in order:

  1. Envelope scope match. If the envelope's authority.scopes already contains vault:{vault}:{action} or vault:{vault}:*, allow. This is the same short-circuit MemoryBackend uses.
  2. Baton grant match. If agent_to_principal maps envelope.agent_id to a baton principal that has a grant matching action on the target resource, allow. admin and maintain entitlements grant any action; write grants imply read.
  3. Default deny. With a clear reason + metadata on the returned PolicyResult.

URI shape

slos://vaults/{org}/{repo}

The slos:// scheme is reused from Authority Runtime's existing convention so the same Carryall tools/tests can target either a SLOS, Memory, or Baton backend without re-plumbing. The {vault} and {resource} are derived from Baton's external_id by splitting on the first / (the baton-github convention).

Override by subclassing BatonBackend and replacing any of the helpers in carryall_baton.mapping.

What v0.1 does not do

  • No protobuf decoding. The .c1z's data blobs (containing display names, descriptions, and connector-specific metadata) are untouched; everything the adapter surfaces comes from indexed columns. That means display names fall back to external_id. A future version may add protobuf as an optional dependency.
  • No write path. write_document raises NotImplementedError. Baton syncs are produced by connectors — not written to by agents.
  • Single-org scope. Grants across multiple orgs work fine, but the convention of "vault = org" assumes one primary org per sync. For multi-org syncs, subclass and override split_external_id.

Testing & development

The test suite uses a programmatically-generated synthetic .c1z (see tests/conftest.py) — no external dependencies, no live baton sync required. The fixture models a small GitHub-ish organization (3 users, 2 teams, 3 repos, 9 grants) and exercises both the envelope-scope and baton-grant decision paths.

pip install -e ".[dev]"
pytest

License

MIT. See LICENSE.

The upstream authority-runtime library is under BSL 1.1; this adapter is intentionally MIT so that integration work done here is maximally reusable.

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

carryall_baton_backend-0.1.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

carryall_baton_backend-0.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file carryall_baton_backend-0.1.0.tar.gz.

File metadata

  • Download URL: carryall_baton_backend-0.1.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for carryall_baton_backend-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ccbb41771d7a153540feb6ca387774e41e874103ee4a56ec6dfc74e0e39921e7
MD5 5d9e6dd1a859c5c8599668123b97ef74
BLAKE2b-256 c02b499323bf7d04352984a0a83bd1adb623382a96fec11bb6880cc13335c063

See more details on using hashes here.

Provenance

The following attestation bundles were made for carryall_baton_backend-0.1.0.tar.gz:

Publisher: publish.yml on tronmongoose/carryall-baton-backend

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

File details

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

File metadata

File hashes

Hashes for carryall_baton_backend-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 091eaf257895976b67f709177271847ed3b0f0d4fb75660bfca6de53c40e2a21
MD5 d07c00a2241c1b0a611579199968996c
BLAKE2b-256 316618d4ff3005c4a63d5475d47d795de98ba3779a663ffae238782f704152ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for carryall_baton_backend-0.1.0-py3-none-any.whl:

Publisher: publish.yml on tronmongoose/carryall-baton-backend

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