You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to:
- https://matrix.org/blog/2021/11/09/matrix-v-1-1-release
- matrix-org/synapse#11318
- spantaleev/matrix-docker-ansible-deploy#1404
The upcoming Synapse v1.48.0 release is likely to expose all these `r0`
APIs that we've used till now as `v3` APIs. Both the `r0` and `v3`
prefixes lead to the same APIs on the homeserver.
matrix-corporal 2.1.5 already properly handles rejecting unknown
v-prefixed versions (`v3` included), which patched a potential future
security vulnerability (when Synapse v1.48.0 ultimately gets released).
This patch adds to it and lets `v3` requests go through and get handled
the same way `r0` requests are handled.
// The 2nd solution doesn't work as well, because some APIs (`GET /_matrix/client/r0/pushrules/`) require a trailing slash.
58
+
// The 2nd solution doesn't work as well, because some APIs (`GET /_matrix/client/{apiVersion:(?:r0|v\d+)}/pushrules/`) require a trailing slash.
59
59
// Removing the trailing slash on our side and forwarding the request to the homeserver results in `{"errcode":"M_UNRECOGNIZED","error":"Unrecognized request"}`.
60
60
//
61
61
// Instead of trying to whitelist routes that require a slash and potentially missing something,
// ApiJoinedGroupsResponse is a response as found at: GET /_matrix/client/r0/joined_groups
70
+
// ApiJoinedGroupsResponse is a response as found at: GET /_matrix/client/{apiVersion:(r0|v3)}/joined_groups
71
71
typeApiJoinedGroupsResponsestruct {
72
72
GroupIds []string`json:"groups"`
73
73
}
74
74
75
-
// ApiAdminRegisterNonceResponse is a response as found at: GET /_matrix/client/r0/admin/register
75
+
// ApiAdminRegisterNonceResponse is a response as found at: GET /_matrix/client/{apiVersion:(r0|v3)}/admin/register
76
76
typeApiUserAccountRegisterNonceResponsestruct {
77
77
Noncestring`json:"nonce"`
78
78
}
79
79
80
-
// ApiUserAccountRegisterRequestPayload is a request payload for: POST /_matrix/client/r0/admin/register
80
+
// ApiUserAccountRegisterRequestPayload is a request payload for: POST /_matrix/client/{apiVersion:(r0|v3)}/admin/register
81
81
typeApiUserAccountRegisterRequestPayloadstruct {
82
82
Noncestring`json:"nonce"`
83
83
Usernamestring`json:"username"`
@@ -87,19 +87,19 @@ type ApiUserAccountRegisterRequestPayload struct {
87
87
Adminbool`json:"admin"`
88
88
}
89
89
90
-
// ApiUserAccountRegisterResponse is a response as found at: POST /_matrix/client/r0/admin/register
90
+
// ApiUserAccountRegisterResponse is a response as found at: POST /_matrix/client/{apiVersion:(r0|v3)}/admin/register
91
91
typeApiUserAccountRegisterResponsestruct {
92
92
AccessTokenstring`json:"access_token"`
93
93
HomeServerstring`json:"home_server"`
94
94
UserIdstring`json:"user_id"`
95
95
}
96
96
97
-
// ApiCommunityInviteResponse is a response as found at: POST /_matrix/client/r0/groups/{communityId}/admin/users/invite/<invitee-id>
97
+
// ApiCommunityInviteResponse is a response as found at: POST /_matrix/client/{apiVersion:(r0|v3)}/groups/{communityId}/admin/users/invite/<invitee-id>
98
98
typeApiCommunityInviteResponsestruct {
99
99
Statestring`json:"state"`
100
100
}
101
101
102
-
// ApiCommunityInvitedUsersResponse is a response as found at: GET /_matrix/client/r0/groups/{communityId}/invited_users
102
+
// ApiCommunityInvitedUsersResponse is a response as found at: GET /_matrix/client/{apiVersion:(r0|v3)}/groups/{communityId}/invited_users
0 commit comments