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

Add ITokenCleanupService Interface #1215

Merged
merged 4 commits into from Mar 17, 2023
Merged

Conversation

josephdecock
Copy link
Member

@josephdecock josephdecock commented Mar 16, 2023

Changes

  • Add ITokenCleanupService interface
  • Remove unused IServerSideSessionsMarker from TokenCleanupService
  • Rename RemoveExpiredGrantsAsync to CleanupGrantsAsync. This is more accurate, because we are performing all grant cleanup tasks within this method, which might include removing consumed grants and expired device codes in addition to expired grants.

Resolves #981

Minor Breaking Changes

The rename is strictly speaking a breaking change, but it a safe one to make because even though this method is public, it is not virtual. The assumption is that the only users of this class are

  • IdentityServer itself, which we change during the rename
  • Classes that derive from TokenCleanupService, which can't override this non-virtual method

Removing the IServerSideSessionsMarker is also technically a breaking change, but the marker itself is stored privately, so no derived class can ever make use of it. Customizations that previously were implemented by deriving from TokenCleanupService will need to simplify how they invoke the base constructor.

Also, the TokenCleanupHost now depends on an ITokenCleanupService interface instead of the TokenCleanupService class. Customizations of the TokenCleanupService that previously registered a class that derived from TokenCleanupService in the DI system will need to register that service as an ITokenCleanupService instead.

Changed to CleanupGrantsAsync. This is more accurate, because we are
performing all cleanup tasks within this method, which might include removing
consumed grants and expired device codes in addition to expired grants.

This is strictly speaking a breaking change, but it a safe one to make
because even though this method is public, it is not virtual. The
assumption is that the only users of this class are
- IdentityServer itself, which we change during the rename
- Classes that derive from TokenCleanupService, which can't override
this non-virtual method
@brockallen brockallen added bug Something isn't working enhancement New feature or request labels Mar 17, 2023
@brockallen brockallen added this to the 6.3.0 milestone Mar 17, 2023
@brockallen brockallen merged commit ac9be51 into main Mar 17, 2023
@brockallen brockallen deleted the joe/token-cleanup-interface branch March 17, 2023 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow extensibility for TokenCleanupService
2 participants