MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / GetPrincipalByAPIKey

Method GetPrincipalByAPIKey

internal/ws/handler.go:21–21  ·  view source on GitHub ↗

GetPrincipalByAPIKey returns the scoped principal (User + Scope + AgentID) so the WS transport can enforce the SAME agent-scope confinement the REST API does (HIGH-1): an agent-scoped key must not open another agent's stream.

(ctx context.Context, apiKey string)

Source from the content-addressed store, hash-verified

19 // so the WS transport can enforce the SAME agent-scope confinement the REST
20 // API does (HIGH-1): an agent-scoped key must not open another agent's stream.
21 GetPrincipalByAPIKey(ctx context.Context, apiKey string) (*identity.Principal, error)
22 GetAgentByEmail(ctx context.Context, email string) (*identity.AgentIdentity, error)
23 GetMessagesByAgent(ctx context.Context, f identity.MessageListFilter) ([]identity.Message, error)
24}

Callers 4

authenticatePrincipalMethod · 0.65
serveMethod · 0.65

Implementers 2

Storeinternal/identity/store.go
mockStoreinternal/ws/handler_test.go

Calls

no outgoing calls