SSyncropel Docs

Authorization Model

Six checks can refuse a request. A refusal always wins, and your workspace tells you which checks are on.

Overview

Every authenticated request to your workspace passes through up to six checks. Each one can refuse the request. Three things hold:

  1. A refusal always wins. A check can only narrow what a request may do. No check can override another's refusal, and turning on another check never grants access that was refused before.
  2. A switched-off check is reported. A check that is off does not silently pass everything. Your workspace reports that it is off, which setting turned it off, and which check covers for it.
  3. Defaults are stated plainly. A default workspace runs with three of the six checks on.

The six checks

CheckQuestion it answersDefault state
scopeDoes this credential's scope set cover this route class? (records:read, admin, and so on)Live
actor_claimMay this bearer act as the DID this request claims?Live
capability_grant (grant still valid)Is the membership grant behind this credential still valid? An expired or revoked grant means the bearer is refused with 401 GRANT_EXPIRED or 401 GRANT_REVOKED, on the very next request after revocation.Live for credentials created from a membership grant. Older credentials with no grant behind them are checked by scope and actor claim only.
permission_rulesDo your permission rules allow this actor to do this?Off by default (the permissions_enabled setting). When off, scope and actor claim decide.
impersonationMay this caller author records as another actor? Uses your permission rules.Off by default. It is off whenever permission rules are off, and the credential's list of allowed actors decides instead.
principal_proofDoes the caller hold the actor's key, not just a bearer token?Off by default (the require_principal_proof setting).

In a default workspace, scope, actor claim and grant validity are on; permission rules, impersonation and principal proof are off. A request refused by scope stays refused whatever the permission rules would have said.

Records and files

The same checks cover both records, threads and configuration, and files under /v1/data/*. They are applied in a slightly different order for each, so passing on one does not tell you about the other. If you are auditing a workspace, check both. Scope requirements for each route are in the API reference and Scopes & permissions.

Checking your workspace

To see which checks are on, ask your workspace. The health endpoint, called with a bearer token, includes an authorization block with the state of each check:

curl -s http://localhost:9100/v1/health \
  -H "Authorization: Bearer $SPL_TOKEN"

The block reports live (how many checks are on), of (six), and one entry per check. Abridged:

{
  "authorization": {
    "live": 3,
    "of": 6,
    "deciders": [
      { "decider": "scope",
        "answers": "does this credential cover this route class?",
        "state": "live", "fidelity": "exact" },
      { "decider": "actor_claim",
        "state": "live", "fidelity": "exact" },
      { "decider": "permission_rules",
        "state": "disabled", "switch": "permissions_enabled",
        "because": "permission rules are switched off; rules are loaded but never evaluated",
        "defer_to": "scope + actor_claim" },
      { "decider": "capability_grant",
        "answers": "is the membership grant behind this credential alive and unrevoked?",
        "state": "live", "fidelity": "conservative",
        "coverage": "consulted at the bearer door for grant-parented credentials; legacy credentials answer to scope + actor_claim alone" },
      { "decider": "impersonation",
        "state": "disabled", "switch": "permissions_enabled",
        "defer_to": "actor_claim (allowed_actors)" },
      { "decider": "principal_proof",
        "state": "disabled", "switch": "require_principal_proof",
        "defer_to": "impersonation" }
    ]
  }
}

Every check always appears. An off check (shown as disabled) names the switch responsible, a because, and what it defer_tos. A check that is on but limited states its coverage. fidelity says whether a check is exact, conservative or advisory.

The anonymous /health probe does not include this block. It does include proof_kinds_accepted, which tells a client which kinds of proof it can use to sign in.

Signed verdicts

Task verdicts (spl task approve and spl task reject) are signed with the reviewer's key. When the reviewer's key is known, a wrong signature is refused; an unknown key is accepted with a warning. This is not a seventh check on requests. It protects the record itself, and it also stops members judging their own work through a chain, as described in Principals & grants.

What's next

On this page