File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ const (
1515type User interface {}
1616
1717// AuthenticateRequest checks the provided API key against the keys stored in the database. If the key is active and
18- // valid, a Webauthn client and WebauthnUser are created and stored in the request context .
18+ // valid, an authentication user (e.g. Webauthn user and client) is created and returned .
1919func AuthenticateRequest (r * http.Request ) (User , error ) {
2020 // get key and secret from headers
2121 key := r .Header .Get (HeaderAPIKey )
Original file line number Diff line number Diff line change 88 mfa "github.com/sil-org/serverless-mfa-api-go"
99)
1010
11- // authenticationMiddleware gets API key information from request headers and validates the key/signature
12- // Then it uses api meta information provided in headers to configure a webauthn client and fetch the
13- // user from storage and attach to context.
11+ // authenticationMiddleware gets API key information from request headers and validates the key/signature.
12+ // If the key is active and valid an authenticated user (e.g. Webauthn user and client) is added to the request
13+ // context.
1414func authenticationMiddleware (next http.Handler ) http.Handler {
1515 return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
1616 user , err := mfa .AuthenticateRequest (r )
You can’t perform that action at this time.
0 commit comments