Skip to content

fix(jans-cedarling): CEDARLING_TOKEN_CACHE_MAX_TTL=0 causes "ttl too long" warning in token cache #14154

@dagregi

Description

@dagregi

Describe the bug

When CEDARLING_TOKEN_CACHE_MAX_TTL = 0, the token cache logs the warning "could not set token to token cache: ttl too long" for every token that has a non-zero exp claim. The documented behaviour states that setting this value to 0 should disable the TTL cap and use the token's exp claim as the entry TTL. Instead, SparkV's internal max_ttl is set to 0 seconds, which causes it to reject any entry with a positive TTL.

To Reproduce

  1. Set CEDARLING_TOKEN_CACHE_MAX_TTL = 0 in bootstrap config.
  2. Present an access token with a valid exp claim (e.g. 1 hour lifetime).
  3. Observe the warning "could not set token to token cache: ttl too long" in logs.

Expected behavior

  • Setting CEDARLING_TOKEN_CACHE_MAX_TTL = 0 should either disable the cache entirely to avoid unbounded growth and misleading warnings. The docs should also updated to follow this behavior.

Metadata

Metadata

Assignees

Labels

comp-jans-cedarlingTouching folder /jans-cedarlingkind-bugIssue or PR is a bug in existing functionality

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions