Commit 690cd30
feat(seer): Add signed viewer context header to Seer API requests (#109626)
Add an optional `viewer_context` parameter to
`make_signed_seer_api_request` that allows callers to pass
`organization_id` and/or `user_id`. When provided, these are serialized
as JSON into an `X-Viewer-Context` header and HMAC-SHA256 signed into a
companion `X-Viewer-Context-Signature` header using the shared Seer
secret.
This gives Seer a verified way to know which organization and user
originated a request, enabling access control and audit logging on their
side. No callers pass this yet — this just adds the plumbing.
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6e2dd0f commit 690cd30
1 file changed
+33
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| 46 | + | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
| |||
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
50 | 73 | | |
51 | 74 | | |
52 | 75 | | |
| |||
62 | 85 | | |
63 | 86 | | |
64 | 87 | | |
65 | | - | |
| 88 | + | |
66 | 89 | | |
67 | 90 | | |
68 | 91 | | |
| |||
382 | 405 | | |
383 | 406 | | |
384 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
0 commit comments