Skip to content
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

Merged
merged 6 commits into from
Aug 22, 2019

Conversation

turt2live
Copy link
Member

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.

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.
@turt2live turt2live requested a review from a team August 21, 2019 20:34
@jryans jryans requested review from jryans and removed request for a team August 22, 2019 12:47
Copy link
Collaborator

@jryans jryans left a 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
Copy link
Collaborator

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...

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use the hashed v2 lookup API for 3PIDs
2 participants