Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Escape eventIds in CS API requests #2934

Closed
manuroe opened this issue Feb 8, 2019 · 3 comments
Closed

Escape eventIds in CS API requests #2934

manuroe opened this issue Feb 8, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@manuroe
Copy link
Member

manuroe commented Feb 8, 2019

@manuroe commented on Fri Feb 08 2019

Event IDs in room version 3 can now include hashes in them according to MSC1659.

APIs that must be checked:

/admin/purge_history/(?P<room_id>[^/]*)(/(?P<event_id>[^/]+))?
/events/(?P<event_id>[^/]*)$
/rooms/(?P<room_id>[^/]*)/report/(?P<event_id>[^/]*)$
/rooms/(?P<room_id>[^/]*)/event/(?P<event_id>[^/]*)$
/rooms/(?P<room_id>[^/]*)/context/(?P<event_id>[^/]*)$
/rooms/(?P<room_id>[^/]*)/redact/(?P<event_id>[^/]*)
/rooms/(?P<room_id>[^/]*)/receipt/(?P<receipt_type>[^/]*)/(?P<event_id>[^/]*)$

@manuroe manuroe added this to the Sprint 18 bis milestone Feb 8, 2019
@manuroe manuroe added the P1 label Feb 8, 2019
@ganfra
Copy link
Member

ganfra commented Feb 11, 2019

By default Path parameters are already escaped by retrofit:
https://square.github.io/retrofit/2.x/retrofit/index.html?retrofit2/http/Path.html

@manuroe manuroe closed this as completed Feb 11, 2019
@manuroe manuroe reopened this Feb 13, 2019
@manuroe
Copy link
Member Author

manuroe commented Feb 13, 2019

Because of #2947, could we double-check please?

On iOS, I ended to port the js encodeURIComponent to have the expected behavior.

Also, MXPatterns.isEventId() must support v3 event ids that looks like $pmOSN/DognfuSfhdW/qivXT19lfCWpdSfaPFKDBTJUk+ (iOS commit: matrix-org/matrix-ios-sdk@454a3fc?utf8=%E2%9C%93&diff=split&w=1)

@bmarty
Copy link
Member

bmarty commented Feb 18, 2019

Double check done :)

@bmarty bmarty closed this as completed Feb 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants