auth.xratu¶
auth.xratu is a ProjectAuth document in a project folder. It maps every
consumer of a declared key to one workspace SecretBinding by name.
xratu secret configure project writes it, xratu secret check project
checks it, and xratu apply -f loads it with the project. For what it is and
why, see
Exact auth mapping and delivery.
Example¶
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
Fields¶
| Field | Type | Constraint |
|---|---|---|
apiVersion |
string | xratu.io/v1 |
kind |
string | ProjectAuth |
metadata.name |
string | The project name |
spec.resolvedAgainst.requirementsDigest |
string | sha256: and 64 hex characters; the digest of the consumer set the file was written against |
spec.assignments |
list | One entry per binding used |
spec.assignments[].secretBinding |
string | A binding name in the project's workspace |
spec.assignments[].consumers |
list | At least one consumer |
spec.assignments[].consumers[].path |
string | The consumer's position in the project |
spec.assignments[].consumers[].capability |
string | The block id and pinned version, id@version |
spec.assignments[].consumers[].export |
string | The export or method that declared the key |
spec.assignments[].consumers[].authKey |
string | The key as declared in @xratu_auth |
Every object has exactly these fields. All values are non-empty text.
Rules¶
- A consumer, identified by
path,capability,exportandauthKeytogether, appears once in the whole file. - Every consumer in the project's current consumer set appears, and no other.
- Names only: the file carries no value, locator, UUID, wildcard, tag or pattern.
- A field that would hold a credential, such as
value,secret,tokenorcredential, is refused wherever it appears.
Refusal messages¶
| Message | Cause |
|---|---|
ProjectAuth resolves one exact consumer more than once |
A consumer is listed twice |
ProjectAuth.spec.assignments[0].consumers must not be empty |
An assignment lists no consumer |
ProjectAuth.spec.resolvedAgainst.requirementsDigest must be a sha256 digest |
The digest is malformed |
ProjectAuth.spec.assignments[0].value may not carry secret material |
A value was written into the file |
ProjectAuth fields must be exactly [...] |
A missing or extra field, with missing= and extra= lists |
Admission adds refusals for missing, stale and unresolved consumers. See Configure project auth.