osu-web icon indicating copy to clipboard operation
osu-web copied to clipboard

API scope requirement for chat announcement seems wrong

Open cl8n opened this issue 2 years ago • 4 comments

you need only chat.write_manage, which requests to "Join and leave channels on your behalf."

but posting a chat announcement includes sending the actual message too. I think it should require both chat.write and chat.write_manage.

cl8n avatar Oct 06 '23 04:10 cl8n

This is a weird one.

The other functionality of this endpoint is for joining PM channel despite the function being called "store". It doesn't even actually create the channel in that case.

Neither chat.write nor chat.write_manage say anything about creating channel but if anything, just chat.write_manage is the closest thing if we're to update the description of it being creating the channel (including everything that's required for it). I think the first message of announcement channel is kind of special anyway in sense it's part of the channel's identity.

nanaya avatar Sep 06 '24 13:09 nanaya

I guess I don't have a strong opinion on exactly which scopes should be required then, but yes the text on the authorize page needs to be clarified in some way. currently, it does not sound like you're authorizing to create announcements

cl8n avatar Sep 07 '24 02:09 cl8n

oh, and I think user group privileges aren't available for oauth by default...?

nanaya avatar Sep 07 '24 04:09 nanaya

oh, and I think user group privileges aren't available for oauth by default...?

except announce group, yes (User::isChatAnnouncer)

properly requesting to use certain group permissions over api is something I wanted to try as a prereq to #7441, but it would also be appropriate here. I wanted to do something like "Use your group privileges to [create a chat announcement]", which would allow the api client to perform all of the group checks within checkChatAnnounce, but nowhere else

cl8n avatar Sep 07 '24 06:09 cl8n