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)
| 50 | // to storage Create* methods. It carries an *oauth.Session so the |
| 51 | // storage adapter can extract user_id for the row. |
| 52 | func 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 |
no test coverage detected