Skip to content

Exact auth mapping and delivery

Each project has an auth.xratu file that says which workspace binding every use of a declared key gets. The CLI writes it for you: xratu secret configure project finds every place your project uses a key, including inside the published blocks, flows and agents it uses, and asks you which binding each one gets. Deployment checks the file again and records the result. This page covers why mapping is per use, the file, the commands, and what deployment records.

One key, many uses

A block's key is the block author's name for a credential. A project can use the same block in several places, and each place can need a different credential: the same model block once for a customer-facing assistant and once for internal analysis, with two different API keys. So auth.xratu maps each place a key is used, and Xratu never matches credentials by key name.

The file

Example, for a refunds project that uses one model block twice and a payments block once:

apiVersion: xratu.io/v1
kind: ProjectAuth
metadata:
  name: refunds

spec:
  resolvedAgainst:
    requirementsDigest: sha256:5e0d...

  assignments:
    - secretBinding: customer-facing-model
      consumers:
        - path: customer-model
          capability: openai.generate@1.4.0
          export: generate
          authKey: api_key

    - secretBinding: internal-analysis-model
      consumers:
        - path: internal-model
          capability: openai.generate@1.4.0
          export: generate
          authKey: api_key

    - secretBinding: stripe-production
      consumers:
        - path: charge-payment
          capability: stripe.charge@2.3.1
          export: charge
          authKey: api_key

Each entry under consumers is one place in the project that uses a key. requirementsDigest records the version of the project the file was written for, so Xratu can tell when the project has changed since. The file holds names only, never a credential or a location, and belongs in source control with the rest of the project. Field details are in auth.xratu.

The commands

xratu secret configure project ./refunds
xratu secret check project ./refunds
xratu apply -f ./refunds
  • configure project keeps the mappings you already made, shows each new use and asks which binding it gets, and lets you give one binding to many uses at once. It never maps a new use without asking.
  • check project changes nothing and asks nothing. Run it in CI: it fails when a use is unmapped, a mapping is stale, a binding is disabled, or an integration the project needs is not ready.
  • xratu apply -f deploys the project with its auth.xratu, after the same checks.

A project with no declared keys needs no auth.xratu.

What deployment records

When you apply the project, Xratu records in the release which binding revision each use of a key gets, and keeps those revisions until you apply the project again. A change to a binding therefore reaches a project the next time it is applied. The permission to fetch each credential is given to the node running the work, at run time.