-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Chatroom 'affiliation' URL template clash #146
Comments
guusdk
added a commit
to guusdk/openfire-restAPI-plugin
that referenced
this issue
Aug 4, 2022
The fix for issue igniterealtime#141 introduces a template to replace four distinct URL patterns: - `/restapi/v1/chatrooms/{roomName}/owners` - `/restapi/v1/chatrooms/{roomName}/admins` - `/restapi/v1/chatrooms/{roomName}/members` - `/restapi/v1/chatrooms/{roomName}/outcasts` got replaced by - `/restapi/v1/chatrooms/{roomName}/{affiliation}` Sadly, this template matches more than just those four. URLs like these also get caught, making them misbehave: - `/restapi/v1/chatrooms/{roomName}/chathistory` - `/restapi/v1/chatrooms/{roomName}/occupants` - `/restapi/v1/chatrooms/{roomName}/participants` - `/restapi/v1/chatrooms/{roomName}/invite` This commit fixes the problem by applying a regular expression to the `{affiliation}` template, requiring it to match one of four distinct options.
guusdk
added a commit
to guusdk/openfire-restAPI-plugin
that referenced
this issue
Aug 4, 2022
The fix for issue igniterealtime#141 introduces a template to replace four distinct URL patterns: - `/restapi/v1/chatrooms/{roomName}/owners` - `/restapi/v1/chatrooms/{roomName}/admins` - `/restapi/v1/chatrooms/{roomName}/members` - `/restapi/v1/chatrooms/{roomName}/outcasts` got replaced by - `/restapi/v1/chatrooms/{roomName}/{affiliation}` Sadly, this template matches more than just those four. URLs like these also get caught, making them misbehave: - `/restapi/v1/chatrooms/{roomName}/chathistory` - `/restapi/v1/chatrooms/{roomName}/occupants` - `/restapi/v1/chatrooms/{roomName}/participants` - `/restapi/v1/chatrooms/{roomName}/invite` This commit fixes the problem by applying a regular expression to the `{affiliation}` template, requiring it to match one of four distinct options.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With #141, which was part of release 1.9.0, these endpoints (and their sub-resources):
/restapi/v1/chatrooms/{roomName}/owners
/restapi/v1/chatrooms/{roomName}/admins
/restapi/v1/chatrooms/{roomName}/members
/restapi/v1/chatrooms/{roomName}/outcasts
got replaced by one generic endpoint (and sub-resources):
/restapi/v1/chatrooms/{roomName}/{affiliation}
Sadly, this new template clashes with other, unrelated endpoints, including:
/restapi/v1/chatrooms/{roomName}/chathistory
/restapi/v1/chatrooms/{roomName}/occupants
/restapi/v1/chatrooms/{roomName}/participants
/restapi/v1/chatrooms/{roomName}/invite
The fix for #141 makes these return an 400 response, stating that
chathistory
,occupants
,participants
orinvite
is not a valid affiliation value.The text was updated successfully, but these errors were encountered: