Commit 690b12f
authored
feat(license): inject X-Axonflow-Client header on every governed request (#161)
Per ADR-050 §4, every governed client must set
`X-Axonflow-Client: <client-id>/<version>` on every request to the agent
so the agent can derive request scope (sdk) and validate it against the
token's aud.scope via HasScope().
This PR:
- Adds AxonFlowConfig.getClientHeader() which returns "sdk-java/<SDK_VERSION>".
Sourced from the bundled SDK_VERSION; no env / config override (the
consumer doesn't get to spoof its own client identity to the agent).
- Stamps the header alongside User-Agent at every Request.Builder site
in AxonFlow.java that already sets User-Agent (5 sites).
- Stamps the header inside addAuthHeaders() so any builder that calls
addAuthHeaders without explicit User-Agent (e.g. the providers
listing path at AxonFlow.java:1922) also ships it. OkHttp's
Builder.header() replaces, so the small overlap with the explicit
per-site stamps just resets the same value.
Test coverage:
- ClientHeaderTest asserts X-Axonflow-Client is forwarded on
proxyLLMCall and pins the agent-parseable "sdk-java/<semver>" format.
- Full Maven test suite stays green: 1228 tests, 0 failures.
Signed-off-by: Saurabh Jain <saurabhjain1592@gmail.com>1 parent f967a46 commit 690b12f
3 files changed
Lines changed: 107 additions & 0 deletions
File tree
- src
- main/java/com/getaxonflow/sdk
- test/java/com/getaxonflow/sdk
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3365 | 3365 | | |
3366 | 3366 | | |
3367 | 3367 | | |
| 3368 | + | |
3368 | 3369 | | |
3369 | 3370 | | |
3370 | 3371 | | |
| |||
3573 | 3574 | | |
3574 | 3575 | | |
3575 | 3576 | | |
| 3577 | + | |
3576 | 3578 | | |
3577 | 3579 | | |
3578 | 3580 | | |
| |||
3624 | 3626 | | |
3625 | 3627 | | |
3626 | 3628 | | |
| 3629 | + | |
3627 | 3630 | | |
3628 | 3631 | | |
3629 | 3632 | | |
| |||
3763 | 3766 | | |
3764 | 3767 | | |
3765 | 3768 | | |
| 3769 | + | |
| 3770 | + | |
| 3771 | + | |
| 3772 | + | |
3766 | 3773 | | |
3767 | 3774 | | |
3768 | 3775 | | |
| |||
4372 | 4379 | | |
4373 | 4380 | | |
4374 | 4381 | | |
| 4382 | + | |
4375 | 4383 | | |
4376 | 4384 | | |
4377 | 4385 | | |
| |||
4440 | 4448 | | |
4441 | 4449 | | |
4442 | 4450 | | |
| 4451 | + | |
4443 | 4452 | | |
4444 | 4453 | | |
4445 | 4454 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
295 | 309 | | |
296 | 310 | | |
297 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
0 commit comments