POST /v1/audit recorded the address of the product that sent the event. So Prüfwerk's API-key writes showed the agent's container address (172.17.0.6 on stage) instead of the caller's.
appendAuditReq gains source_ip. It is taken when net.ParseIP accepts it and stored in canonical form. The peer that sent the event is kept in metadata.relayed_by.
Anything that doesn't parse is ignored, and the peer is recorded as before.
Trust: audit.write is service-principal only, the same trust as the actor_id those callers already set.
No migration, and existing callers are unchanged.
Callers: Prüfwerk (pruefwerk #567, from the API host's proxy header); Werkmeister will reuse the field (agreed with werkmeister-18).
Test: TestAppendAudit_sourceIP covers a valid IP (recorded, relayed_by set) and junk (ignored), in each store.
Not in this PR: clientIP() takes the leftmostX-Forwarded-For entry. orca-proxy appends the peer it saw, so the rightmost entry is authoritative and the leftmost is chosen by the client. Separate issue for werkmeister-18.
`POST /v1/audit` recorded the address of the product that sent the event. So Prüfwerk's API-key writes showed the agent's container address (172.17.0.6 on stage) instead of the caller's.
- `appendAuditReq` gains `source_ip`. It is taken when `net.ParseIP` accepts it and stored in canonical form. The peer that sent the event is kept in `metadata.relayed_by`.
- Anything that doesn't parse is ignored, and the peer is recorded as before.
- Trust: `audit.write` is service-principal only, the same trust as the `actor_id` those callers already set.
- No migration, and existing callers are unchanged.
- Callers: Prüfwerk (pruefwerk #567, from the API host's proxy header); Werkmeister will reuse the field (agreed with werkmeister-18).
Test: `TestAppendAudit_sourceIP` covers a valid IP (recorded, `relayed_by` set) and junk (ignored), in each store.
Not in this PR: `clientIP()` takes the **leftmost** `X-Forwarded-For` entry. orca-proxy appends the peer it saw, so the rightmost entry is authoritative and the leftmost is chosen by the client. Separate issue for werkmeister-18.
Not run locally (RAM); CI runs the tests.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
POST /v1/audit recorded the address of the product that sent the event, so
API-key writes in Prüfwerk showed the agent's container address. A product
may now pass its own caller's address as source_ip; it is taken when it
parses as an IP, and the sending peer is kept in metadata.relayed_by.
audit.write is limited to service principals, the same trust as actor_id.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
POST /v1/auditrecorded the address of the product that sent the event. So Prüfwerk's API-key writes showed the agent's container address (172.17.0.6 on stage) instead of the caller's.appendAuditReqgainssource_ip. It is taken whennet.ParseIPaccepts it and stored in canonical form. The peer that sent the event is kept inmetadata.relayed_by.audit.writeis service-principal only, the same trust as theactor_idthose callers already set.Test:
TestAppendAudit_sourceIPcovers a valid IP (recorded,relayed_byset) and junk (ignored), in each store.Not in this PR:
clientIP()takes the leftmostX-Forwarded-Forentry. orca-proxy appends the peer it saw, so the rightmost entry is authoritative and the leftmost is chosen by the client. Separate issue for werkmeister-18.Not run locally (RAM); CI runs the tests.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p