-
Notifications
You must be signed in to change notification settings - Fork 399
MSC2967: API scopes #2967
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
MSC2967: API scopes #2967
Conversation
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.
Don't use the word sudo
as we do not have a concept of superusers or substitute users in Matrix.
Related: matrix-org/matrix-spec#725 |
proposals/2967-api-scopes.md
Outdated
|
||
#### Device ID handling | ||
|
||
Presently a device ID is typically generated by the homeserver and is associated with a specific access token. In OAuth 2.0 there is no such thing as a session and so a mapping cannot be handled using the same mechanism. |
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.
Is this still true after refresh tokens (MSC2918)? I thought we did a bunch of work in Synapse related to this recently, but maybe I'm confusing different types of tokens.
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.
Technically yes, in practice no as MSC2918-style refresh tokens are almost not adopted by anyone. Is it worth clarifying here?
|
||
This MSC proposes that the Matrix client is responsible for generating/allocating a device ID. | ||
A client can create a new device ID by generating a random string and asking for its associated scope on login. | ||
A client can adopt and rehydrate an existing device ID by asking for its associated scope on login. |
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 think this needs some rationale for why we need/want to make this change?
I'm a bit hesitant moving the creation of IDs to clients, as it adds all sorts of edges cases that need to be addressed (clashes, incorrect grammar, etc) and means servers can't encode any information in the device ID (which we don't currently, but you could imagine would be useful).
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.
Talked out of band last Friday morning, and there sounds like there is a bunch of historical context here (that has since become mostly outdated). Conclusion was for @sandhose to comment with the background and a bit or a rationale, and then we can make a final call on whether we want device IDs to be generated on the client or server.
Something that I didn't realise is that the spec currently allows clients to generate device IDs when they log in (mostly for bots and the like).
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've explained why the change isn't bad in practice, and the historical context why it is like that in 082625d
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.
Is it possible for the homeserver to still generate a device ID if a urn:matrix:client:device:<device ID>
scope is omitted? Or would that be odd behaviour in the OAuth 2.0 world?
Having the ability for the homeserver to generate the device ID does make very simple matrix clients even simpler (no need to randomly generate a string). But I don't feel strongly that this behaviour must remain; it's only a nice-to-have.
Similarly, I recognise that it's useful for the client to provide a device ID upon login (for device rehydration and other use cases). So I'm happy to see that's still supported.
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.
Thanks for the explanation @sandhose. SCT had a discussion and I believe the conclusion was broadly that this is fine for now, there's not much reason to change it so late in the day.
|
||
This MSC proposes that the Matrix client is responsible for generating/allocating a device ID. | ||
A client can create a new device ID by generating a random string and asking for its associated scope on login. | ||
A client can adopt and rehydrate an existing device ID by asking for its associated scope on login. |
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.
Talked out of band last Friday morning, and there sounds like there is a bunch of historical context here (that has since become mostly outdated). Conclusion was for @sandhose to comment with the background and a bit or a rationale, and then we can make a final call on whether we want device IDs to be generated on the client or server.
Something that I didn't realise is that the spec currently allows clients to generate device IDs when they log in (mostly for bots and the like).
|
||
This MSC proposes that the Matrix client is responsible for generating/allocating a device ID. | ||
A client can create a new device ID by generating a random string and asking for its associated scope on login. | ||
A client can adopt and rehydrate an existing device ID by asking for its associated scope on login. |
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.
Is it possible for the homeserver to still generate a device ID if a urn:matrix:client:device:<device ID>
scope is omitted? Or would that be odd behaviour in the OAuth 2.0 world?
Having the ability for the homeserver to generate the device ID does make very simple matrix clients even simpler (no need to randomly generate a string). But I don't feel strongly that this behaviour must remain; it's only a nice-to-have.
Similarly, I recognise that it's useful for the client to provide a device ID upon login (for device rehydration and other use cases). So I'm happy to see that's still supported.
Co-authored-by: Andrew Morgan <[email protected]>
Co-authored-by: Patrick Cloke <[email protected]>
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. |
spec PR: matrix-org/matrix-spec#2149 |
Merged! 🎉 |
Rendered
urn:matrix
namespaceDependencies:
Implementations:
Homeservers
Homeservers:
urn:matrix:client:api:*
urn:matrix:client:device:XXXX
Clients
Clients need to request scopes appropriately.
urn:matrix:client:api:*
urn:matrix:client:device:XXXX
urn:matrix:client:api:*
urn:matrix:client:device:XXXX
urn:matrix:client:api:*
urn:matrix:client:device:XXXX
urn:matrix:client:api:*
urn:matrix:client:device:XXXX
SCT stuff:
checklist
FCP tickyboxes