Skip to content

Commit

Permalink
Auth: Make token cache lifetimes configurable rucio#6494
Browse files Browse the repository at this point in the history
Introduce two new configuration options:

    [oidc]
    token_min_lifetime = ...
    token_max_lifetime = ...

The first dictates what is the minimum remaining lifetime that is
required before the cache considers the token to be expired. The second
dictates the maximum amount of time a token may remain in the cache (not
to be confused with what is configured for the Rucio client in the token
provider).

Both must be expressed in seconds.
  • Loading branch information
dchristidis committed Feb 13, 2024
1 parent 474ecdc commit 607854f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rucio/core/oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@

# The WLCG Common JWT Profile dictates that the lifetime of access and ID tokens
# should range from five minutes to six hours.
TOKEN_MIN_LIFETIME: Final = int(timedelta(minutes=5).total_seconds())
TOKEN_MAX_LIFETIME: Final = int(timedelta(hours=6).total_seconds())
TOKEN_MIN_LIFETIME: Final = config_get_int('oidc', 'token_min_lifetime', default=300)
TOKEN_MAX_LIFETIME: Final = config_get_int('oidc', 'token_max_lifetime', default=21600)

REGION: Final = make_region_memcached(expiration_time=TOKEN_MAX_LIFETIME)
METRICS = MetricManager(module=__name__)
Expand Down

0 comments on commit 607854f

Please sign in to comment.