# Java and Kotlin SDK

The public API of `sdks/java`, with its doc comments. Guide: [docs/sdk/java.md](https://docs.allowedby.com/sdk/java).

363 public declarations, 272 with a doc comment.

## `allowedby-core/ActionClass.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/ActionClass.java`

```java
public enum ActionClass
```

How serious an action is (ABY-3 §4). It sets how long an approval may last and who asks for it: for
`WRITE_HARD` and `IRREVERSIBLE` the service itself creates a one-time approval bound to the exact
request (ABY-2 §6).

```java
READ("read", 30L * 86400)
```

Looks at data. Approved once, for up to 30 days.

```java
WRITE("write", 7L * 86400)
```

Changes data that can be undone. Approved once, for up to 7 days.

```java
WRITE_HARD("write-hard", 86400)
```

A change that is hard to undo. Approved every time, for the exact request (at most 24 hours).

```java
IRREVERSIBLE("irreversible", 3600)
```

Money or a final step. Approved every time, for the exact request (at most 1 hour).

```java
public String wire()
```

The name on the wire: `read`, `write`, `write-hard`, `irreversible`.

```java
public long maxLifetime()
```

The longest an approval of this class may last, in seconds (the reference's `CLASS_MAX`).

```java
public boolean serious()
```

True for write-hard and irreversible.

```java
public static ActionClass of(String wire)
```

The class of a wire name.

- throws ConfigurationException for an unknown name

## `allowedby-core/AllowedBy.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/AllowedBy.java`

```java
public final class AllowedBy implements AutoCloseable
```

AllowedBy for a service: let AI agents use your API with a person's approval.

`AllowedBy aby = AllowedBy.builder()
.origin("https://notes.example")
.node("https://node.example.org")
.org("Notes Ltd", "FR")
.route(Route.get("/notes").capability("notes:read").resource("note:\*"))
.template("notes:read", "Read your notes")
.build();
Outcome o = aby.process(request);   // or the servlet filter / Spring Boot starter
`

What it does (sdks/CONTRACT.md §2): serves `/.well-known/allowedby`, `/openapi.json` and
`/.well-known/api-catalog`; verifies every request on the route map offline (ABY-2 §5); answers 401 with a
challenge and creates the approval itself for write-hard and irreversible routes (ABY-2 §6); refreshes the node
statement and status lists in the background. Thread-safe; build one per application and `close()` it at
shutdown.

```java
public static final String LINK_PATH
```

The path of the SDK's link endpoint (ABY-3 §6).

```java
public static Builder builder()
```

A new builder.

```java
public Outcome process(Request req)
```

Everything a middleware does: the SDK's own endpoints, then the check on the route map. Paths outside the map
pass with a null context.

```java
public Response handle(Request req)
```

The SDK's own endpoints (`GET|HEAD /.well-known/allowedby`, `/openapi.json`,
`/.well-known/api-catalog`), or null when the path is not one of them.

```java
public boolean concerns(String method, String rawPath)
```

True when the SDK handles this request itself or checks it (a discovery path, or a route of the map). An
adapter reads the body only then: other requests reach the application untouched, body unread.

```java
public boolean concerns(String method, String rawPath, String dispatchedPath)
```

`concerns(String, String)` for a server that decodes and normalises the path before dispatching it
(`dispatchedPath`, e.g. a servlet's servlet path plus path info): the request concerns the SDK when
either form is on the route map.

```java
public static boolean sameDispatch(String rawPath, String dispatchedPath)
```

True when the server dispatches to the very path the SDK verifies. An adapter refuses a request on the route
map when it is false (`/notes;x`, `//notes`, `/notes%2F1`): otherwise the server could call a
protected handler for a path the route map did not match, unverified.

```java
public boolean sameRoute(String method, String rawPath, String dispatchedPath)
```

For adapters, once `concerns(String, String, String)` is true: true when the SDK verifies the very
route the server will dispatch to. False (refuse with `ambiguousPath()`) when only one of the two
forms is on the route map (`/v1/notes%3Aarchive` dispatched as `/v1/notes:archive`) or when they
name different paths (`/notes;x`, `//notes`, `/notes%2F1`): the check would otherwise find
no route and let a protected handler run unverified.

```java
public static Response ambiguousPath()
```

The refusal for `sameDispatch(String, String)` false.

```java
public static String target(String method, String path)
```

What an accepted request was checked as (plan point 14): its method, HEAD read as GET, and its path normalised as
the verifier normalises it (RFC 3986 §6.2.2). Another spelling of the same path gives the same target. Adapters
record it on acceptance and compare it where they see the handler that runs: a forward, a rewrite or a method
override after the check gives another target, and is refused with `changedRefusal()`.

```java
public static Response changedRefusal()
```

The refusal of an accepted request whose method or path changed before its handler ran: never the path.

```java
public static Response refusal(ErrorCode code, String title)
```

A refusal the SDK would send, e.g. for an adapter that cannot read the body.

```java
public boolean isVariant(String method, String rawPath, String query, Map<String, String> headers)
```

True when a router could dispatch this request to a handler of the route map although the request itself is
not that route (CONTRACT §2.10): a trailing or doubled `/`, a format suffix, or a method override
(`X-HTTP-Method-Override`, `X-HTTP-Method`, `X-Method-Override`, `_method`) on a
request that touches the map. Such a request is refused, never passed through.

```java
public boolean pathOnMap(String rawPath)
```

True when the path, or a variant of it, is on the route map for any method (form `_method` checks).

```java
public boolean concerns(String method, String rawPath, String dispatchedPath, String query, Map<String, String> headers)
```

Everything an adapter asks before reading the body: the request concerns the SDK when it is a discovery path,
a route of the map (raw or as dispatched), or a variant of one (`isVariant`).

```java
public boolean sharesHandler(String method, String rawPath, String handlerPrefix)
```



```java
public boolean isDeclared(String method, String rawPath)
```

True for an exact `unprotected` entry: it lifts the variant rules too.

```java
public boolean extendsRoute(String method, String rawPath)
```

For an adapter that cannot see which handler the router selects, on a request outside the map: true when the path
extends a route that ends in a parameter (`DELETE /notes/7/x` with `DELETE /notes/{id}`), because a
router may give the parameter the rest of the path (CONTRACT §2.10). Refuse with `unmappedRefusal()`; a
page of your own is declared with `Builder#unprotected(String)`.

```java
public boolean extendsAnyRoute(String rawPath)
```

`extendsRoute` for any method of the map (a form may carry `_method`).

```java
public boolean namesMount(String method, String prefix, String rawPath, String query, Map<String, String> headers)
```

For adapters, on a request outside the map in an application mounted at a prefix: true when the map was written
with the prefix, word for word, so that no request would ever match it. Refuse with `mountRefusal(String)`.

```java
public boolean omitsPrefix(String method, String rest)
```

For adapters, on a request outside the map that a handler registered for a prefix gets: true when the rest of the
path, which that handler may route on, is a route of the map, a variant or an extension of one, so that the map
was written without the prefix. The SDK's own documents are not routes: an application below a prefix may have its
own `/openapi.json`. Refuse with `unmappedRefusal()`.

```java
public static Response mountRefusal(String prefix)
```

The refusal for `namesMount(String, String, String, String, Map)`.

```java
public static Response unmappedRefusal()
```

The refusal for `sharesHandler(String, String, String)`: not a route of the map, though its handler serves one.

```java
public static Response notPlainRefusal()
```

The refusal of a target that is not plain (`Paths.canonical`): servers and routers read it differently.

```java
public static Response handlerRefusal()
```

The refusal of an adapter that sees the handler (CONTRACT §2.10 rule 5): the handler about to run serves a route of
the map, and the request was not checked for that route. No `unprotected` entry lifts it, so the title names
the two fixes.

```java
public static Response variantRefusal()
```

The refusal of a variant of a route (CONTRACT §2.10).

```java
public Outcome check(Request req)
```

Verify a request against the route map (ABY-2 §5). A path outside the map passes with a null context (your
own authentication applies); on the map, the request passes with its `Context` or gets a refusal.

```java
public String linkStart(String account)
```

Your signed-in account page calls this (ABY-3 §6): a one-time linking code for `account`, valid 600
seconds, which the person gives their agent. The agent sends it to `POST /allowedby/link` with a single-use
`aby:link` approval, and the person's pair (home node, pairwise id) is linked to the account.

- throws IllegalArgumentException for an account of 0 or more than 256 characters
- throws IllegalStateException when 10 000 codes are pending

```java
public String linkStart(String account, long ttl)
```

`linkStart(String)` with a lifetime of `ttl` seconds (1 to 86 400).

```java
public boolean unlink(String account)
```

Removes the link of one of your accounts (ABY-3 §6, Removing a link), when you delete the account or the person
asks to be forgotten: the linked pair (home node, pairwise id) and the account's pending linking codes. A
`requireLink` route then refuses the person (`403 human_not_linked`) until they link again with a
new code. Each instance keeps its own links: call it on the instance that made the link.

- return true when the account was linked, false when it was not (a no-op but for its pending codes)
- throws IllegalArgumentException for an account of 0 or more than 256 characters, as `linkStart(String)`

```java
public void refundBudget(Context ctx)
```

Your handler refused an accepted request (a wrong total, an unknown order): give its tenant budget back (ORG-1
§5.3, CONTRACT, Extended: tenant budgets), so the amount it did not spend counts no more. Once: a second call,
or one after the SDK's own refund (CONTRACT §2 item 10), does nothing, and so does a call for a request whose
route has no budget. The approval itself stays spent. When the store does not take it, the amount stays counted
(fail closed), logged without request data.

```java
public boolean started(Context ctx)
```

The adapter is about to hand this accepted request to its handler (or to code it cannot see past): from now on
nothing is given back for it. False for a request already refunded: its approval is usable again, so a layer
dispatching it once more must not reach a handler (a second use); the adapter refuses it. True again for a
request already started (a forward to what was checked).

```java
public static Response refundedRefusal()
```

The refusal of a refunded request dispatched again: it never reaches a handler. Never the path.

```java
public Map<String, Object> wellKnown()
```

`/.well-known/allowedby`.

```java
public Map<String, Object> openApi()
```

`/openapi.json`.

```java
public Map<String, Object> apiCatalog()
```

`/.well-known/api-catalog`.

```java
public Map<String, Object> tenantWellKnown(String tenant)
```

ORG-1 §3.3: a tenant's authority policy, signed by us, at `/.well-known/allowedby/tenants/<tenant>`, or
null when the tenant has none of its own (its routes use the service's).

```java
public String setAuthorityPolicy(Map<String, ?> policy)
```

ABY-1 §5, ORG-1 §3.3: overrides the service's authority policy at run time ({rules: [{cap, amount?: {min?, max?,
currency}, group, quorum?, budget?}], groups: {name: [pairwise id]}}): signed anew, held and published at once.
Approvals that carry the previous policy then get `authority_required`. With a store that has
`Store.Docs` and a `keyFile`, it is stored: every instance takes it at its next refresh, and it
outlives restarts until the config's `authorityPolicyRevision` is raised above the one it was set over.
Without either, it stays on this instance (said once). `revertAuthorityPolicy()` goes back to the config.

