Commit d2ebbe9
fix(pop-spring): bind request content, single-source htu authority
- PopAuthenticationFilter hands CallerVerifier a bounded ContentSource, so
the request body is read once, on the verifier's demand after the SCITT
binding (ANS-6 §7.4 step 12), and is then replayed to the handler
through a request wrapper. Content above the bound (Builder
withMaxContentBytes, default 1 MiB) is rejected with 413 before it is
hashed. Previously the filter never supplied content, so every proof
that carried ans_content_digest was rejected and body-bearing requests
were accepted with the body unbound.
- The trusted-authority check reads the same URL the proof's htu is
compared against instead of the raw Host header (§7.7), so forwarded
header processing can no longer make the two diverge. The
withTrustedHosts Javadoc now says that behind a TLS-terminating proxy
the container's URL is the proxy hop, and withExternalUrl or trusted
forwarded-header handling is required.
- Builder gains withVerifier(CallerVerifier), mutually exclusive with
withPoPSkew, and withRootKeyRefresher(RootKeyRefresher). The example
wires the refresher to TransparencyClient.refreshRootKeysIfNeeded.
Addresses the review on PR #108.
Assisted-by: Claude Code (claude-fable-5-1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: kperry <kperry@godaddy.com>1 parent 4fded3e commit d2ebbe9
3 files changed
Lines changed: 503 additions & 33 deletions
File tree
- ans-sdk-pop-spring
- examples/dpop-scitt-auth/src/main/java/com/godaddy/ans/examples/dpopscittauth
- src
- main/java/com/godaddy/ans/sdk/pop/spring
- test/java/com/godaddy/ans/sdk/pop/spring
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
14 | 16 | | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
58 | 70 | | |
0 commit comments