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

Function newRequester

internal/oauth/storage_test.go:52–67  ·  view source on GitHub ↗

newRequester builds a minimal fosite.Requester suitable for handing to storage Create* methods. It carries an *oauth.Session so the storage adapter can extract user_id for the row.

(id, clientID, userID string, now time.Time)

Source from the content-addressed store, hash-verified

50// to storage Create* methods. It carries an *oauth.Session so the
51// storage adapter can extract user_id for the row.
52func newRequester(id, clientID, userID string, now time.Time) fosite.Requester {
53 c, _ := newClient(clientID)
54 return &fosite.Request{
55 ID: id,
56 RequestedAt: now,
57 Client: c,
58 RequestedScope: fosite.Arguments{"agent"},
59 GrantedScope: fosite.Arguments{"agent"},
60 Form: map[string][]string{},
61 Session: &oauth.Session{
62 UserID: userID,
63 AgentEmail: "agent@example.com",
64 Subject: userID,
65 },
66 }
67}
68
69// newClient returns a minimal fosite.Client matching the row seedClient
70// inserts. We only need the methods fosite reads during the storage

Calls 1

newClientFunction · 0.85

Tested by

no test coverage detected