!JiiOHXrIUCtcOJsZCa:matrix.org

nio

341 Members
The nio matrix python library | Latest stable release 0.25.2 | https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/132 Servers

Load older messages


SenderMessageTime
5 Sep 2024
@nex:nexy7574.co.uknex (she/it)afaik, the parameter is only deprecated, not slated for removal19:57:46
@nex:nexy7574.co.uknex (she/it) so, from what I can tell, we aren't in hot water yet 19:57:58
@nex:nexy7574.co.uknex (she/it)but its very much one of those things that could change at any time19:58:06
@nex:nexy7574.co.uknex (she/it)The difficulty comes in finding a solution that breaks the least number of downstream projects19:58:26
@nex:nexy7574.co.uknex (she/it)Sorry, I linked to the wrong issue19:58:47
@nex:nexy7574.co.uknex (she/it)https://github.com/matrix-nio/matrix-nio/issues/51119:58:55
@timegrid:matrix.c3s.ccAlexthx, i already found it19:58:59
@nex:nexy7574.co.uknex (she/it)511 is the query string issue19:58:59
@timegrid:matrix.c3s.ccAlex

removal seems to be pending, but i don't know where to look for timelines. the proposed solution in that ticket was what i thought of after looking into the code. i'm just a bit afraid, that the removal will suprize me like the authed content ^^ in any case, thx for the PR

20:04:31
@nex:nexy7574.co.uknex (she/it)Auth media really does feel like it just came out of nowhere lol20:05:16
@nex:nexy7574.co.uknex (she/it)
In reply to@timegrid:matrix.c3s.cc

removal seems to be pending, but i don't know where to look for timelines. the proposed solution in that ticket was what i thought of after looking into the code. i'm just a bit afraid, that the removal will suprize me like the authed content ^^ in any case, thx for the PR

Yeah just confirmed, when MSC4127 is merged, that's when they become fully removed, not just depreacted
20:09:32
@nex:nexy7574.co.uknex (she/it)However, it also looks like none of the key people have proposed merging it yet, so there's still some time20:12:24
@timegrid:matrix.c3s.ccAlexthx for checking, i hope you are right :)21:06:00
6 Sep 2024
@timegrid:matrix.c3s.ccAlex

nex (she/it): i think there's still a bug in mxc_to_http. im the moment client, when i copy some image url in an unencrypted chat, the homeserver part is missing.
formerly the link was e.g. https://matrix-client.matrix.org/_matrix/media/v3/download/matrix.org/jWejjMToIAwRXmAChJApoyjc
now it's /_matrix/media/v3/download/matrix.org/jWejjMToIAwRXmAChJApoyjc?access_token=[...]
i could look it up, how moment calls nio, but i think it has to be in mxc_to_http

17:43:39
@timegrid:matrix.c3s.ccAlex

it's due to calling _build_path, this won't prefix the server part

17:48:32
@timegrid:matrix.c3s.ccAlex

if mcx_to_http is just a helper function to convert matrix content URIs for sharing purposes, one could argue, that it should better not leak the authentication_token at all though. of course clients could use it in a different way

18:03:55
@timegrid:matrix.c3s.ccAlex

moment for example also uses the function to fetch the url of the avatars, which would break without access_token. probably i'd just remove the image sharing function to prevent its leakage, which will be obsolete anyway then. just as a reminder, that the query parameter issue might be more severe (ppl are used to just copy and paste the url) and clients might need to take action to protect their users

19:08:46
7 Sep 2024
@nex:nexy7574.co.uknex (she/it)
In reply to@timegrid:matrix.c3s.cc

if mcx_to_http is just a helper function to convert matrix content URIs for sharing purposes, one could argue, that it should better not leak the authentication_token at all though. of course clients could use it in a different way

No you're right, it is meant to return the domain too
12:22:42
@nex:nexy7574.co.uknex (she/it)I forgot that build_path does just the path, I thought it also included the domain lol12:22:55
@nex:nexy7574.co.uknex (she/it)Will patch that now12:22:57
@nex:nexy7574.co.uknex (she/it)as for the token leak - this is the reason it's deprecated. Unfortunately, until #511 gets dealt with, not much can be done about that, and people will just have to exercise caution. Perhaps a warning.warn(UserWarning) or something like that would be appropriate, for the time being?12:23:43
@nex:nexy7574.co.uknex (she/it) @Alex Has the use of encrypted_mxc_to_plumb come up in your testing at all? It has just dawned on me that I'm not entirely sure how the access token is meant to be passed to it, since I've never encountered it myself 12:36:03
@timegrid:matrix.c3s.ccAlex
In reply to @nex:nexy7574.co.uk
@Alex Has the use of encrypted_mxc_to_plumb come up in your testing at all? It has just dawned on me that I'm not entirely sure how the access token is meant to be passed to it, since I've never encountered it myself

no, the function is not used anywhere in nio and neither in moment

12:45:18
@timegrid:matrix.c3s.ccAlex
In reply to @nex:nexy7574.co.uk
as for the token leak - this is the reason it's deprecated. Unfortunately, until #511 gets dealt with, not much can be done about that, and people will just have to exercise caution. Perhaps a warning.warn(UserWarning) or something like that would be appropriate, for the time being?

i know it won't fix soon. in this case, the main problem is, that formerly the media url was meant to be shared. i don't know, but assume that nio is also used for many bots/bridges, which might share the images via the url of mcx_to_http. communication is important at least. a sufficently highlighted entry in the changelog (also that it's breaking media on older servers). some log message might help, too, sure. on the other hand, the nio version might be not controllable by the client devs (system packages) and they might not be aware. to be safe, one could also add a flag for a while to enable the new behaviour, which needs to explicitly switched on, so the responsibilty shifts to the client devs. not sure, if that makes sense though

13:15:50
@timegrid:matrix.c3s.ccAlex

for moment it will be ok, i already made an MR to remove the sharing functionality. i'm just thinking of the others

13:17:59
@nex:nexy7574.co.uknex (she/it)See, in the context of bridges, they've got to just find another way to share the media, usually by proxying it themselves. For example, the mautrix-discord bridge requires that you expose part of the appservice to a reverse proxy in order to get matrix avatars to show in the discord webhooks. If the access token is stripped from these URLs, without viewing them from a logged in client, sharing them wouldn't work anyway13:44:21
@nex:nexy7574.co.uknex (she/it)I apologise if that sounds stubborn but I don't see a way that directly sharing the resulting HTTP URL can be useful in many cases anymore for home servers with authenticated media13:44:53
@nex:nexy7574.co.uknex (she/it)A flag to force unauthenticated media is definitely an option though, although mileage may vary regardless13:45:47
@nex:nexy7574.co.uknex (she/it)Honestly, might it be worth considering #511 a blocker for this, given the security implications? Rather than trying to hack a way around it?13:46:48
@tulir:maunium.nettulirwhy don't you just add the header in the send function that makes the http request, rather than immediately making breaking changes and refactoring all methods to return a map of headers?13:51:55

Show newer messages


Back to Room ListRoom Version: 4