AuthenticateUserForTest exposes API.authenticateUser so external test helpers can construct synthetic guard-protected handlers without re-implementing the bearer-token plumbing.
(r *http.Request)
| 22 | // test helpers can construct synthetic guard-protected handlers |
| 23 | // without re-implementing the bearer-token plumbing. |
| 24 | func (a *API) AuthenticateUserForTest(r *http.Request) (userID string, err error) { |
| 25 | u, err := a.authenticateUser(r) |
| 26 | if err != nil { |
| 27 | return "", err |
| 28 | } |
| 29 | return u.ID, nil |
| 30 | } |
| 31 | |
| 32 | // IdempotencyGuardForTest exposes API.idempotencyGuard so tests in the |
| 33 | // external agent_test package can verify the side-effect-committed |
no test coverage detected