auth/cache

Memoizes the outcome of verifying a credential.

Package
github.com/cs3org/reva/v3/pkg/auth/cache
Source
pkg/auth/cache · Go reference
Used by
authprovider, auth, jwt

Overview

Package cache memoizes the outcome of verifying a credential. A sync client presents the same secret on every request, which otherwise costs a database or identity provider lookup every time. It does not matter what the credential is: an app password, a username and password, a public link token or a signed JWT all go through the same cache. Rejections are cached too, so a client that keeps retrying a stale password is also answered from memory.

Configuration

KeyTypeDefaultDescription
cache_sizeint50000Maximum number of authentication outcomes kept in memory. source
cache_ttlint300Seconds an accepted credential stays cached. An entry always expires at min(TTL, expiration of the credential). A negative value disables the cache. source
negative_cache_ttlint30Seconds a rejected credential stays cached. source