-
-
Notifications
You must be signed in to change notification settings - Fork 590
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
Use the v2 (hashed) lookup for identity server queries #1021
Conversation
Fixes element-hq/element-web#10556 Implements [MSC2134](matrix-org/matrix-spec-proposals#2134) with assistance from [MSC2140](matrix-org/matrix-spec-proposals#2140) for auth. Note: this also changes all identity server requests to use JSON as a request body. URL encoded forms were allowed in v1 but deprecated in favour of JSON. v2 APIs do not allow URL encoded forms.
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.
Looks great, thanks for working on this! 😁
@@ -412,7 +412,7 @@ module.exports.MatrixHttpApi.prototype = { | |||
if (method == 'GET') { | |||
opts.qs = params; | |||
} else if (typeof params === "object") { | |||
opts.form = params; | |||
opts.json = params; | |||
} else if (typeof params === "string") { | |||
// Assume the caller has serialised the body to JSON |
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 to remove this branch and all the places where I plopped JSON.stringify(params)
in idServerRequest
call sites? Your approach with opts.json
seems much more sane, so it'd be nice to just do that everywhere...
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 can do that in a different PR, I'd rather not make this diff any harder to read if I can avoid it
Fixes element-hq/element-web#10556
Implements MSC2134 with assistance from MSC2140 for auth.
Note: this also changes all identity server requests to use JSON as a request body. URL encoded forms were allowed in v1 but deprecated in favour of JSON. v2 APIs do not allow URL encoded forms.