-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add an admin endpoint to allow authorizing server to signal token revocations #16125
Conversation
synapse/rest/admin/devices.py
Outdated
# device_id -> introspection_token | ||
# TODO: is there a way to check if the deletion request has come from MAS/OIDC | ||
# authorizing server and only invalidate if that's the case? | ||
if self.config.experimental.msc3861.enabled: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming this is the endpoint that MAS uses to delete devices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it: we should put this somewhere where all device deletion requests hit it. That way any log out / device deletion correctly ensures the device isn't usable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe in the data store?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hilariously I started with it there and then convinced myself that was overly broad - I've moved it back now.
synapse/util/caches/expiringcache.py
Outdated
@@ -140,6 +140,21 @@ def pop(self, key: KT, default: T = SENTINEL) -> Union[VT, T]: | |||
|
|||
return value.value | |||
|
|||
def invalidate(self, keys: List[KT]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalidate
on the other caches just invalidates a single key. Let's do the same thing here to avoid confusion
As the title states - the endpoint removes the introspection token corresponding to the token id presented to the endpoint from the token cache.
This branch is based on the branch at #16117 and is a follow-up to that PR.