- return the policy JWS now held
- throws IllegalArgumentException for a policy that would not apply
- throws IllegalStateException when the store does not answer (nothing changed)

```java
public String setAuthorityPolicy(Map<String, ?> policy, String tenant)
```

`setAuthorityPolicy(Map)` for one tenant's own policy, published at its well-known; null: no policy of
its own (its routes then use the service's).

- return the policy JWS now held for the tenant, or null for none
- throws IllegalArgumentException for a malformed policy or an unknown tenant

```java
public void revertAuthorityPolicy()
```

Removes the override of the service's policy: the config's applies again, on every instance at its refresh.

```java
public void revertAuthorityPolicy(String tenant)
```

Removes the override of one tenant's policy.

- throws IllegalArgumentException for an unknown tenant

```java
public String getOrigin()
```

The public origin, normalised.

```java
public String getNode()
```

The node, normalised.

```java
public List<Route> getRoutes()
```

The route map.

```java
public Map<String, Object> getSigningKey()
```

The public signing key (JWK with kid), as published in `/.well-known/allowedby`.

```java
public List<String> refresh()
```

Refresh the node statement and status lists now, on this thread (the background refresh does it every
`refreshSeconds`, and `Builder#build()` waits for its first run). Returns what failed, empty when
everything was refreshed.

```java
public boolean isReady()
```

True once the node is trusted (its statement fetched and verified).

```java
public static final class Builder
```

Builds an `AllowedBy`; `build()` validates everything and says what to fix.

```java
public Builder origin(String origin)
```

Your service's public origin, e.g. `https://api.example.com` (what agents sign for).

```java
public Builder node(String node)
```

The AllowedBy node you trust (on first use, its key pinned), e.g. `https://node.example.org`.

```java
public Builder org(String legalName, String country)
```

Your organisation (ORG-1 §2): legal name and ISO 3166-1 alpha-2 country, e.g. ("Notes Ltd", "FR").

```java
public Builder org(Map<String, ?> org)
```

Your organisation with more members: `legal_name`, `country`, and optionally `website`,
`support`, `privacy_policy` (https URLs), `logo` ({uri, sha256}), `exp`.

```java
public Builder route(Route route)
```

Add a route.

```java
public Builder routes(Collection<Route> routes)
```

Add routes.

```java
public Builder unprotected(String path)
```

A page of your own whose path looks like a variant or an extension of a route of the map, such as
`/notes.txt` or `/notes/{id}/comments` next to `/notes/{id}`: an exact path, or a template of
whole-segment parameters (which lifts the rule of longer paths only). Without it such a path is refused, never
served unchecked (CONTRACT §2.10). An entry that overlaps a route of the map, as it is
or but for its last `/`, fails construction.

```java
public Builder unprotected(String method, String path)
```

`unprotected(String)` for one method.

```java
public Builder template(String capability, String text)
```

The sentence the person approves for a capability, in English (summary and line).

```java
public Builder template(String capability, Map<String, ?> template)
```

A full template: {@code {"summary": {"en": ..., "fr": ...}, "lines": {...}}}, placeholders
`{scope}`, `{amount.max}`, `{fields}` (AMH-1 §4).

```java
public Builder templates(Map<String, ?> templates)
```

Several templates: capability to a sentence (String) or a full template (Map).

```java
public Builder keyFile(Path keyFile)
```

A private JSON file keeping the signing key and the disclosure key across restarts, shared by every
instance (created on first use, mode 0600; the same format in every SDK). Without it both keys are new
at each start.

```java
public Builder store(Store store)
```

The replay set, single use and counters (default: `MemoryStore`, one process only).

```java
public Builder trustList(TrustList trustList)
```

A signed trust list (OAID-5) instead of trusting `node(String)` on first use.

```java
public Builder refreshSeconds(int refreshSeconds)
```

How often the node statement and status lists are refreshed, in seconds (default 5, at most 60).

```java
public Builder nodeMaxLevel(int nodeMaxLevel)
```

The highest level accepted from the node (default 3).

```java
public Builder clock(Clock clock)
```

The clock every time check uses (default: system UTC).

```java
public Builder title(String title)
```

The API title (OpenAPI; default "&lt;legal name> API").

```java
public Builder version(String version)
```

The API version (OpenAPI; default 1.0.0).

```java
public Builder description(String description)
```

The API description (OpenAPI).

```java
public Builder rfc9421(boolean rfc9421)
```

Also accept the RFC 9421 Web Bot Auth profile instead of the proof JWT (ABY-2 §3.1).

```java
public Builder authorityPolicy(Map<String, ?> policy)
```

The service's authority policy (ABY-1 §5), {rules: [{cap, amount?: {min?, max?, currency}, group, quorum?,
budget?}], groups: {name: [pairwise id]}}: signed by the SDK and published in `/.well-known/allowedby`;
a route with `Route#authority(boolean)` needs the co-approvers its rule asks for. A tenant may carry its
own (`tenants[t].authority`). A rule of another shape fails `build()`.

