@agent-custody/receipts 0.16.6 → 0.16.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -9
- package/dist/capture.d.ts +2 -0
- package/dist/capture.js +13 -2
- package/dist/check.d.ts +1 -1
- package/dist/check.js +34 -10
- package/dist/cli.js +4 -2
- package/dist/config.d.ts +27 -2
- package/dist/config.js +66 -2
- package/dist/door-app.d.ts +28 -0
- package/dist/door-app.js +244 -0
- package/dist/door-partner.d.ts +66 -0
- package/dist/door-partner.js +94 -0
- package/dist/door.d.ts +139 -10
- package/dist/door.js +297 -137
- package/dist/gateway-http.d.ts +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/perathos.js +3 -2
- package/dist/receipt.d.ts +4 -1
- package/dist/verify.js +44 -4
- package/dist/web-bot-auth.d.ts +105 -0
- package/dist/web-bot-auth.js +508 -0
- package/docs/door-languages.md +168 -0
- package/docs/door-middleware.md +216 -0
- package/docs/door-quickstart.md +1 -1
- package/docs/door-signals.md +42 -5
- package/docs/door.md +124 -15
- package/docs/github-action.md +2 -2
- package/docs/perathos.md +13 -10
- package/docs/tutorials.md +4 -0
- package/docs/verification.md +2 -0
- package/package.json +7 -1
- package/vectors/audit.json +27 -27
- package/vectors/canonical.json +5 -5
- package/vectors/receipts.json +1701 -1210
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# The door in Go, Rails, Django, and Spring
|
|
2
|
+
|
|
3
|
+
> Middleware for sites that are not Node. Each is a client of [the door in authz mode](door.md#behind-nginx-or-envoy-authz-mode); the check it calls is in [the reference](../../../site/reference/door.md#authz-mode).
|
|
4
|
+
|
|
5
|
+
A Node site runs the door in its own process ([the door in your Node app](door-middleware.md)). A site in Go, Ruby on Rails, Django, or Spring keeps the door as a separate process in authz mode and asks it about each request from a middleware, the way nginx `auth_request` asks it. The door classifies the arrival, runs the Cedar policy for its route, commits a request that can change something to the log, writes the receipt, and answers 200 or a refusal. The middleware runs your code only on the 200.
|
|
6
|
+
|
|
7
|
+
Four clients, standard library only, each a file to copy into your project:
|
|
8
|
+
|
|
9
|
+
| framework | file | what it is |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| Go `net/http` | [examples/languages/door/go/door.go](../examples/languages/door/go/door.go) | `Door(doorURL, timeout) func(http.Handler) http.Handler` |
|
|
12
|
+
| Rails, or any Rack app | [examples/languages/door/ruby/agent_custody_door.rb](../examples/languages/door/ruby/agent_custody_door.rb) | `AgentCustody::Door`, a Rack middleware |
|
|
13
|
+
| Django, or any WSGI app | [examples/languages/door/python/agent_custody_door.py](../examples/languages/door/python/agent_custody_door.py) | `DoorMiddleware` (Django) and `DoorWSGI` (WSGI) |
|
|
14
|
+
| Spring, or the JDK `HttpServer` | [examples/languages/door/java/CustodyDoor.java](../examples/languages/door/java/CustodyDoor.java), [CustodyDoorFilter.java](../examples/languages/door/java/CustodyDoorFilter.java) | `CustodyDoor`, a `java.net.http` client, and a `com.sun.net.httpserver.Filter`; the Spring filter is [a snippet below](#spring) |
|
|
15
|
+
|
|
16
|
+
## Why authz mode, and not the sidecar
|
|
17
|
+
|
|
18
|
+
The sidecar (`agent-custody serve`) is the SDK for agents in other languages: an agent's process tells it about its own tool calls, and it records them as `claimed`. A site's middleware is on the other side. It needs the door's decision about a request it received: the arrival classified by the grant or Web Bot Auth signature it presented, the route matched, the Cedar policy run with the door's arrival fact, a POST committed to the log before the app runs, and a receipt with `issuer.kind: "door"`. The door's authz check does all of that already, for nginx and Envoy, so each middleware is a client of that check and nothing in the door changed.
|
|
19
|
+
|
|
20
|
+
## Run the door
|
|
21
|
+
|
|
22
|
+
The door config for authz mode: no `origin`, `"authz": true`, and `"trustProxy": true`, which authz mode requires; the middleware is the proxy.
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"identity": { "keyFile": "keys/door.key" },
|
|
27
|
+
"authz": true,
|
|
28
|
+
"trustProxy": true,
|
|
29
|
+
"routes": [
|
|
30
|
+
{ "name": "catalogue", "methods": ["GET"], "path": "/catalogue/*" },
|
|
31
|
+
{ "name": "refund", "methods": ["POST"], "path": "/refunds" }
|
|
32
|
+
],
|
|
33
|
+
"trustedPrincipalKeys": ["keys/principal.pub"],
|
|
34
|
+
"policyFile": "policy.cedar",
|
|
35
|
+
"receiptsDir": "receipts",
|
|
36
|
+
"logFile": "log.jsonl"
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```cedar
|
|
41
|
+
permit(principal, action == Action::"catalogue", resource);
|
|
42
|
+
permit(principal, action == Action::"refund", resource) when { context.facts.arrival.class == "verified" };
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx agent-custody door --config door.json --port 8780
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The door believes what the middleware tells it, so let only the app reach it: bind it to loopback on the app's host (the default) or to a private network. Anyone who can reach the door can have it write receipts for requests that never happened.
|
|
50
|
+
|
|
51
|
+
## What every client does
|
|
52
|
+
|
|
53
|
+
For each request, before your code runs, the middleware sends the door a `GET <door>/_agent_custody` with:
|
|
54
|
+
|
|
55
|
+
- `X-Original-Method` and `X-Original-URI`: the request's method, and its path and query as the client sent them (the raw target where the framework keeps one, else the path re-encoded).
|
|
56
|
+
- `X-Forwarded-For`: the address the framework reports for the request (`RemoteAddr`, `REMOTE_ADDR`, `getRemoteAddr()`). The middleware sets all three itself; a client's own copies are never forwarded.
|
|
57
|
+
- Every other header of the request, the client's `Host` included, except the hop-by-hop fields and `Content-Length`, `Transfer-Encoding`, and `Expect`: the check has no body. This is what nginx `auth_request` sends. The door reads the grant (`X-Agent-Custody-Grant`, or `Authorization: Bearer`), `X-Agent-Custody-Agent`, the Web Bot Auth fields, the challenge header, and the `Host`, `User-Agent`, `Accept`, and `Content-Type` it records.
|
|
58
|
+
|
|
59
|
+
Then:
|
|
60
|
+
|
|
61
|
+
| the door | the middleware |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| 200 with `X-Agent-Custody-Receipt` | runs your code. The request has the door's `X-Agent-Custody-Receipt` and `X-Agent-Custody-Class` in place of any the client sent, and no `X-Agent-Custody-Grant` or `X-Agent-Custody-Agent`. The response gets the receipt and class headers, and `X-Agent-Custody-Log-Pending` when the door sent it |
|
|
64
|
+
| any other status: 403 refused, 400, 503 when the log would not commit a POST, 500 | answers with the door's status, body, `Content-Type`, `Retry-After`, and receipt headers. Your code does not run |
|
|
65
|
+
| cannot be reached, no answer within the timeout (5 seconds by default), or a 200 without a receipt | answers 503 `{"error": "not passed on: ..."}`. Your code does not run, and there is no receipt: nothing was decided |
|
|
66
|
+
|
|
67
|
+
The request body stays where it is: the door never reads it, and your code reads it as it would without the middleware.
|
|
68
|
+
|
|
69
|
+
## Go
|
|
70
|
+
|
|
71
|
+
```go
|
|
72
|
+
http.ListenAndServe("127.0.0.1:8080", Door("http://127.0.0.1:8780", 5*time.Second)(mux))
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`door.go` is `package main`; rename the package when you copy it. The handler gets a clone of the request with the door's headers; the client's `Host` goes to the door as `Host`.
|
|
76
|
+
|
|
77
|
+
## Rails
|
|
78
|
+
|
|
79
|
+
`config/application.rb`, with `agent_custody_door.rb` in `lib/`:
|
|
80
|
+
|
|
81
|
+
```ruby
|
|
82
|
+
require_relative "../lib/agent_custody_door"
|
|
83
|
+
config.middleware.insert_before 0, AgentCustody::Door, door_url: ENV.fetch("AGENT_CUSTODY_DOOR_URL"), timeout: 5
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
First in the stack, so that no other middleware acts on a request the door refuses. Any Rack app takes it the same way: `use AgentCustody::Door, door_url: "http://127.0.0.1:8780"` in `config.ru`. The app reads the door's headers as `request.headers["X-Agent-Custody-Receipt"]` (Rails) or `env["HTTP_X_AGENT_CUSTODY_RECEIPT"]` (Rack).
|
|
87
|
+
|
|
88
|
+
## Django
|
|
89
|
+
|
|
90
|
+
`settings.py`, with `agent_custody_door.py` on the path and `AGENT_CUSTODY_DOOR_URL` (and optionally `AGENT_CUSTODY_DOOR_TIMEOUT`, in seconds) in the environment:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
MIDDLEWARE = [
|
|
94
|
+
"agent_custody_door.DoorMiddleware",
|
|
95
|
+
# ...the rest, after the door
|
|
96
|
+
]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
A view reads `request.headers["X-Agent-Custody-Receipt"]`. For a WSGI app, or to put the door in front of all of Django in `wsgi.py`:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from agent_custody_door import DoorWSGI
|
|
103
|
+
application = DoorWSGI(get_wsgi_application(), "http://127.0.0.1:8780")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The timeout applies to each socket operation of the check (`urllib`), not to the check as a whole.
|
|
107
|
+
|
|
108
|
+
## Spring
|
|
109
|
+
|
|
110
|
+
`CustodyDoor` is the client, JDK only. Start the JVM with `-Djdk.httpclient.allowRestrictedHeaders=host`: `java.net.http` refuses to send a `Host` of the caller's choosing without it, and the door checks a Web Bot Auth signature against the client's `Host`. The constructor throws without the flag rather than send the door its own address. A request without a `User-Agent` is checked with an empty one, because `java.net.http` sends its own when the field is absent.
|
|
111
|
+
|
|
112
|
+
For the JDK's own server, `context.getFilters().add(new CustodyDoorFilter(door))`. For Spring MVC or Spring Boot, a servlet filter around the same client:
|
|
113
|
+
|
|
114
|
+
```java
|
|
115
|
+
@Component
|
|
116
|
+
@Order(Ordered.HIGHEST_PRECEDENCE)
|
|
117
|
+
public class CustodyDoorSpringFilter extends OncePerRequestFilter {
|
|
118
|
+
private final CustodyDoor door = new CustodyDoor(URI.create(System.getenv("AGENT_CUSTODY_DOOR_URL")), Duration.ofSeconds(5));
|
|
119
|
+
|
|
120
|
+
@Override
|
|
121
|
+
protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res, FilterChain chain) throws ServletException, IOException {
|
|
122
|
+
Map<String, List<String>> headers = new LinkedHashMap<>();
|
|
123
|
+
for (String name : Collections.list(req.getHeaderNames())) headers.put(name, Collections.list(req.getHeaders(name)));
|
|
124
|
+
String target = req.getRequestURI() + (req.getQueryString() == null ? "" : "?" + req.getQueryString());
|
|
125
|
+
CustodyDoor.Verdict v = door.check(req.getMethod(), target, headers, req.getRemoteAddr());
|
|
126
|
+
v.doorHeaders().forEach(res::setHeader);
|
|
127
|
+
if (!v.allowed()) {
|
|
128
|
+
res.setStatus(v.status());
|
|
129
|
+
if (v.contentType() != null) res.setContentType(v.contentType());
|
|
130
|
+
res.getOutputStream().write(v.body());
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
TreeMap<String, List<String>> admitted = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
|
|
134
|
+
admitted.putAll(headers);
|
|
135
|
+
CustodyDoor.DOOR_ONLY.forEach(admitted::remove);
|
|
136
|
+
admitted.put(CustodyDoor.RECEIPT, List.of(v.receipt()));
|
|
137
|
+
admitted.put(CustodyDoor.CLASS, List.of(v.arrivalClass()));
|
|
138
|
+
chain.doFilter(new HttpServletRequestWrapper(req) {
|
|
139
|
+
@Override public String getHeader(String name) { List<String> l = admitted.get(name); return l == null || l.isEmpty() ? null : l.get(0); }
|
|
140
|
+
@Override public Enumeration<String> getHeaders(String name) { return Collections.enumeration(admitted.getOrDefault(name, List.of())); }
|
|
141
|
+
@Override public Enumeration<String> getHeaderNames() { return Collections.enumeration(admitted.keySet()); }
|
|
142
|
+
}, res);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**This snippet is not compiled or run by the test suite**, which has no Spring or servlet jars. What the suite runs is `CustodyDoor` and `CustodyDoorFilter` under the JDK's `HttpServer`; the Spring filter calls the same `check` with the servlet request's method, raw URI and query, headers, and remote address.
|
|
148
|
+
|
|
149
|
+
## What the tests run
|
|
150
|
+
|
|
151
|
+
`test/door-languages.test.ts` starts a door in authz mode as its own process and runs each example: [Go](../examples/languages/door/go/main.go) (`go run .`), [Ruby](../examples/languages/door/ruby/main.rb) (`ruby main.rb`), [Python](../examples/languages/door/python/main.py) (`python3 main.py`), and [Java](../examples/languages/door/java/DoorExample.java) (`javac`, then `java` with the `Host` flag). A missing toolchain skips its language, visibly. Each example checks, and prints `OK` only after:
|
|
152
|
+
|
|
153
|
+
1. A public read with a forged `X-Agent-Custody-Receipt` and `X-Forwarded-For`: allowed, and the app sees the door's receipt, which equals the one on the response.
|
|
154
|
+
2. An unknown arrival's refund that also sends its own `X-Original-Method: GET` and `X-Original-URI: /catalogue/free`: 403 with the door's body, and the app does not run.
|
|
155
|
+
3. A verified agent's refund with a passport: allowed, the app gets the body, the receipt, and class `verified`, and not the grant.
|
|
156
|
+
4. A door that is down and a door that accepts the connection and never answers: 503, and the app does not run.
|
|
157
|
+
|
|
158
|
+
The test then reads each receipt the example printed from the door's directory and requires that it verifies, that the allowed read recorded the original path, query, `Host`, and `User-Agent` and not the forged address, that the refused refund was decided as a POST to the refund route, and that the verified refund's authorization was in the log before the 200.
|
|
159
|
+
|
|
160
|
+
The frameworks are not installed in the test suite and there is no network to install them. Go's middleware is the `net/http` interface itself, called through `ServeHTTP`. The Rack middleware is called with a Rack env, as Rails and every Rack server call it. `DoorWSGI` runs under `wsgiref` over a real socket. `DoorMiddleware` is called as Django's handler calls it, with a request that carries only `method` and `META` and a stand-in for `django.http.HttpResponse`. The JDK filter runs under the JDK's `HttpServer` over a real socket. The Spring filter is not run.
|
|
161
|
+
|
|
162
|
+
## What the receipts record, and what they do not
|
|
163
|
+
|
|
164
|
+
Everything that [authz mode](door.md#behind-nginx-or-envoy-authz-mode) records, and nothing more: `issuer.framework` is `authz`, an allow is `withheld` (the door decided, and the middleware, not the door, ran your code), a refusal is `denied`, and no receipt carries the body or your app's answer. A policy rule on `context.args.body` errors and denies, so a rule on an amount belongs in your code.
|
|
165
|
+
|
|
166
|
+
- **The address is the one the framework reports.** Behind a load balancer it is the balancer's, and the door's `rate` signal counts every arrival through it as one source. Pass the client's address yourself (the value your framework trusts after its own proxy settings) if that matters to a policy.
|
|
167
|
+
- **The door's word is trusted.** An allow receipt shows that the door allowed the request, not that the app ran it.
|
|
168
|
+
- **Not covered:** a request your framework answers before the middleware runs (a static file served by the web server, a route mounted outside the middleware stack).
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# The door in your Node app
|
|
2
|
+
|
|
3
|
+
> How to run it and what it records. Every export and header is in [the reference](../../../site/reference/door.md#in-process).
|
|
4
|
+
|
|
5
|
+
[The door](door.md) is a reverse proxy: it stands in front of your site and relays what the policy allows. A Node site can run the same decision loop inside its own process instead. Express takes it as middleware, `app.use(door("door.json"))`. A Next.js App Router route takes it as a wrapper around the route's handler, `export const POST = guard.route(handler)`.
|
|
6
|
+
|
|
7
|
+
The decision is the proxy's own, from the same code: the arrival is classified (`verified`, `claimed`, or `unknown`, with a [Web Bot Auth signature](door.md#web-bot-auth-signatures) checked when the config has `webBotAuth`), its body is read up to `maxBodyBytes`, the Cedar policy for its route decides, a request that can change something is committed to the log before your code runs, and every arrival gets a signed, logged receipt with `issuer.kind: "door"`. A refused arrival gets the same answer the proxy gives (403 with the reason, 413, 503, 400), and your code never runs for it.
|
|
8
|
+
|
|
9
|
+
Use the proxy when the site is not Node, when you cannot change its code, or when you want the door in a separate process from the app. Use the in-process door when the site is Express or Next.js and you would rather not run and secure a second process. A site in Go, Rails, Django, or Spring can keep the door in a separate process and ask it from a middleware instead: [the door in Go, Rails, Django, and Spring](door-languages.md).
|
|
10
|
+
|
|
11
|
+
## The config
|
|
12
|
+
|
|
13
|
+
The proxy's `door.json` without `origin`: there is nothing to relay to, because an allowed request goes on to your own code. The in-process door refuses a config that names an origin, and the proxy refuses one that does not. `maxResponseBytes` does nothing here: the app's answer streams to the client as it would without the door and is hashed as it goes, never held. Every other field means what [the reference](../../../site/reference/door.md#config) says, and `agent-custody check --config door.json` checks the file.
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"identity": { "keyFile": "keys/door.key" },
|
|
18
|
+
"routes": [
|
|
19
|
+
{ "name": "page", "methods": ["GET"], "path": "/" },
|
|
20
|
+
{ "name": "refund", "methods": ["POST"], "path": "/api/refunds" }
|
|
21
|
+
],
|
|
22
|
+
"trustedPrincipalKeys": ["keys/principal.pub"],
|
|
23
|
+
"policyFile": "policy.cedar",
|
|
24
|
+
"receiptsDir": "receipts",
|
|
25
|
+
"logFile": "log.jsonl"
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick start: the parts both frameworks share
|
|
30
|
+
|
|
31
|
+
You need Node 22 or later and `curl`. The in-process door is in `@agent-custody/receipts` from 0.16.7.
|
|
32
|
+
|
|
33
|
+
The door signs every receipt with its own key. The principal key belongs to whoever vouches for an agent: it signs the agent's passport, and the door trusts what it signs. Run these in the app's directory, after the framework step below has created it:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx agent-custody keygen --dir keys --name door
|
|
37
|
+
npx agent-custody keygen --dir keys --name principal
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`policy.cedar`. The page is public; a refund needs an agent with a passport, for a positive amount of at most 5000 (minor units, since Cedar has no decimals):
|
|
41
|
+
|
|
42
|
+
```cedar
|
|
43
|
+
permit(principal, action == Action::"page", resource);
|
|
44
|
+
|
|
45
|
+
permit(principal, action == Action::"refund", resource)
|
|
46
|
+
when {
|
|
47
|
+
context.facts.arrival.class == "verified" &&
|
|
48
|
+
context.args.body.amount > 0 &&
|
|
49
|
+
context.args.body.amount <= 5000
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`door.json` is the config above. Keep `keys/`, `receipts/`, and `log.jsonl` out of git.
|
|
54
|
+
|
|
55
|
+
## Express
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
mkdir shop && cd shop
|
|
59
|
+
npm init -y
|
|
60
|
+
npm install express @agent-custody/receipts
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Then the keys, `policy.cedar`, and `door.json` from above, and `server.mjs`:
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
import express from "express";
|
|
67
|
+
import { door } from "@agent-custody/receipts/door";
|
|
68
|
+
|
|
69
|
+
const app = express();
|
|
70
|
+
app.use(door("door.json")); // first: before the body parsers and the routes
|
|
71
|
+
app.use(express.json());
|
|
72
|
+
app.get("/", (req, res) => res.send(`hello, ${req.get("x-agent-custody-class")} visitor\n`));
|
|
73
|
+
app.post("/api/refunds", (req, res) => res.json({ refunded: req.body.amount }));
|
|
74
|
+
app.listen(3000, "127.0.0.1");
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
node server.mjs &
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Put the door before the body parsers. It reads the body to decide, then hands the same bytes to whatever reads the request after it, so `express.json()`, `express.urlencoded()`, a multipart parser, or `for await (const chunk of req)` see what the policy saw. A parser that runs before the door leaves it nothing to read: the policy then sees an empty body.
|
|
82
|
+
|
|
83
|
+
## Next.js (App Router)
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npx create-next-app@latest shop --yes
|
|
87
|
+
cd shop
|
|
88
|
+
npm install @agent-custody/receipts
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Then the keys, `policy.cedar`, and `door.json` from above, in the project's root. Three files; `create-next-app --yes` puts `app/` in the root (under `src/` if you chose that layout).
|
|
92
|
+
|
|
93
|
+
`next.config.ts`: add `serverExternalPackages`, and keep what `create-next-app` put there. The door loads Cedar's WebAssembly and reads its key and policy from disk, so Next must load the package with Node rather than bundle it; without this line every wrapped route answers 500 with `ENOENT ... cedar_wasm_bg.wasm`.
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
const nextConfig: NextConfig = {
|
|
97
|
+
serverExternalPackages: ["@agent-custody/receipts"],
|
|
98
|
+
// ...the options create-next-app wrote stay as they are
|
|
99
|
+
};
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`lib/door.ts`, one door for the process, which every wrapped route shares:
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import { join } from "node:path";
|
|
106
|
+
import { door } from "@agent-custody/receipts/door";
|
|
107
|
+
|
|
108
|
+
export const guard = door(join(process.cwd(), "door.json"));
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`app/api/refunds/route.ts`:
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
import { guard } from "@/lib/door";
|
|
115
|
+
|
|
116
|
+
export const POST = guard.route(async (req: Request) => {
|
|
117
|
+
const { amount } = await req.json();
|
|
118
|
+
return Response.json({ refunded: amount });
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npm run dev
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The handler gets the request Next made, a `NextRequest` with `nextUrl` and `cookies`, with the door's headers set and the grant removed, and reads its body as it would without the door. Route handlers run in Node by default; the door does not run in the Edge runtime.
|
|
127
|
+
|
|
128
|
+
This quick start was run on a fresh `create-next-app@latest` (Next.js 16.4.6, Turbopack, Cache Components on) under `next dev`, and after `next build` under `next start`, with the package installed from a tarball of this repository. From `create-next-app` to a verified receipt took 76 seconds of machine time, most of it `create-next-app` and `npm install`; the time to read the page and type the five files is yours to add.
|
|
129
|
+
|
|
130
|
+
## Try it
|
|
131
|
+
|
|
132
|
+
The same requests work against either app on port 3000; the output below is the Express app's, and the Next.js route answered the same. An unknown arrival asks for a refund and is refused before your code runs:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
curl -si -X POST http://127.0.0.1:3000/api/refunds -H 'content-type: application/json' -d '{"amount":1000}'
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
HTTP/1.1 403 Forbidden
|
|
140
|
+
x-agent-custody-receipt: 06db4beb-0525-4069-9a26-2dab0fd2010d
|
|
141
|
+
x-agent-custody-class: unknown
|
|
142
|
+
|
|
143
|
+
{"error":"refused by the door's policy","reason":"no permit policy matched","receipt":"06db4beb-0525-4069-9a26-2dab0fd2010d"}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The principal signs a passport for its agent, scoped to the refund route, and the agent sends it:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
npx agent-custody grant --key keys/principal.key --principal shop-owner --agent shopping-agent --scopes refund --out grant.json
|
|
150
|
+
PASSPORT=$(node -e 'process.stdout.write(Buffer.from(require("fs").readFileSync("grant.json","utf8")).toString("base64url"))')
|
|
151
|
+
curl -si -X POST http://127.0.0.1:3000/api/refunds -H 'content-type: application/json' -H "x-agent-custody-grant: $PASSPORT" -d '{"amount":4500}'
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
HTTP/1.1 200 OK
|
|
156
|
+
x-agent-custody-receipt: bed5bf0b-958e-48cb-806d-2bbb92b937c1
|
|
157
|
+
x-agent-custody-class: verified
|
|
158
|
+
|
|
159
|
+
{"refunded":4500}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Verify the agent's receipt with public keys only:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npx agent-custody verify receipts/bed5bf0b-958e-48cb-806d-2bbb92b937c1.json --issuer-key keys/door.pub --principal-key keys/principal.pub --log log.jsonl
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
```text
|
|
169
|
+
PASS issuer kind is known (door / node-middleware)
|
|
170
|
+
PASS delegation signature (principal key) (signed by f3c85fd65a70)
|
|
171
|
+
PASS executed tool within delegated scope (refund)
|
|
172
|
+
PASS policy decision consistent with execution (allow -> executed)
|
|
173
|
+
PASS authorization logged before execution (authorization leaf 2, receipt leaf 3)
|
|
174
|
+
PASS log inclusion proof (leaf 3 of 4, root 9c8b6f262453)
|
|
175
|
+
|
|
176
|
+
RESULT: VERIFIED
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The refund was in the log before your handler ran. The output is cut to the lines that matter; the full report lists every check. Your receipt ids differ; take them from the `x-agent-custody-receipt` headers. The output above is from the Express app, run from this repository at the commit that added the in-process door, with the headers cut to the door's; a Next.js route's receipt says `door / fetch-route`.
|
|
180
|
+
|
|
181
|
+
## What your code receives
|
|
182
|
+
|
|
183
|
+
An allowed request reaches your code with:
|
|
184
|
+
|
|
185
|
+
- `X-Agent-Custody-Receipt`: the receipt id, and `X-Agent-Custody-Class`: `verified`, `claimed`, or `unknown`. The door sets both; a client that sends either has its value replaced.
|
|
186
|
+
- No grant: `X-Agent-Custody-Grant` is removed, and so is `Authorization` when it carried the grant. `X-Agent-Custody-Agent` and the challenge header are removed too. In Express they leave `req.headers` and `req.rawHeaders` both.
|
|
187
|
+
- The body the door read, unchanged.
|
|
188
|
+
|
|
189
|
+
The door does not touch the client-address headers (`X-Forwarded-For`, `X-Real-IP`, and the rest) as the proxy does: in-process, your app reads the socket itself, and what it trusts is its own setting (`app.set("trust proxy")` in Express).
|
|
190
|
+
|
|
191
|
+
The answer your code gives goes back as it is, with `X-Agent-Custody-Receipt` and `X-Agent-Custody-Class` added.
|
|
192
|
+
|
|
193
|
+
## What the receipt records of your answer, and what it does not
|
|
194
|
+
|
|
195
|
+
| | Express | Next.js route handler |
|
|
196
|
+
| --- | --- | --- |
|
|
197
|
+
| status | `res.statusCode` when the response finished; 5xx is `failed`, anything else `executed` | the `Response` status; 5xx is `failed` |
|
|
198
|
+
| body | `bodyBytes` and `bodyDigest` (sha256) of every byte the app wrote through `res.write` and `res.end`, after any middleware registered later (a `compression()` after the door: the compressed bytes); not the chunked framing | `bodyBytes` and `bodyDigest` of the `Response` body, hashed on a second branch of the stream while the first goes to the client |
|
|
199
|
+
| content type | the `Content-Type` header the app set | the `Response`'s `Content-Type` |
|
|
200
|
+
| the app failed partway | the connection closed before the response finished: `error`, "the app may have acted on the request" | the handler threw: `error` with its message, and the throw goes on to Next; the body stream failed: `error` with the bytes read so far |
|
|
201
|
+
| when the receipt is written | after the response finished | after the body stream ended |
|
|
202
|
+
|
|
203
|
+
What is not recorded, or not the same as the proxy:
|
|
204
|
+
|
|
205
|
+
- **The receipt of an allowed request is written after the answer has gone.** The answer cannot say whether the log took the receipt, so there is no `X-Agent-Custody-Log-Pending` on it (a receipt the log refused waits in `receipts/outbox/` and is appended later, as for the proxy). If the receipt cannot be written at all, the client already has the app's answer: the door prints the failure on stderr, where the proxy would have answered 500. The authorization of a refund, written before your code ran, is on disk either way.
|
|
206
|
+
- **The response headers** other than `Content-Type`, as for the proxy.
|
|
207
|
+
- **Next.js pages, Server Actions, and the `middleware.ts` / `proxy.ts` file are not covered.** Only the route handlers you wrap are decided and receipted. Next's middleware runs before the route and cannot see its answer, so a receipt from it could not say what the app did; the door does not offer one. A `GET` handler that Next prerenders at build time (`export const dynamic = "force-static"`) runs at build time, not per request: do not wrap one.
|
|
208
|
+
- **A signature on a fetch request.** A Web Bot Auth signature is checked over the request as the route handler gets it: a field sent more than once arrives joined with `, `, and a `Request` built without a `Host` field takes its authority from its URL. In Express the door reads every value of each field, as the proxy does.
|
|
209
|
+
- **The arrival's address in Next.js.** A route handler gets no socket. Without `trustProxy` the arrival's `remote` is `unknown`, and the `rate` signal counts every unknown arrival as one source. Behind a proxy you run, or on a host that sets `X-Forwarded-For` (Vercel does), set `trustProxy: true` and the door takes the last address in it.
|
|
210
|
+
- **A refused request's body in Express.** For an arrival the door refuses, the body is read up to `maxBodyBytes` and the rest drained, as by the proxy; nothing after the door runs.
|
|
211
|
+
|
|
212
|
+
## Why Express and Next.js are not dependencies
|
|
213
|
+
|
|
214
|
+
`@agent-custody/receipts/door` imports neither framework, and neither is a dependency or a peer dependency of the package. The middleware is typed on `node:http`'s `IncomingMessage` and `ServerResponse`, which an Express request and response extend, so it fits Express, Connect, or a plain `http.createServer`; the tests run it under Express 5 only. The wrapper is typed on the fetch `Request` and `Response`, which a `NextRequest` extends, and keeps the handler's own parameter types, so Next's route type check sees the handler it expects. A peer dependency would only add an install warning for every user of the gateway or the SDK, who has neither framework, and tie each release to a framework version range the door does not need. The repository's tests run the middleware under Express 5.2.1, a devDependency only, and the wrapper with plain fetch `Request` objects.
|
|
215
|
+
|
|
216
|
+
Tutorial: [48-door-app.ts](../examples/48-door-app.ts).
|
package/docs/door-quickstart.md
CHANGED
|
@@ -194,5 +194,5 @@ Stop the door and the stand-in site with `kill %1 %2`.
|
|
|
194
194
|
- **Use your own Turnstile keys.** Put the widget on the page that posts the form, set `siteKey`, the secret in `TURNSTILE_SECRET`, and `hostnames` to your site's hosts. A token serves one request, so the page takes a new one for each submit ([challenging a human](door.md#what-the-door-knows-about-an-arrival)).
|
|
195
195
|
- **Make the door the only way in.** A request that reaches your site some other way leaves no receipt. Bind the site to a private address, or have it require a header that only the door adds (`origin.headerEnv`).
|
|
196
196
|
- **Behind your own TLS proxy,** set `trustProxy` so the door reads the client's address, not the proxy's.
|
|
197
|
-
- **A passport is bearer-grade.** The door checks its signature, window, and scope, not that the sender holds the agent's key. Keep the time to live short.
|
|
197
|
+
- **A passport alone is bearer-grade.** The door checks its signature, window, and scope, not that the sender holds the agent's key. Keep the time to live short. An agent that also signs its requests per Web Bot Auth, with `webBotAuth` configured, binds the passport to itself: see [Web Bot Auth signatures](door.md#web-bot-auth-signatures).
|
|
198
198
|
- **Read [the door](door.md)** for every field of the config, and [door signals](door-signals.md) for what each fact about an arrival does and does not establish, before you write a policy for a route that matters.
|
package/docs/door-signals.md
CHANGED
|
@@ -12,21 +12,39 @@ Three labels run through the table:
|
|
|
12
12
|
|
|
13
13
|
| signal | label | what it means | what it does not mean |
|
|
14
14
|
| --- | --- | --- | --- |
|
|
15
|
-
| `class: "verified"` | checked | A grant signed by a principal in `trustedPrincipalKeys`, inside its validity window, names this agent and lists this arrival's route among its scopes. The Cedar `principal` is that agent | That the agent is well-behaved, that the principal is who they say they are beyond holding the key, or that the request body is what the principal intended. The grant has no revocation list: it stands until it expires |
|
|
16
|
-
| `class: "claimed"` | a claim | Something was asserted that the door could not accept: a grant from a key it does not trust, an expired one, one for other routes, a declared agent name, or
|
|
15
|
+
| `class: "verified"` | checked | A grant signed by a principal in `trustedPrincipalKeys`, inside its validity window, names this agent and lists this arrival's route among its scopes. Or, with no grant, a Web Bot Auth signature checked against the key its signature agent's directory publishes, and the agent is that origin. The Cedar `principal` is that agent | That the agent is well-behaved, that the principal is who they say they are beyond holding the key, or that the request body is what the principal intended. The grant has no revocation list: it stands until it expires. A grant alone is bearer-grade: `signature` says whether the sender also proved it holds the agent's key |
|
|
16
|
+
| `class: "claimed"` | a claim | Something was asserted that the door could not accept: a grant from a key it does not trust, an expired one, one for other routes, one presented under another agent's signature, a declared agent name, or a signature that did not verify or was not checked. `grant`, `grantError`, `signature`, and `signatureError` say which | That the arrival is an agent, or that it is hostile. A misconfigured client, a grant for the wrong route, and an impostor all look the same here |
|
|
17
17
|
| `class: "unknown"` | observed | Nothing was presented | That the arrival is a person. A browser, a crawler, and a script that sends no headers are all `unknown`. There is no `human` class, and a policy that admits `unknown` on a route admits everything on that route |
|
|
18
18
|
| `grant: "verified"` | checked | As `class: "verified"` | |
|
|
19
19
|
| `grant: "out-of-scope"` | checked | The grant verified and is valid, but this route is not among its scopes. `subject` is the agent it names | That the agent may do anything here. The principal did not grant this route |
|
|
20
20
|
| `grant: "invalid"` | checked | The grant did not verify against a trusted key, did not decode, or is outside its window. `grantError` says which | Who signed it. A grant from an untrusted principal is `invalid` even when it is genuine |
|
|
21
|
+
| `grant: "wrong-sender"` | checked | The grant verified and is in scope, and the request is signed, verifiably, by a signature agent the grant does not name. The arrival is `claimed` | Which of the two is lying. The grant was handed on or taken; the door does not admit it as the agent it names |
|
|
21
22
|
| `grant: "absent"` | observed | No grant header | |
|
|
22
|
-
| `subject` | checked only when `class` is `verified` | The agent a verified grant names; else the declared name or the agent a rejected grant named; else `unknown` | For a `claimed` arrival, anything. It is recorded so the receipt shows what was asserted; the Cedar `principal` is `Agent::"unknown"` for it |
|
|
23
|
+
| `subject` | checked only when `class` is `verified` | The agent a verified grant names; else the signature agent of a verified signature; else the declared name or the agent a rejected grant named; else `unknown` | For a `claimed` arrival, anything. It is recorded so the receipt shows what was asserted; the Cedar `principal` is `Agent::"unknown"` for it |
|
|
23
24
|
| `declared` | a claim | The `x-agent-custody-agent` header, as sent, cut at 200 characters | That the agent is that agent. Anyone can send the header. A permit on a declared name admits whoever types it |
|
|
24
|
-
| `signature:
|
|
25
|
+
| `signature: "verified"` | checked, against the agent's directory | An RFC 9421 signature tagged `web-bot-auth`, Ed25519, covering `@authority` (one of `authorities`) and the `Signature-Agent` member, made at most `maxAgeSeconds` ago, with a nonce not seen before, verified with the key whose thumbprint is its keyid in the directory the door fetched over https from the `Signature-Agent` origin, an origin listed in `agents`. `signatureAgent` and `signatureKeyid` name the agent and the key. With a grant for the same agent, the grant is bound to its sender | That the body, the method, or the path is what the agent sent, unless the signature covers them (a minimal one covers the authority only), that the origin is a crawler you know or behaves well, or that a second door has not seen the nonce. The directory's own response signatures are not checked |
|
|
26
|
+
| `signature: "invalid"` | checked | A signature arrived and one check failed: no `web-bot-auth` tag, a missing parameter, an algorithm other than Ed25519, a component not covered or not supported, an agent not in `agents` or not https, outside the window, another authority, a repeated nonce, a redirect or a bad directory, a key not in it, or a signature that does not verify. `signatureError` says which | That the arrival is hostile. A clock off by more than `clockSkewSeconds` and a forgery both land here |
|
|
27
|
+
| `signature: "unavailable"` | observed | The directory did not answer in time or answered a non-200, or the door's nonce memory is full | Anything about the arrival. It is the network's or the door's state, like a challenge's `unavailable`; a policy that wants the agent through during a directory outage needs a grant as well |
|
|
28
|
+
| `signature: "unchecked"` | a claim | A `Signature-Input` arrived, and the door has no `webBotAuth` config | That the signature is valid, or who signed |
|
|
29
|
+
| `signature: "absent"` | observed | No signature headers | |
|
|
25
30
|
| `remote` | observed | The socket's address, or with `trustProxy` the last address in `X-Forwarded-For`, the one your proxy appended | Who the person or program is. One address serves a whole office, a mobile carrier, or a cloud region; one program can use many |
|
|
26
31
|
| `challenge.outcome` | checked, against the provider | Only when `challenge` is configured. `passed`: Turnstile or hCaptcha confirmed the token this arrival sent, so the provider judged a person present when the token was made. `failed`: the provider refused the token itself (bad, expired, or already used; `error` carries the codes), the token was issued on a hostname not in `hostnames` or for another action, or it was too long to be a token. `unavailable`: the provider did not answer in time, answered a non-200, a redirect, or something that is not JSON, reported a fault of its own or of the operator's (a wrong or rotated secret, a site key that does not match it), or too many checks were already waiting, which is the provider's or the door's state, not the arrival's. `absent`: no token | That the arrival is a person now, or that the person is who they say: a token is made once and sent by whatever holds it, and the provider's own error rate applies. It does not change `class`. `unavailable` is not `failed`: a policy that treats it as one locks everyone out when the provider is down, and one that treats it as a pass admits everyone; say which, on purpose |
|
|
27
32
|
| `rate.burst`, `rate.minute` | checked | Arrivals from the same source in the last 10 and 60 seconds, this one included, whatever the policy decided about them, counted by this door process on a monotonic clock, so a step of the wall clock does not move the windows. `rate.by` says what the source is: `agent`, the verified agent's name, or `remote`, the address | That the source is a program, or that it is abusive. Twenty arrivals a minute is one page load for a site that fans out to its API, and one agent on a job. The count is one process's memory: it starts at one when the door starts, two doors do not share it, and an address shared by many people counts them together. It keeps at most 10,000 sources and forgets the least recently seen first, so a client that sends from many new addresses can make another source's count start again |
|
|
33
|
+
| `partner.outcome` | checked, against the engine's key | Only when `partner` is configured and the route is in `partner.routes`. `verified`: the partner engine answered with a verdict whose signature verified under `partner.keyFile` and binds this receipt and route; the verdict is then the `partner` fact (below). `rejected`: the engine answered, and it was not a verdict signed for this arrival: a signature by another key, one for another receipt or route, a verdict of another engine, a malformed verdict, or an envelope carrying more than the attestation (`error` says which). `unavailable`: no answer within `timeoutMs`, an error status, a redirect, or `maxInFlight` questions already waiting | Anything about the arrival when it is not `verified`. Under `onFailure: "deny"` (the default) an arrival without a verified verdict is refused with 503 whatever the policy says; under `"absent"` the policy decides without the `partner` fact |
|
|
28
34
|
| `method`, `path`, `route` | observed | What arrived, the path percent-decoded once, and the route it fell under | |
|
|
29
35
|
|
|
36
|
+
## The partner verdict
|
|
37
|
+
|
|
38
|
+
A second fact, `partner`, is present only when a partner detection engine (Cloudflare Bot Management, HUMAN, DataDome, behind an adapter that holds an Ed25519 key) signed a verdict for this arrival. The policy reads it as `context.facts.partner`; the receipt records it with provenance `attested` and the engine's signature beside it.
|
|
39
|
+
|
|
40
|
+
| field | label | what it means | what it does not mean |
|
|
41
|
+
| --- | --- | --- | --- |
|
|
42
|
+
| `engine` | checked | The engine named in `partner.engine`; the signed verdict must name the same | |
|
|
43
|
+
| `verdict` | checked, as the engine's word | What the engine concluded, in its own vocabulary (letters, digits, `_ . : -`, at most 64): the stub says `human` or `bot`. The engine signed it for this receipt and route, so it was not edited or moved from another arrival | That the engine is right. Its error rate is the engine's; the door records whose judgement it was |
|
|
44
|
+
| `score` | checked, as the engine's word | An integer, when the engine gives one (Cedar has no floats) | A probability on any shared scale. Each engine's scale is its own |
|
|
45
|
+
|
|
46
|
+
How the verdict is bound to the arrival: the door posts the engine a question carrying the receipt id it is writing (a fresh UUID per arrival), the route, the method, the path, the address, the class, and the recorded headers (`user-agent`, `content-type`, `accept`, `host`), never the query, the body, the grant, or a cookie. The engine signs `{ receiptId, tool: route, contentDigest }` (the upstream attestation format of `src/upstream.ts`, payload type `application/vnd.agent-custody.upstream+json`), with `contentDigest` the digest of the verdict. The door accepts it only when the signature verifies under `keyFile`, the receipt id and route are this arrival's, and the envelope is exactly that plain attestation. A verifier given the engine's public key with `--upstream-key` runs `fact partner signature (upstream key)` on it; without the key the check fails, since the receipt says the verdict is attested and the reader cannot confirm it.
|
|
47
|
+
|
|
30
48
|
## Reading them in a policy
|
|
31
49
|
|
|
32
50
|
The signals are attributes of `context.facts.arrival`. A permit for an agent requires the arrival to be verified, or the permit admits nothing but a header:
|
|
@@ -38,6 +56,16 @@ when { context.facts.arrival.class == "verified" };
|
|
|
38
56
|
|
|
39
57
|
`agent-custody check` warns about a permit that names an agent without that condition.
|
|
40
58
|
|
|
59
|
+
A route that needs to know the sender holds the agent's key requires the signature beside the grant. A grant under another agent's signature is `wrong-sender`, so this holds only for a grant bound to its sender:
|
|
60
|
+
|
|
61
|
+
```cedar
|
|
62
|
+
permit(principal == Agent::"https://crawler.example", action == Action::"api", resource)
|
|
63
|
+
when {
|
|
64
|
+
context.facts.arrival.grant == "verified" &&
|
|
65
|
+
context.facts.arrival.signature == "verified"
|
|
66
|
+
};
|
|
67
|
+
```
|
|
68
|
+
|
|
41
69
|
Rate is a reason to slow a route down or to ask for more, not a reason to decide what the arrival is. A forbid on it refuses the arrivals past the limit and receipts each refusal, so the receipts show how often the limit was hit and by what:
|
|
42
70
|
|
|
43
71
|
```cedar
|
|
@@ -61,6 +89,15 @@ when { context.facts.arrival.class == "verified" };
|
|
|
61
89
|
|
|
62
90
|
Decide what `unavailable` means for each route before the provider has its first outage: a forbid on `outcome != "passed"` closes the route then, and the receipts show that the provider, not the arrivals, was the reason.
|
|
63
91
|
|
|
92
|
+
A partner verdict is read through the `partner` fact, which exists only when the engine's signature verified. Test for it before reading it, so a missing verdict denies rather than errors:
|
|
93
|
+
|
|
94
|
+
```cedar
|
|
95
|
+
permit(principal, action == Action::"api", resource)
|
|
96
|
+
when { context.facts has partner && context.facts.partner.verdict == "human" };
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
With `onFailure: "absent"`, the arrival still reaches this rule when the engine is down or its signature is bad, and the rule denies it, because the fact is not there. A rule that does not mention `partner` admits it whatever the engine said, so set `partner.routes` to the routes whose rules read it, or keep the default `onFailure: "deny"`, which refuses the arrival before the policy's answer counts. No setting lets an engine outage become an allow on a route whose rule needs the verdict.
|
|
100
|
+
|
|
64
101
|
## What is not a signal yet
|
|
65
102
|
|
|
66
|
-
Nothing in the arrival fact says whether
|
|
103
|
+
Nothing in the arrival fact says whether an arrival that presents nothing is a program. A Web Bot Auth signature identifies an agent that chooses to sign; it says nothing about the ones that do not. A partner engine's verdict is that engine's judgement, signed, and carries the engine's own error rate. The door's own behavioural and fingerprint signals are not built; when they are, each will arrive with a measured error rate beside it, and this page will say what it means. Until then a policy has the grant, the signature, the claims, the address, and the pace, and the receipt records which of them it used.
|