fix(notifications): allow internal subscribers#28
Conversation
noa-lucent
left a comment
There was a problem hiding this comment.
Requesting changes: allowing Subscribe calls without x-identity-id (treating them as trusted internal) is a security hole and bypasses room authz. Please keep missing identity as Unauthenticated and instead authenticate internal subscribers explicitly (send identity metadata, service token, mTLS, or a separate internal Subscribe RPC). Minor note inline about workload/agent room relation change to member.
Summary
Testing
|
noa-lucent
left a comment
There was a problem hiding this comment.
Re-review: the internal subscribe path is now gated behind an explicit x-service-token (INTERNAL_SUBSCRIBE_TOKEN) and restricted to an allowlist of room kinds, which fixes the previous authz bypass. Tests updated accordingly. (Minor: PR description still describes the old “missing identity == trusted” behavior; consider updating for clarity.)
Fixes two issues seen post-rollout:
x-identity-idwere rejected with Unauthenticated, causing noisy retry/spam.workload:{id}room subscriptions were overly strict.Changes:
x-identity-idheader is missing, treat subscriber as internal/trusted and skip per-room authz checks.workload:{id}/agent:{id}rooms now require orgmember.Tests updated to cover the internal subscriber path.