Add an access token introspection cache to make Matrix Authentication Service integration (MSC3861) more efficient. #18231
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Evolution of cd78f3d
This cache does not have any explicit invalidation, but this is deemed acceptable (see code comment).
We may still prefer to add it eventually, letting us bump up the Time-To-Live (TTL) on the cache as we currently set a 2 minute expiry
to balance the fact that we have no explicit invalidation.
This cache makes several things more efficient:
Other than that, this PR also introduces support for
expires_in
(seconds) on the introspection response.This lets the cached responses expire at the proper expiry time of the access token, whilst avoiding clock skew issues.
Corresponds to: element-hq/matrix-authentication-service#4241