Liking cljdoc? Tell your friends :D

stroopwafel.pdp.spki.revocation

Revocation set collection and checking for the SPKI/SDSI PDP.

A revocation set is a plain map with three explicit scopes:

{:ids #{uuid ...} — revoked assertion IDs :keys #{kid ...} — revoked sayer keys (cascades to every assertion that sayer ever signed) :subjects #{name ...}} — revoked subject names (first element of an assertion's statement, by convention)

Two sources feed into the revocation pass of the pre-filter:

  1. In-band — :revocation assertions carried alongside other assertions in signed blocks. Collected via collect-in-band after trust filtering, so only revocations from trusted sayers count.
  2. Out-of-band — a caller-supplied function returning a live revocation set, registered via stroopwafel.pdp.spki.core/with-revocation-source. Useful for services that maintain a revocation feed outside the token path.

collect-all combines both. Sources compose via combine-sources.

This namespace owns the revocation data model and the in-band collection logic; core orchestrates when it runs within the pre-filter pipeline.

Revocation set collection and checking for the SPKI/SDSI PDP.

A revocation set is a plain map with three explicit scopes:

  {:ids      #{uuid ...}     — revoked assertion IDs
   :keys     #{kid ...}      — revoked sayer keys (cascades to
                                every assertion that sayer ever
                                signed)
   :subjects #{name ...}}    — revoked subject names (first
                                element of an assertion's
                                statement, by convention)

Two sources feed into the revocation pass of the pre-filter:

1. **In-band** — :revocation assertions carried alongside other
   assertions in signed blocks. Collected via `collect-in-band`
   after trust filtering, so only revocations from trusted sayers
   count.
2. **Out-of-band** — a caller-supplied function returning a live
   revocation set, registered via
   `stroopwafel.pdp.spki.core/with-revocation-source`. Useful for
   services that maintain a revocation feed outside the token path.

`collect-all` combines both. Sources compose via `combine-sources`.

This namespace owns the revocation data model and the in-band
collection logic; `core` orchestrates when it runs within the
pre-filter pipeline.
raw docstring

collect-allclj

(collect-all blocks)
(collect-all blocks source)

Collect a complete revocation set from in-band (blocks) and optional out-of-band (source function).

Arities: (collect-all blocks) — in-band only (collect-all blocks source) — combined with an external source

The source function takes zero arguments and returns a revocation set (or nil for empty).

Collect a complete revocation set from in-band (blocks) and optional
out-of-band (source function).

Arities:
  (collect-all blocks)         — in-band only
  (collect-all blocks source)  — combined with an external source

The source function takes zero arguments and returns a revocation
set (or nil for empty).
raw docstring

collect-in-bandclj

(collect-in-band blocks)

Walk a seq of verified blocks, extracting :revocation assertions into a revocation set. Only :revocation typed assertions contribute — other types are ignored.

Each :revocation assertion's statement is [scope target] where scope is :assertion, :key, or :subject.

Walk a seq of verified blocks, extracting :revocation assertions
into a revocation set. Only :revocation typed assertions contribute
— other types are ignored.

Each :revocation assertion's statement is `[scope target]` where
scope is `:assertion`, `:key`, or `:subject`.
raw docstring

combine-sourcesclj

(combine-sources & sources)

Compose N revocation source functions into a single source. The returned function calls each input source and merges their outputs. Sources may return nil (treated as empty-set).

(combine-sources static-a dynamic-b ...)

Compose N revocation source functions into a single source.
The returned function calls each input source and merges their
outputs. Sources may return nil (treated as `empty-set`).

(combine-sources static-a dynamic-b ...)
raw docstring

empty-setclj

The canonical empty revocation set. Useful as a default and for documentation — the shape is small but the contract is important.

The canonical empty revocation set. Useful as a default and for
documentation — the shape is small but the contract is important.
raw docstring

merge-setsclj

(merge-sets a b)

Combine two revocation sets by unioning each scope.

Useful when composing multiple sources, or when writing a custom source function that draws from multiple underlying stores.

Combine two revocation sets by unioning each scope.

Useful when composing multiple sources, or when writing a custom
source function that draws from multiple underlying stores.
raw docstring

revoked?clj

(revoked? rev-set sayer-kid assertion)

Is assertion (from a block signed by sayer-kid) revoked by rev-set? Checks all three scopes:

  1. assertion's :id is in (:ids rev-set), OR
  2. sayer-kid is in (:keys rev-set), OR
  3. the first element of the statement (the subject, by convention) is in (:subjects rev-set)

Returns truthy if any scope matches.

Is `assertion` (from a block signed by `sayer-kid`) revoked by
`rev-set`? Checks all three scopes:

1. assertion's :id is in (:ids rev-set), OR
2. sayer-kid is in (:keys rev-set), OR
3. the first element of the statement (the subject, by convention)
   is in (:subjects rev-set)

Returns truthy if any scope matches.
raw docstring

static-sourceclj

(static-source rev-set)

Return a revocation source function that always returns the same fixed set. Useful for tests, service startup configuration, or as one ingredient in combine-sources.

Accepts a revocation-set map; missing scopes default to empty sets.

Return a revocation source function that always returns the same
fixed set. Useful for tests, service startup configuration, or as
one ingredient in `combine-sources`.

Accepts a revocation-set map; missing scopes default to empty sets.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close