Allow compat session devices to have spaces #4067
Merged
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.
The Matrix spec allows anything in the device ID.
With MAS and MSC3861, we restricted that to anything that can be represented as a scope.
But this is valid for next-gen auth sessions, not necessarily for compatibility ones.
Slight problem is, for compatibility sessions, we're still giving out the device ID as a scope to Synapse, so that won't fly with a device ID that can't be represented that way.
To sidestep this, we now return the device ID as an explicit property in the introspection response.
This means the homeserver still has to adapt to this behaviour, so we can't just remove the device ID from the scope.
This is why we're introducing a header to the introspectio endpoint which lets the homeserver advertise its support for this behaviour.
Fixes #2724
Fixes #4027
Synapse PR: element-hq/synapse#18174