```java
public Builder authorityPolicyRevision(long revision)
```

The config's authority policy revision, 0 by default: raise it only to take control back from an override
set at run time (`AllowedBy#setAuthorityPolicy(Map)`), which stays in force until the config's revision
is above the one it was set over. Negative fails `build()`.

```java
public Builder tenants(Map<String, ?> tenants)
```

Tenants (ORG-1 §3.3) and their budgets (§5.3), keyed by the path parameter `tenant`: {tenant id:
{name, routes: {capability: override}, budgets: {capability: {max, currency, per, tz}}, org,
members_only}}, of JSON values (maps, lists, strings, numbers, booleans). An override only tightens the
route: `level` (the higher counts), `authn` (the stronger), `mandate` (this SDK verifies
none: such a route refuses with `401 mandate_required`), `require_link` (true wins),
`max_lifetime` (the shorter), `amount_max` (the lower; above it `403 capability_denied`),
`operators` (an allowlist of `operator.id`). A budget counts
the amounts accepted per tenant, capability and calendar period in `tz` (default UTC), in the
`store(Store)`, and refuses one over what is left with `403 budget_exceeded`, before any
approval is asked. Any other key or shape, or an override or budget on a capability with a route without
`{tenant}`, fails `build()`. The map is copied: later changes to it change nothing.

```java
public Builder nonce(boolean nonce)
```

AllowedBy-Nonce (ABY-2 §3.2), off by default: with it on, a route with `Route#nonce(boolean)`, and every
`irreversible` route, refuses a proof without a current nonce with `401 invalid_signature` and a
fresh nonce in the `AllowedBy-Nonce` header. A nonce is current for 300 s, on every instance that shares
the `keyFile(Path)`, and across a restart.

```java
public Builder rate(String limit, int calls, Duration per)
```

