This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
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.
add support for handling avatar with SSO login #13917
add support for handling avatar with SSO login #13917
Changes from 2 commits
6c67c5a
0fd47d1
546ea47
4d74943
d7285f7
f1767d2
670237c
879f8ad
c6de28d
93662ee
586170d
6915096
25d2594
b343a43
07cbe39
f4c1d39
1594a3f
3a18057
06bbd44
93ffe6a
e432b53
669c7b0
f5379ed
fb823f5
b51b4f8
adf0640
225be62
dfd26f0
11ff1b4
1592d43
c15e873
c0861f8
7ff3320
70d3cb5
5271480
e691a91
7101fc0
2d46136
b034ee3
6d370b7
e2cc4bf
966edfd
19a417d
ef9af82
0714752
ecdfe1a
465bade
2f1819c
006800f
4a78052
b1b0a91
b710023
f118e8b
751855c
1ef48dd
f815f3b
fe8e1ba
a973e75
7e165f4
2da03c2
7a29b06
4ebb1db
104eef8
1e87ac4
0526ec2
68eaef7
49937c8
5542a0f
d00385c
a81b0f7
9a89e9f
00af833
1a37d82
8746b66
5ac6092
81d834b
b32c2f7
a14eea5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We should use the API instead of calling synapse internal code here, since the media repository can be outside of synapse, cf https://github.com/turt2live/matrix-media-repo.
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.
Following a talk on #synapse-dev, some more details:
/upload
. For that I think we can inject a temporary access token in synapse, do the upload with that, and then delete this temporary token.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.
Hrm, tricky. On the one hand, we'll have to use the public API for integration with matrix-media-repo. On the other hand:
I think I agree that using the public API is the least bad, but as @dklimpel says, please make sure this new requirement is clearly documented.
(Also, if the media repo is in-process, we should go direct.)
Whatever happens, please put it in a separate "add this media to the media repo" function, rather than embedding it all in the SSO handler.
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.
Ugh. That sounds like a great way for us to end up with unused access tokens.
No, I'm changing my mind here. We need a hybrid approach:
We'll need to carefully consider what the configuration settings look like to make sure it is consistent with the other settings, and isn't limited to the SSO usecase.
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 for now we just do the "in-process" solution (ie, not support it on worker-based deployments) and then extend it to the other mechanisms in later PRs?
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.
@richvdh Would you say this "in-process" solution is equivalent to how its currently being done via
self.media_repo.create_content()
call? I am not sure what should I try to do here.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.
Yes. We need to:
set_avatar
in the first place if we are not on the main process, or if we're using an external media repo.The first bullet is the most important. I'm not completely sure how to do the second bullet off the top of my head.