Skip to content

Commit 565fe55

Browse files
authored
Merge pull request #164 from sil-org/fix-doc-errors
Correct inaccurate authentication function documentation.
2 parents 74dabd8 + 02870b5 commit 565fe55

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const (
1515
type 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.
1919
func AuthenticateRequest(r *http.Request) (User, error) {
2020
// get key and secret from headers
2121
key := r.Header.Get(HeaderAPIKey)

router/middleware.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
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.
1414
func authenticationMiddleware(next http.Handler) http.Handler {
1515
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
1616
user, err := mfa.AuthenticateRequest(r)

0 commit comments

Comments
 (0)