You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7b13c27
Browse filesBrowse the repository at this point in the historyBrowse files
feat(clients): client sessions with a recorded traffic log, phase C1 (D-0077)
harness-clients is the client-session service of CLIENT-TESTING.md: each
session is a reference storage and authorization server of its own, mounted
under {base}/s/{sid}/, with a session API, a session page, and a log of every
request the client sends, redacted and annotated (what it addressed, whose
token, how presented, whether the session handed out the URL, what the URL
advertised). Bounds and expiry per section 8.2.
RefLwsServer and RefAuthorizationServer can now be mounted in another
server, containment no longer follows paths, and six traps (opaque pages and
linksets, flat URLs, PUT only for text, a decoy realm, index lag) are off by
default. A new self-test scenario runs every definition with all traps set:
all 203 pass. It found type-search-content-location-protected assuming nested
URLs; it now checks for a type fragment instead. Reads now advertise Allow and
Accept-Patch.
|`{base}/s/{sid}/op/`| the OpenID Provider: discovery, JWKS, authorize, token, login form |
130
-
|`{base}/s/{sid}/id/{name}`| alice's and bob's identity documents (CID suite) |
131
-
|`{base}/s/{sid}/_t/…`| trap resources (§6.1) |
127
+
|`{base}/s/{sid}/storage/`| the storage: its storage description and root container; resources it names under `_r/`, trap URLs under `_t/` (§6.1) |
128
+
|`{base}/s/{sid}/as/`| the authorization server: JWKS and token endpoint. Its RFC 8414 metadata is at `/.well-known/lws-configuration{base path}/s/{sid}/as`|
129
+
|`{base}/s/{sid}/op/`| the OpenID Provider: discovery, JWKS, authorize, token, login form (C4) |
130
+
|`{base}/s/{sid}/id/{name}`| alice's and bob's identity documents (CID suite; C4) |
132
131
133
132
Paths, not hostnames, separate sessions, so one reverse-proxy rule covers the service.
134
133
LWS URIs are opaque to clients, so the prefix costs nothing.
@@ -163,12 +162,17 @@ tested once.
163
162
164
163
### 4.4 Session API
165
164
166
-
Plain HTTP and JSON, authenticated with the session key as a Bearer token:
167
-
-`POST {base}/sessions` creates a session and returns its id, key and URLs. It is
168
-
rate-limited, and may need sign-in (§12).
165
+
Plain HTTP and JSON, authenticated with the session key as a Bearer token. Phase C1 built
166
+
everything here except results, faults and reset, which come with phases C2 and C3;
167
+
[harness-clients/README.md](harness-clients/README.md) documents what exists.
168
+
-`POST {base}/sessions` creates a session and returns its id, key and URLs, and access
169
+
tokens for alice and bob. It is rate-limited, and may need sign-in (§12).
170
+
-`GET {base}/sessions/{sid}` describes the session; `POST {base}/sessions/{sid}/tokens/{name}`
171
+
hands out a fresh token; `GET {base}/sessions/{sid}/page` is the session page, which reads
172
+
the key from its URL's fragment.
169
173
-`GET {base}/sessions/{sid}/results` returns results as JSON, or as EARL or JUnit XML with
170
174
`?format=`.
171
-
-`GET {base}/sessions/{sid}/exchanges` returns the traffic log, paged and redacted.
175
+
-`GET {base}/sessions/{sid}/exchanges?after=N` returns the traffic log, paged and redacted.
172
176
-`POST {base}/sessions/{sid}/faults` arms a fault, the same as ticking a fault task.
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ and `CLAUDE.md` (session ground rules) before working on this repo.
35
35
|---|---|
36
36
|`harness-core`| catalog, the definitions loader and lint, the engine, identities and credentials, reporting — no Spring |
37
37
|`harness-fixtures`| reference LWS server (open/secured/broken), reference authorization server (and its broken twin), the reference deployment the self-test loop runs against |
38
+
|`harness-clients`| client-session service for testing LWS clients ([CLIENT-TESTING.md](CLIENT-TESTING.md)): a reference storage and authorization server per session, every request recorded; `java -jar harness-clients/target/touchstone-clients.jar`|
38
39
|`harness-cli`| picocli front end (`run`, `coverage`, `diff`) |
39
40
|`harness-mcp`| Spring AI MCP server over the core engine |
Copy file name to clipboardExpand all lines: docs/how-it-works.md
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ Touchstone is a Java 21 Maven project with four modules, plus the data they oper
18
18
|---|---|
19
19
|`harness-core`| The engine: catalog loading, the definitions loader and lint, the engine that runs them, identities and credentials, and every report writer. It has no Spring dependency, so every front end can use it. |
20
20
|`harness-fixtures`| Servers Touchstone controls: the reference LWS server, the reference authorization server, and broken twins of both. |
21
+
|`harness-clients`| The client-session service, for testing LWS clients: each session is a reference storage and authorization server of its own, with every request recorded ([CLIENT-TESTING.md]({% include src.html path="CLIENT-TESTING.md" %})). |
21
22
|`harness-cli`| The `touchstone` command (`run`, `coverage`, `diff`), built as one runnable jar. |
22
23
|`harness-mcp`| A Model Context Protocol server over the same engine, for AI agents. |
23
24
|`catalog/`| The requirements catalog: one Turtle file per specification document. |
@@ -183,6 +184,12 @@ provides both.
183
184
`401` with a challenge for a missing or invalid token and `403` for a valid agent
184
185
without access, and honours grants;
185
186
-`BROKEN`: claims to protect resources but never challenges or refuses.
187
+
188
+
It can also set traps: behaviour the drafts allow but a client must not assume away. Page
189
+
and linkset URLs are opaque, resource URLs do not nest under their container's, binary
190
+
resources refuse PUT, a decoy in the root challenges with a foreign realm, and the index
191
+
lags behind writes. Client sessions set them all; the server self-test sets them once, to
192
+
prove they are legal.
186
193
-**`RefAuthorizationServer`** publishes RFC 8414 metadata and a JWKS, and exchanges
187
194
CID (HTTPS and did:key subjects), OpenID Connect and SAML subject tokens for access
188
195
tokens (RFC 8693), validating each the way its suite says. Its broken twin exchanges anything.
@@ -191,13 +198,17 @@ provides both.
191
198
192
199
`./mvnw verify` runs the loop in `DefinitionsSelfTest`:
193
200
194
-
- against the secured deployment, all 101 definitions run, and every one passes except
195
-
the notification test, which is inapplicable because the reference advertises no
196
-
notification service it does not have;
201
+
- against the secured deployment, all 203 definitions run, and every one passes except the
202
+
single-page pagination test, which is inapplicable because the reference splits that
203
+
container into pages;
204
+
- against the same deployment with every trap set, the same holds: a definition that failed
205
+
there would assume something the drafts leave open;
197
206
- against an open storage, exactly the tests that need authentication are inapplicable;
198
-
- against the broken authorization server, the 19 credential tests of the three
207
+
- against the broken authorization server, the 26 negative tests of the three
199
208
authentication suites fail, and so does the unknown-storage test;
200
-
- against the broken storage, its 14 access-control tests fail.
209
+
- against the broken storage, its 23 access-control tests fail;
210
+
- against a storage that leaks notifications, the two delivery-authorization tests and the
211
+
signature test fail.
201
212
202
213
Each broken twin fails exactly the tests that exist to catch it, which is what shows those
0 commit comments