A rate limit: `"actor"`, per agent (its passport's `sub`), or `"operator"`, per operator
(`operator.id`), at most `calls` calls per `per` (whole seconds, a sliding window on the
`clock(Clock)`). The defaults are 600 and 6000 calls per minute; a call over either limit gets
`429 rate_limited`. Another name, or a limit that is not a positive number of calls in a positive whole
number of seconds, fails `build()`.

```java
public Builder linkAuthorize(LinkAuthorizer linkAuthorize)
```

Your own authorisation of a linked account on a route that needs a link (ABY-3 §6: the check is the
service's, done with the verifier's output). Only an answer of exactly `true` lets the request on;
`false`, null or an exception refuses it with `403 human_not_linked`.

```java
public AllowedBy build()
```

Build and start the background refresh. Returns once its first refresh is over (done or failed, at most
5 s), so a service that starts cold (a new instance, or one that scales to zero) trusts its node and holds
its status lists before its first request: nothing is fetched at request time (ARCH-1 §4, CONTRACT §2
item 4).

- throws ConfigurationException naming what to fix

## `allowedby-core/ConfigurationException.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/ConfigurationException.java`

```java
public class ConfigurationException extends IllegalArgumentException
```

An invalid configuration, found at construction. The message says what to fix.

```java
public ConfigurationException(String message)
```

With a message that says what to fix.

```java
public ConfigurationException(String message, Throwable cause)
```

With a cause.

## `allowedby-core/Context.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/Context.java`

```java
public final class Context
```

What an accepted request established (ORG-1 §4.1, ABY-2 §5 step 10), given to the handler. Read-only.

Servlet: `request.getAttribute(Context.ATTRIBUTE)`; Spring MVC: a `@AllowedByContext Context`
parameter. In Kotlin every getter reads as a property (`ctx.humanId`, `ctx.level`).

```java
public static final String ATTRIBUTE
```

The request attribute (servlet) under which adapters store the context.

```java
public static final class ChainLink
```

One link of the grant chain, leaf first: the grant id and its revision.

```java
public String getGid()
```

Grant id.

```java
public Long getRev()
```

Revision (0 at issuance), or null.

```java
public String getAgent()
```

The agent: its passport subject (`did:oaid:...`).

```java
public String getOperator()
```

The operator running the agent (a verified domain, or the node's own operator id).

```java
public String getHumanId()
```

The person, as a pairwise id for this service (different at every service), or null on a level-0 route.
Key your data on it: it is stable for one person and one service.

```java
public int getLevel()
```

The identity level reached: 0 (agent only), 1 passkey, 2 verified identity, 3 eIDAS high.

```java
public List<String> getCapabilities()
```

The capabilities the approval grants (e.g. `notes:read`).

```java
public Map<String, Object> getDisplay()
```

The text the person approved: {summary, lines, lang}, or null on a level-0 route.

```java
public String getGid()
```

The grant id (stable across revisions), or null on a level-0 route.

```java
public Long getRev()
```

The grant revision, or null.

```java
public String getJti()
```

The grant document's jti, or null.

```java
public Map<String, Object> getActingFor()
```

The company the person acts for: always null, company mandates are not in this SDK yet.

```java
public String getTenant()
```

The route's `{tenant}` value, as in `getParams()` (decoded once), or null when the route has none:
the tenant whose overrides and budget held for this request (ORG-1 §3.3, §5.3; `Builder.tenants`).

```java
public Route getRoute()
```

The route of the route map that matched.

```java
public ActionClass getActionClass()
```

The class of this request (for a route classed by amount: the class its amount gave).

```java
public Map<String, String> getParams()
```

The route's path values as the SDK checked them (CONTRACT §2 item 7): each `{name}` of the route's template,
taken from the normalised path and percent-decoded once (`/t/acme%20co` gives `acme co`, `%2520`
gives `%20`, an encoded `/` stays inside its value). Unmodifiable; empty for a route without
parameters. Act on these values, never on your own reading of the raw path, which can differ
(`DELETE /notes/7/.` is checked as `/notes/7`).

```java
public List<ChainLink> getChain()
```

The grant chain, leaf first (ABY-2 §5 step 10, for your audit log).

```java
public String getHumanIss()
```

The person's home node, or null.

```java
public String getProofJti()
```

The proof's jti (or the RFC 9421 nonce).

```java
public String getRun()
```

Audit: the agent's run id, when it sent one.

```java
public Long getCall()
```

Audit: the call number within the run, when sent.

```java
public String getLinkedAccount()
```

On a route that needs a link (`Route#requireLink(boolean)`, ABY-3 §6): the account of yours the person's
pair (home node, pairwise id) is linked to, and authorised for. Null on any other route. Key the account's data
on it, never on a path value alone.

## `allowedby-core/ErrorCode.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/ErrorCode.java`

```java
public enum ErrorCode
```

Every refusal code and its HTTP status (ABY-2 §6), the same in every AllowedBy SDK (the reference's
`verifier.STATUS`). The problem type is `https://allowedby.org/errors/``.

```java
INVALID_REQUEST("invalid_request", 400, false)
```

400: malformed request (a body that is not a JSON object, a malformed Allowed-By).

```java
PASSPORT_REQUIRED("passport_required", 401, false)
```

401: no Allowed-By header: the agent shows its passport.

```java
INVALID_SIGNATURE("invalid_signature", 401, false)
```

401: a signature, proof, replay or document check failed.

```java
UNTRUSTED_NODE("untrusted_node", 401, false)
```

401: the document comes from a node this service does not trust.

```java
INSUFFICIENT_WITNESSES("insufficient_witnesses", 401, false)
```

401: the node's log is not witnessed by enough trusted nodes (OAID-5).

```java
GRANT_REQUIRED("grant_required", 401, true)
```

401 challenge: the person's approval is needed.

```java
GRANT_INSUFFICIENT("grant_insufficient", 401, true)
```

401 challenge: the approval does not cover this request.

```java
LEVEL_INSUFFICIENT("level_insufficient", 401, true)
```

401 challenge: a stronger identity check is needed.

```java
QES_REQUIRED("qes_required", 401, true)
```

401 challenge: a qualified electronic signature is needed.

```java
AUTHORITY_REQUIRED("authority_required", 401, true)
```

401 challenge: the organisation's co-approvers are needed (extended, not in this SDK).

```java
MANDATE_REQUIRED("mandate_required", 401, true)
```

401 challenge: a company mandate is needed.

```java
EXPIRED("expired", 401, true)
```

401 challenge: the approval expired.

```java
NOT_YET_VALID("not_yet_valid", 401, false)
```

401: the document is not valid yet.

```java
REVOKED("revoked", 401, true)
```

401 challenge: the approval or the registration was withdrawn.

```java
ACTOR_EXPIRED("actor_expired", 401, true)
```

401 challenge: the agent's key expired; rebind the grant.

```java
CLASS_LIFETIME_EXCEEDED("class_lifetime_exceeded", 401, true)
```

401 challenge: the approval lasts longer than this action allows.

```java
SINGLE_USE_CONSUMED("single_use_consumed", 401, true)
```

401 challenge: a one-time approval was already used.

```java
CAPABILITY_DENIED("capability_denied", 403, false)
```

403: no such capability, or the route refuses this agent.

```java
TIER_INSUFFICIENT("tier_insufficient", 403, false)
```

403: the agent's key custody or the passkey is too weak for this action.

```java
HUMAN_NOT_LINKED("human_not_linked", 403, false)
```

403: the person has not linked their account (extended, not in this SDK).

```java
BUDGET_EXCEEDED("budget_exceeded", 403, false)
```

403: a budget is used up (extended, not in this SDK).

```java
RATE_LIMITED("rate_limited", 429, false)
```

429: too many requests (extended, not in this SDK).

```java
ENVELOPE_TOO_LARGE("envelope_too_large", 431, false)
```

431: Allowed-By and AllowedBy-Proof over 8 KiB, or a chain of more than two JWS (depth 1, ABY-2 §2).

```java
STATUS_STALE("status_stale", 503, false)
```

503: revocation status (or the replay store) temporarily unavailable; retry after Retry-After.

```java
public String code()
```

The wire code, e.g. `grant_required`.

```java
public int status()
```

The HTTP status.

```java
public boolean challenge()
```

True when the refusal carries an AllowedBy challenge (the reference's `CHALLENGE_CODES`).

```java
public String type()
```

The problem type URI.

## `allowedby-core/LinkAuthorizer.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/LinkAuthorizer.java`

```java
public interface LinkAuthorizer
```

Your own authorisation of a linked account on a route that needs a link (ABY-3 §6). The SDK has found the account
the person's pair is linked to; you say whether that account may act on this resource. Only `Boolean#TRUE`
lets the request on: `false`, null or an exception refuses it with `403 human_not_linked`.

```java
Boolean authorize(String account, Route route, Map<String, String> params) throws Exception
```

- param account the account the pair is linked to
- param route the route of the request
- param params its path parameters, decoded once
- return exactly `true` to let it on
- throws Exception refuses the request (403), never a 500

## `allowedby-core/MemoryStore.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/MemoryStore.java`

```java
public final class MemoryStore implements Store, Store.Docs
```

The `Store` in memory: thread-safe, for ONE process only. Entries live until their own deadline (300 s for
proofs, the grant's expiry or the period's end otherwise). Bounded: when full of live entries it refuses new ones
(fail closed) rather than forget a replay.

```java
public MemoryStore()
```

A store of at most 200 000 live entries (the reference's default).

```java
public MemoryStore(int maxKeys)
```

A store of at most `maxKeys` live entries.

## `allowedby-core/Outcome.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/Outcome.java`

```java
public final class Outcome
```

What to do with a request (`AllowedBy#process(Request)`): send the SDK's own `getResponse() response`
(a discovery document or a refusal), or pass the request to the application, with the `getContext()
context` when it was verified (null on a path outside the route map).

```java
public boolean isAllowed()
```

True when the request goes on to the application.

```java
public Response getResponse()
```

The response to send instead of calling the application, or null.

```java
public Context getContext()
```

The verified context, or null (refused, or a path outside the route map).

## `allowedby-core/Request.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/Request.java`

```java
public final class Request
```

An HTTP request as the SDK sees it: what a framework adapter passes to `AllowedBy#process(Request)`.
Immutable. Header names are case-insensitive; a header sent several times is one value joined with ", "
(RFC 9110 §5.3).

```java
public static Request of(String method, String path, String query, Map<String, String> headers, byte[] body)
```

A request.

- param method the HTTP method
- param path the path as sent (percent-encoded, without the query)
- param query the query string without "?", or null
- param headers the headers (any case)
- param body the body as sent, or null when there is none

```java
public Request mountedAt(String prefix)
```

The same request, in an application mounted at `prefix` (`/api`; a servlet's context path): the URL the
agent signed has it, the paths of the route map do not (CONTRACT §2.10).

- throws IllegalArgumentException for a prefix that is neither empty nor an absolute path

```java
public String prefix()
```

Where the application is mounted, or "".

```java
public String method()
```

The method, upper case.

```java
public String path()
```

The path as sent, without the query.

```java
public String query()
```

The query string without "?", or "".

```java
public String header(String name)
```

A header, or null.

```java
public Map<String, String> headers()
```

All headers (case-insensitive keys).

```java
public byte[] body()
```

The body bytes (empty when none).

## `allowedby-core/Response.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/Response.java`

```java
public final class Response
```

An answer the SDK sends itself: a discovery document or a refusal (problem+json). Immutable.

```java
public int getStatus()
```

The HTTP status.

```java
public Map<String, String> getHeaders()
```

Headers to send (Content-Type included).

```java
public byte[] getBody()
```

The body bytes.

```java
public String getBodyText()
```

The body as text.

## `allowedby-core/Route.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/Route.java`

```java
public final class Route
```

One line of the route map (ABY-3 §4.1): which capability a method and path need, how serious the action is, and
the identity level the person must have. Immutable: every method returns a new route.

`Route.get("/notes").capability("notes:read").level(1).resource("note:\*")
Route.delete("/notes/{id}").capability("notes:delete").actionClass(ActionClass.WRITE_HARD).level(2)
.resource("note:{id}")
Route.get("/me").level(0)          // the agent's passport is enough, no person
`

The same arguments and validation as the Python reference's `route()`. `AllowedBy.Builder#build()`
validates every route; the message names the route and what to fix.

```java
public static final class Threshold
```

One amount threshold of a route classed by amount (ABY-3 §4.1).

```java
public static Threshold upTo(String upTo, ActionClass actionClass)
```

Amounts up to and including `upTo` (a decimal string, e.g. "1000.00") take this class.

```java
public static Threshold otherwise(ActionClass actionClass)
```

The last threshold: every larger (or unreadable) amount takes this class.

```java
public String upTo()
```

The limit, or null for the last threshold.

```java
public ActionClass actionClass()
```

The class.

```java
public static Route route(String method, String path)
```

A route for any method. `{param}` segments match one path segment.

```java
public static Route get(String path)
```

GET.

```java
public static Route post(String path)
```

POST.

```java
public static Route put(String path)
```

PUT.

```java
public static Route patch(String path)
```

PATCH.

```java
public static Route delete(String path)
```

DELETE.

```java
public Route capability(String capability)
```

The capability the route needs, `namespace:action` (e.g. `notes:read`).

```java
public Route actionClass(ActionClass actionClass)
```

The class of the action (default `ActionClass#READ`).

```java
public Route actionClass(String actionClass)
```

The class by its wire name: read, write, write-hard, irreversible.

```java
public Route classByAmount(Threshold... thresholds)
```

A payment route: the class comes from the amount at `amountField(String)`, e.g.
`classByAmount(Threshold.upTo("1000.00", WRITE_HARD), Threshold.otherwise(IRREVERSIBLE))`.

```java
public Route level(int level)
```

The identity level the person needs: 0 (the agent's passport only), 1 passkey, 2 verified, 3 eIDAS high.

```java
public Route resource(String resource)
```

The resource the action is on, with `{param}` from the path (default `<namespace>:*`).

```java
public Route amountField(String amountField)
```

JSON Pointer to the amount in the body (e.g. `/total`): the approval caps it.

```java
public Route currencyField(String currencyField)
```

JSON Pointer to the currency in the body (default `/currency`).

```java
public Route authn(String authn)
```

The weakest passkey accepted: `software`, `synced` or `hardware`.

```java
public Route tier(int tier)
```

The lowest custody tier of the agent's key (OAID-3), default 0.

```java
public Route maxLifetime(Duration maxLifetime)
```

The longest an approval may last on this route, 60 s to 30 days (default: the class's).

```java
public Route levelProfile(String levelProfile)
```

A level-3 route for one profile of level 3 only: `eu` or `na` (OAID-7 §5.3).

```java
public Route qes(boolean qes)
```

A qualified electronic signature is required (OAID-7 §10). This SDK has no EU trusted-list snapshot to check
one, so such a route always answers `qes_required` (fail closed), as the reference does without one.

```java
public Route summary(String summary)
```

What the route does, for agents (OpenAPI).

```java
public Route body(Map<String, ?> body)
```

The JSON body members, for agents (OpenAPI): name to a description or a JSON Schema object.

```java
public Route option(String name, Object value)
```

Set an option by its reference name (as in configuration files): `capability`, `class`,
`level`, `resource`, `amount_field`, `currency_field`, `authn`, `tier`,
`max_lifetime`, `level_profile`, `qes`, `require_link`, `account_param`,
`nonce`, `authority`, `summary`. The reference's other options (`mandate`,
`disclose`, `disclose_optional`) are not enforced by this SDK yet: setting one makes construction
fail, never silently accepted (CONTRACT §2).

```java
public String method()
```

The HTTP method.

```java
public String path()
```

The path pattern.

```java
public String capability()
```

The capability, or null on a level-0 route without one.

```java
public ActionClass actionClass()
```

The class (for a route classed by amount: its most serious class).

```java
public List<Threshold> thresholds()
```

The amount thresholds, or null.

```java
public int level()
```

The identity level.

```java
public String resource()
```

The resource pattern (default `<namespace>:*`).

```java
public String amountField()
```

JSON Pointer to the amount, or null.

```java
public String currencyField()
```

JSON Pointer to the currency.

```java
public String authn()
```

The weakest passkey accepted, or null.

```java
public int tier()
```

The lowest custody tier.

```java
public Long maxLifetime()
```

The route's own maximum approval lifetime in seconds, or null.

```java
public String levelProfile()
```

The level-3 profile, or null.

```java
public boolean qes()
```

True when a qualified signature is required.

```java
public Route requireLink(boolean requireLink)
```

The route needs a linked account (ABY-3 §6): the person's pair (home node, pairwise id) must be linked to one of
your accounts through `POST /allowedby/link`, else `403 human_not_linked`. When the path names an
account (`accountParam(String)`, default `account`), the pair must be linked to that account.
Needs a capability and a level above 0.

```java
public Route accountParam(String accountParam)
```

The path parameter that names one of your accounts (ABY-3 §6), default `account`: a {name} of the path.

```java
public Route nonce(boolean nonce)
```

The route asks for an AllowedBy-Nonce (ABY-2 §3.2): a proof without a current nonce is refused with
`401 invalid_signature` and a fresh nonce in the `AllowedBy-Nonce` header, which the agent retries
with. Needs `AllowedBy.Builder#nonce(boolean)`, or construction fails. Every `irreversible` route asks
for one when the service has nonces on.

```java
public Route authority(boolean authority)
```

The route needs the organisation's authority (ABY-1 §5): the approval must carry the authority policy in force
(the service's, or its tenant's), by id and hash, and the co-approvers its rule asks for, else
`401 authority_required`. Needs a capability, and an authority policy for the service
(`AllowedBy.Builder#authorityPolicy(Map)`) or its tenant.

```java
public boolean authority()
```

True when the route needs the organisation's authority.

```java
public boolean nonce()
```

True when the route itself asks for an AllowedBy-Nonce (an irreversible route asks whatever this says).

```java
public boolean requireLink()
```

True when the route needs a linked account.

```java
public String accountParam()
```

The path parameter that names an account: the one set, or `account`.

```java
public String summary()
```

The summary, or null.

```java
public Map<String, Object> body()
```

The documented body members, or null.

```java
public List<String> params()
```

The path parameter names, in order.

## `allowedby-core/Store.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/Store.java`

```java
public interface Store
```

The replay set, single-use consumption and counters (ABY-2 §3.3, ABY-1 §7, ABY-3 §3). Every instance of a service
must share one store, or a proof could be replayed on another instance: `MemoryStore` is for one process
only; use a shared store (e.g. `org.allowedby.redis.RedisStore`) when you run several.

`now` always comes from the SDK's clock, never from the store's own wall clock, so an injected clock
governs expiry too. An implementation that cannot answer throws: the SDK then refuses the request (fail closed).

```java
boolean add(String key, long until, long now)
```

Add `key` unless it is present and live: an atomic check-and-set.

- param key the entry
- param until when it expires (epoch seconds)
- param now the SDK's clock (epoch seconds)
- return false when it already was there (a replay, a second use)

```java
BigDecimal get(String key, long now)
```

The live value of a counter or entry.

- return the value, or zero when absent or expired

```java
boolean charge(List<Charge> charges, long now)
```

All or nothing: add every increment when every total stays within its maximum. Atomic.

A refund (CONTRACT §2 item 10) is a charge too: the same keys with negative increments and no maximum, which
must be applied exactly (in decimals, never rounded), the single-use mark included. A store that cannot apply it
throws or returns false: the approval then stays spent.

- return false (and nothing changed) when one total would exceed its maximum

```java
public Charge(String key, BigDecimal increment, BigDecimal max, long until)
```

- param key the counter
- param increment what to add
- param max the most the total may reach, or null for no limit
- param until when the counter expires (epoch seconds)

```java
public String key()
```

The counter.

```java
public BigDecimal increment()
```

What to add.

```java
public BigDecimal max()
```

The most the total may reach, or null.

```java
public long until()
```

When the counter expires (epoch seconds).

```java
public Charge until(long newUntil)
```

The same charge with another expiry.

```java
boolean putDoc(String key, long version, String doc, long now)
```

Atomically store `doc` at `key` with `version` when it is above the stored version (a
compare-and-set: of two writers of one version, one wins). Never expires.

- return true when stored

```java
Doc getDoc(String key, long now)
```

The document stored at `key`, or null.

```java
record Doc(long version, String doc)
```

A stored document and its version.

```java
public Doc
```

Both members are required.

## `allowedby-core/TrustList.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/TrustList.java`

```java
public final class TrustList
```

A signed trust list (OAID-5 §2, `oaid-trust+jwt`) used instead of trust on first use: anchors, trust
programs, vouching and witnesses. It is signed by one of the service's own keys (configuration integrity).

```java
public static TrustList parse(String jws, Map<String, Object> serviceKey)
```

Parse and check a trust list.

- param jws the compact JWS
- param serviceKey the public JWK (with its `kid`) of the service key that signed it
- throws ConfigurationException when the signature, the key or the members are wrong

```java
public static TrustList load(Path path, Map<String, Object> serviceKey) throws IOException
```

`parse(String, Map)` from a file.

```java
public long exp()
```

Expiry (epoch seconds): after it, no node is trusted.

```java
public List<Map<String, Object>> anchors()
```

The anchors ({node, kid, max_level}).

```java
public Set<String> denied()
```

Nodes never trusted.

```java
public Map<String, Object> vouching()
```

Vouching rules ({enabled, max_depth, min_vouchers, vouched_max_level, inherit_max_level}).

```java
public List<Map<String, Object>> programs()
```

Trust programs ({url, kids, max_level, refresh}).

```java
public int witnessesMin()
```

How many trusted witnesses must cosign a node's log (0: not checked).

```java
public Map<String, Object> payload()
```

The signed payload.

## `allowedby-core/httpserver/AllowedByHttpFilter.java`

`sdks/java/allowedby-core/src/main/java/org/allowedby/httpserver/AllowedByHttpFilter.java`

```java
public final class AllowedByHttpFilter extends Filter
```

A filter for the JDK's own HTTP server (`com.sun.net.httpserver`, no dependency): the SDK's endpoints first,
then the check on every route of the map, then your handler. Paths outside the map reach the handler with the body
unread. On the map the body is read once and given back intact.

The handler reads the accepted `Context` with `exchange.getAttribute(Context.ATTRIBUTE)` (null
outside the route map). It is held by the exchange the handler receives, never in the JDK's attribute map, which
the JDK shares between every exchange of an `HttpContext`.

`server.createContext("/", handler).getFilters().add(new AllowedByHttpFilter(aby));
`

```java
public static final int MAX_BODY
```

Largest body read on a route of the map: 1 MiB.

```java
public AllowedByHttpFilter(AllowedBy aby)
```

A filter for one `AllowedBy`.

## `allowedby-redis/redis/RedisStore.java`

`sdks/java/allowedby-redis/src/main/java/org/allowedby/redis/RedisStore.java`

```java
public final class RedisStore implements Store, Store.Docs, AutoCloseable
```

The `Store` in Redis, shared by every instance of a service (ABY-2 §3.3): the replay set, single-use
consumption and counters.

```
   Expiry follows the SDK's clock: each value carries its own deadline (`value|until`), checked against
      the `now` the SDK passes; Redis' own TTL only collects old entries.
   `add` is one Lua script (check-and-set).
   `charge` computes the new totals in exact decimals in Java, then writes them with one Lua
      compare-and-set over every key; when another instance changed a counter meanwhile, it reads again.
   One Redis primary (or Sentinel). Redis Cluster is not supported: one charge touches several keys.


```
`AllowedBy.builder()...store(new RedisStore("redis://redis.internal:6379")).build();
`

```java
public RedisStore(String url)
```

A store on a Redis URL, e.g. `redis://host:6379` or `rediss://user:pass@host:6380/0`.

```java
public RedisStore(UnifiedJedis redis)
```

A store on your client (you close it). Keys start with `allowedby:`.

```java
public RedisStore(UnifiedJedis redis, String prefix)
```

A store on your client with another key prefix (several services on one Redis).

## `allowedby-servlet/servlet/AllowedByFilter.java`

`sdks/java/allowedby-servlet/src/main/java/org/allowedby/servlet/AllowedByFilter.java`

```java
public final class AllowedByFilter implements Filter
```



```java
public static final int MAX_BODY
```

Largest body read on a route of the map: 1 MiB (the reference's `MAX_BODY`).

```java
public static final String TARGET
```

The request attribute that holds what an accepted request was checked as (`AllowedBy#target`): compare it
with `target(HttpServletRequest)` where the handler is known.

```java
public AllowedByFilter(AllowedBy aby)
```

A filter for one `AllowedBy`.

```java
public AllowedByFilter(AllowedBy aby, String handlerAwareServlet)
```

A filter for one `AllowedBy`. `handlerAwareServlet`: the name of a servlet that checks the handler it
selects itself (the Spring Boot starter's `dispatcherServlet`), so that a path that merely extends a route
of the map goes on to it. Every other servlet gets the rules of a plain filter. Null: none.
The filter still starts an accepted request before it hands it on (CONTRACT §2 item 10): a refusal after that
refunds nothing.

```java
public AllowedByFilter(AllowedBy aby, java.util.function.Supplier<String> handlerAwareServlet)
```

`AllowedByFilter(AllowedBy, String)` with the servlet's name known only once the application has started
(the Spring Boot starter checks every handler mapping first). Until then, and when it gives null, every servlet
gets the rules of a plain filter.

```java
public static String target(HttpServletRequest req)
```

What this request would be checked as now (`AllowedBy#target`): its method and the path below the context
path, the included one for an include (null when an include does not say which).

```java
public static boolean changed(HttpServletRequest req)
```

True when an accepted request is no longer the one checked: another method or path (another spelling of the same
path is the same), or no record of what was checked at all. Both forms of the path must be the ones checked: as
sent, normalised, and as the container maps it (decoded, normalised, path parameters stripped), since a segment
such as `..;` is a literal in one and dot-dot in the other.

```java
public static boolean movedOntoMap(AllowedBy aby, HttpServletRequest req)
```

True when an accepted request now runs for another method or path that the route map protects: a route of the
map or a longer path of one, or a path an include does not name. A path off the map (a view, a static page) is
not: what runs there is not a handler of the map.

## `allowedby-spring-boot-starter/spring/AllowedByAutoConfiguration.java`

`sdks/java/allowedby-spring-boot-starter/src/main/java/org/allowedby/spring/AllowedByAutoConfiguration.java`

```java
public class AllowedByAutoConfiguration
```

Spring Boot auto-configuration: an `AllowedBy` bean from `allowedby.*` (and every
`AllowedByCustomizer`), the servlet filter on every path, and the `AllowedByContext` argument resolver
for Spring MVC controllers. A user-defined `AllowedBy` bean replaces the one built here; a `Store` bean
replaces the in-memory store.

```java
public AllowedBy allowedBy(AllowedByProperties p, ObjectProvider<Store> store, ObjectProvider<AllowedByCustomizer> customizers)
```

The service SDK, from the properties and the customizers: built once its first refresh is over (done or failed,
at most 5 s, CONTRACT §2 item 4), so a node that answers is trusted before the first request. Closed (refresh
stopped) with the context.

```java
public FilterRegistrationBean<AllowedByFilter> allowedByFilter(AllowedBy aby, AllowedByProperties p, HandlerCheck check)
```

The servlet filter on every path: the SDK's endpoints, then the route map, then the application.

```java
public static class Mvc implements WebMvcConfigurer
```

`@AllowedByContext Context ctx` in Spring MVC controllers.

## `allowedby-spring-boot-starter/spring/AllowedByContext.java`

`sdks/java/allowedby-spring-boot-starter/src/main/java/org/allowedby/spring/AllowedByContext.java`

```java
public @interface AllowedByContext
```

Injects the verified `org.allowedby.Context` into a Spring MVC handler parameter.

`@GetMapping("/notes")
List&lt;Note> notes(@AllowedByContext Context ctx) {
String person = ctx.getHumanId();
if (person == null) // level 0: no person, and never a key
throw new ResponseStatusException(HttpStatus.FORBIDDEN, "no person at level 0");
return store.of(person);
}
`

With `required = true` (the default) a handler never runs without a verified context: on a path that is
not on the route map the request is refused with 401.

```java
boolean required() default true
```

Refuse (401) when there is no verified context; false gives null instead.

## `allowedby-spring-boot-starter/spring/AllowedByContextResolver.java`

`sdks/java/allowedby-spring-boot-starter/src/main/java/org/allowedby/spring/AllowedByContextResolver.java`

```java
public final class AllowedByContextResolver implements HandlerMethodArgumentResolver
```

Resolves `AllowedByContext` parameters from the request attribute the filter set.

## `allowedby-spring-boot-starter/spring/AllowedByCustomizer.java`

`sdks/java/allowedby-spring-boot-starter/src/main/java/org/allowedby/spring/AllowedByCustomizer.java`

```java
public interface AllowedByCustomizer
```

Adjusts the `AllowedBy` the starter builds, after the `allowedby.*` properties: add routes and
templates in code, a trust list, a clock.

`@Bean
AllowedByCustomizer routes() {
return b -> b.route(Route.get("/notes").capability("notes:read")).template("notes:read", "Read your notes");
}
`

```java
void customize(AllowedBy.Builder builder)
```

Change the builder.

## `allowedby-spring-boot-starter/spring/AllowedByProperties.java`

`sdks/java/allowedby-spring-boot-starter/src/main/java/org/allowedby/spring/AllowedByProperties.java`

```java
public class AllowedByProperties
```

`allowedby.*` properties. Unknown keys fail the start (`ignoreUnknownFields = false`): a misspelt or
unsupported option is never silently ignored.

allowedby:
origin: https://api.example.com
node: https://node.example.org
org: { legal-name: Example Ltd, country: FR }
routes:
- { method: GET, path: /notes, capability: "notes:read", level: 1, resource: "note:\*" }
- { method: DELETE, path: "/notes/{id}", capability: "notes:delete", action-class: write-hard, level: 2,
resource: "note:{id}" }
templates:
"[notes:read]": Read your notes
"[notes:delete]": Delete note {scope}

```java
public static class Rate
```

A rate limit: at most `calls` calls per `per`.

```java
public int getCalls()
```



```java
public void setCalls(int calls)
```



```java
public Duration getPer()
```



```java
public void setPer(Duration per)
```



```java
public static class Org
```

Your organisation (ORG-1 §2).

```java
public String getLegalName()
```



```java
public void setLegalName(String legalName)
```



```java
public String getCountry()
```



```java
public void setCountry(String country)
```



```java
public String getWebsite()
```



```java
public void setWebsite(String website)
```



```java
public String getSupport()
```



```java
public void setSupport(String support)
```



```java
public String getPrivacyPolicy()
```



```java
public void setPrivacyPolicy(String privacyPolicy)
```



```java
public static class RouteProperties
```

One route (ABY-3 §4.1). The reference's other options are accepted here only to refuse them by name:
`nonce`, `mandate`, `require-link`, `authority`, `disclose`,
`disclose-optional` are not enforced by this SDK yet, so setting one fails the start.

```java
public String getMethod()
```



```java
public void setMethod(String method)
```



```java
public String getPath()
```



```java
public void setPath(String path)
```



```java
public String getCapability()
```



```java
public void setCapability(String capability)
```



```java
public String getActionClass()
```



```java
public void setActionClass(String actionClass)
```



```java
public Integer getLevel()
```



```java
public void setLevel(Integer level)
```



```java
public String getResource()
```



```java
public void setResource(String resource)
```



```java
public String getAmountField()
```



```java
public void setAmountField(String amountField)
```



```java
public String getCurrencyField()
```



```java
public void setCurrencyField(String currencyField)
```



```java
public String getAuthn()
```



```java
public void setAuthn(String authn)
```



```java
public Integer getTier()
```



```java
public void setTier(Integer tier)
```



```java
public Duration getMaxLifetime()
```



```java
public void setMaxLifetime(Duration maxLifetime)
```



```java
public String getLevelProfile()
```



```java
public void setLevelProfile(String levelProfile)
```



```java
public Boolean getQes()
```



```java
public void setQes(Boolean qes)
```



```java
public String getSummary()
```



```java
public void setSummary(String summary)
```



```java
public Boolean getNonce()
```



```java
public void setNonce(Boolean nonce)
```



```java
public Boolean getMandate()
```



```java
public void setMandate(Boolean mandate)
```



```java
public Boolean getRequireLink()
```



```java
public void setRequireLink(Boolean requireLink)
```



```java
public String getAccountParam()
```

The path parameter that names one of your accounts, for require-link (default `account`).

```java
public void setAccountParam(String accountParam)
```



```java
public Boolean getAuthority()
```



```java
public void setAuthority(Boolean authority)
```



```java
public List<String> getDisclose()
```



```java
public void setDisclose(List<String> disclose)
```



```java
public List<String> getDiscloseOptional()
```



```java
public void setDiscloseOptional(List<String> discloseOptional)
```



```java
public boolean isEnabled()
```



```java
public void setEnabled(boolean enabled)
```



```java
public String getOrigin()
```



```java
public void setOrigin(String origin)
```



```java
public String getNode()
```



```java
public void setNode(String node)
```



```java
public Org getOrg()
```



```java
public void setOrg(Org org)
```



```java
public List<RouteProperties> getRoutes()
```



```java
public void setRoutes(List<RouteProperties> routes)
```



```java
public Map<String, Object> getTemplates()
```



```java
public void setTemplates(Map<String, Object> templates)
```



```java
public List<String> getUnprotected()
```



```java
public void setUnprotected(List<String> unprotected)
```



```java
public Path getKeyFile()
```



```java
public void setKeyFile(Path keyFile)
```



```java
public int getRefreshSeconds()
```



```java
public void setRefreshSeconds(int refreshSeconds)
```



```java
public int getNodeMaxLevel()
```



```java
public void setNodeMaxLevel(int nodeMaxLevel)
```



```java
public String getTitle()
```



```java
public void setTitle(String title)
```



```java
public String getVersion()
```



```java
public void setVersion(String version)
```



```java
public String getDescription()
```



```java
public void setDescription(String description)
```



```java
public boolean isRfc9421()
```



```java
public void setRfc9421(boolean rfc9421)
```



```java
public boolean isNonce()
```



```java
public void setNonce(boolean nonce)
```



```java
public Map<String, Rate> getRate()
```



```java
public void setRate(Map<String, Rate> rate)
```



```java
public int getFilterOrder()
```



```java
public void setFilterOrder(int filterOrder)
```
