Skip to content

Commit

Permalink
comms
Browse files Browse the repository at this point in the history
  • Loading branch information
mieciu committed Sep 23, 2024
1 parent 663cc0b commit 0a0ed63
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions quesma/quesma/auth_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (
const cacheWipeInterval = 10 * time.Minute

// authMiddleware a simple implementation of an authentication middleware,
// which checks if the Authorization header and validates it against Elasticsearch.
// which checks the Authorization header and validates it against Elasticsearch.
//
// If the validation is positive, the Authorization header is stored in a cache to avoid unnecessary calls to Elasticsearch preceding each request.
// The cache is wiped every 10 minutes - all at once, perhaps this might be revisited in the future.
// The cache is wiped every 10 minutes - all at once, perhaps this could be revisited in the future.
type authMiddleware struct {
nextHttpHandler http.Handler
authHeaderCache sync.Map
Expand Down

0 comments on commit 0a0ed63

Please sign in to comment.