Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generic authenticator updated to consider ttl of the session object received from the identity_info_endpoint and to enable session validation #201

Merged
merged 38 commits into from
Aug 26, 2022

Conversation

dadrus
Copy link
Owner

@dadrus dadrus commented Aug 24, 2022

closes #154

This is done by an introduction of a new session_lifespan property, which allows following configuration:

session_lifespan:
  active: <gjson path>
  issued_at: <gjson path>
  not_before: <gjson path>
  not_after: <gjson path>
  time_format: <string value>
  validity_leeway: <e.g. 5s>

Each gjson path value defines a path in a json document received from the endpoint to extract the corresponding value from. the value behind active should be convertable to a boolean value. All other are treated as strings, which are then converted to time values based on the given time_format and are then used to validate the session object itself and calculate required ttls.

@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Merging #201 (4000f53) into main (869d8ae) will increase coverage by 0.32%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #201      +/-   ##
==========================================
+ Coverage   85.10%   85.43%   +0.32%     
==========================================
  Files         157      159       +2     
  Lines        6212     6322     +110     
==========================================
+ Hits         5287     5401     +114     
+ Misses        783      779       -4     
  Partials      142      142              
Impacted Files Coverage Δ
...l/pipeline/authenticators/generic_authenticator.go 92.02% <100.00%> (+1.28%) ⬆️
...ernal/pipeline/authenticators/jwt_authenticator.go 92.70% <100.00%> (ø)
...ternal/pipeline/authenticators/session_lifespan.go 100.00% <100.00%> (ø)
...pipeline/authenticators/session_lifespan_config.go 100.00% <100.00%> (ø)
internal/x/compare.go 100.00% <100.00%> (ø)
internal/rules/repository.go 97.60% <0.00%> (+3.19%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dadrus dadrus changed the title feat: generic authenticator updated to consider ttl of the session object received from the identity_info_endpoint feat: generic authenticator updated to consider ttl of the session object received from the identity_info_endpoint and to enable session validation Aug 25, 2022
@dadrus dadrus merged commit 42b4e6c into main Aug 26, 2022
@dadrus dadrus deleted the feat/generic_authenticator_ttl branch August 26, 2022 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let generic authenticator calculate cache TTL based on the response from the identity_info_endpoint
1 participant