hydra icon indicating copy to clipboard operation
hydra copied to clipboard

feat: add a flag and a routine for flushing inactive login sessions

Open norand94 opened this issue 3 years ago • 10 comments

Related issue(s)

https://github.com/ory/hydra/issues/2561

Checklist

  • [x] I have read the contributing guidelines.
  • [x] I have referenced an issue containing the design document if my change introduces a new feature.
  • [x] I am following the contributing code guidelines.
  • [x] I have read the security policy.
  • [x] I confirm that this pull request does not address a security vulnerability. If this pull request addresses a security. vulnerability, I confirm that I got green light (please contact [email protected]) from the maintainers to push the changes.
  • [x] I have added tests that prove my fix is effective or that my feature works.
  • [x] I have added or changed the documentation.

Further Comments

norand94 avatar Jun 02 '22 12:06 norand94

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 02 '22 12:06 CLAassistant

Codecov Report

Merging #3133 (2286d79) into master (316b582) will increase coverage by 2.78%. The diff coverage is 100.00%.

:exclamation: Current head 2286d79 differs from pull request most recent head 1acf097. Consider uploading reports for the commit 1acf097 to get more accurate results

@@            Coverage Diff             @@
##           master    #3133      +/-   ##
==========================================
+ Coverage   76.82%   79.61%   +2.78%     
==========================================
  Files         123      112      -11     
  Lines        8976     8001     -975     
==========================================
- Hits         6896     6370     -526     
+ Misses       1652     1225     -427     
+ Partials      428      406      -22     
Impacted Files Coverage Δ
cmd/cli/handler_janitor.go 82.97% <100.00%> (+2.12%) :arrow_up:
cmd/janitor.go 100.00% <100.00%> (ø)
persistence/sql/persister_consent.go 80.12% <100.00%> (-7.47%) :arrow_down:
x/clean_sql.go 46.42% <0.00%> (-44.69%) :arrow_down:
x/hasher.go 73.33% <0.00%> (-17.98%) :arrow_down:
persistence/sql/persister_jwk.go 64.58% <0.00%> (-14.18%) :arrow_down:
cmd/cli/handler_jwk.go 88.23% <0.00%> (-11.77%) :arrow_down:
cmd/cli/handler.go 89.47% <0.00%> (-10.53%) :arrow_down:
persistence/sql/persister_grant_jwk.go 81.41% <0.00%> (-9.89%) :arrow_down:
... and 146 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Jun 02 '22 13:06 codecov[bot]

I created PR which contains regenerated docs https://github.com/ory/docs/pull/848

norand94 avatar Jun 02 '22 13:06 norand94

@aeneasr It seems like this has stalled for a long time.

architeacher avatar Jun 08 '23 12:06 architeacher

That's true

aeneasr avatar Jun 09 '23 16:06 aeneasr

I think after the merging of authentication request tables, the correct SQL is now:

delete from hydra_oauth2_authentication_session
where not exists (
    select from hydra_oauth2_flow where login_session_id = hydra_oauth2_authentication_session.id
);

works at least in postgresql.

mikapfl avatar Jul 21 '23 12:07 mikapfl

Dear @norand94 are you still working on this? This would be a great thing to have in janitor Best Regard Alex

alexandre-melard avatar Nov 14 '23 16:11 alexandre-melard