You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hosted participants on gate-only installs: bind credential audience to relaygate, check roster before Grok re-enrolment #240
Two hardening follow-ups from the review of #231 (hosted participants enrol through relaygate on gate-only installs). Neither blocked the merge; both narrow what a single-use hosted credential and its recovery path can do.
1. Bind hosted participant credentials to relaygate's audience
introspectRelayHostedCredential (src/auth/introspect.ts) answers active for a single-use hosted credential when the request's aud is any origin in acceptedAudiences(config). Only relaygate ever redeems these credentials, so the check should accept the configured relaygate origin and nothing else. Today another service that is a valid introspection audience for other token kinds could burn (and get an active answer for) a hosted credential it was never meant to see.
Done when:
the hosted branch compares aud with the relaygate origin only and answers audience otherwise, without redeeming the credential;
a test covers an accepted-but-not-relaygate audience (inactive, credential still unredeemed).
2. Check the roster before a Grok routine re-enrols at relaygate
GrokRoutines.recover (src/mcp/grok-routines.ts) calls enrolHostedAtGate for the stored agent name and only afterwards compares the enrolment's upstream agent id with the participant row. The comparison stops a wrong token from being stored, but the enrolment has already happened by then. registerParticipant checks the workspace roster first (the name must still resolve to this participant's own agent id); recovery should do the same and record a delivery failure without enrolling when it does not.
Done when:
recovery reads the roster entry for the name and enrols only if it is absent or carries the participant's stored agent id;
a test covers a name that now belongs to a different agent (no enrolment call, delivery failure recorded, nothing released).
Activity