Skip to content
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

MBS-13057 / MBS-13058: Improve the application/revoke-access page #2934

Merged
merged 3 commits into from Jul 24, 2023

Conversation

reosarevok
Copy link
Member

@reosarevok reosarevok commented May 8, 2023

MBS-13057 / MBS-13058

Problem

Right now once the user clicks through to the revoke-access page, there's no longer any info printed about what access they are revoking.

The user is expected to click blindly to revoke access to whatever it is and might end up revoking the wrong thing if they misclicked in the applications page.

Additionally, the user can modify the URL to end up trying to revoke something completely different (which is more likely to ISE than not since it will ISE unless they guess an existing application ID and scope for their tokens).

Solution

This just lists the application name and its permissions when asking for confirmation for the revoking.

For the made-up URLs ISE, given we already have the check_granted_token method which takes the same parameters, we can check whether there's something to delete before we render the form. I chose a basic 404 error with custom message rather than a NotFound page because the only way a user should get here anyway is if they edit the URL by hand so it's probably not worth a better error really.

Testing

Manually, making sure the page 404s when it should and displays the app/permission data when it shouldn't (before/after for that below).

Screenshot from 2023-05-08 18-07-00
image_2023-07-24_225903016

Notes

The first commit renames the files (and one component) under /applications because as one of the first sets of files converted to React they didn't match the way we usually do this elsewhere nowadays.

@reosarevok reosarevok added the QoL Non-urgent quality of life improvements label May 8, 2023
@reosarevok
Copy link
Member Author

@brainzbot, retest this please

Copy link
Contributor

@yvanzo yvanzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the list of permissions somehow more readable.

lib/MusicBrainz/Server/Controller/Account.pm Show resolved Hide resolved
root/account/applications/RevokeApplicationAccess.js Outdated Show resolved Hide resolved
root/account/applications/RevokeApplicationAccess.js Outdated Show resolved Hide resolved
This also renames "Index" to "ApplicationList" for consistency
with other folders where there's a List component to list multiple X
and an Index component to show data about each specific X.
We do not yet have this for applications, but might eventually want it.
Right now you can enter whatever integers in the revoke-access URL
and it will try to revoke your token for that application and scope.
Obviously, that's unlikely to exist, and PSQL fails, causing an ISE.

Given we already have the check_granted_token method
which takes the same parameters, we can check
whether there's something to delete before we render the form.
I chose a basic 404 error with custom message rather than
a NotFound page because the only way a user should get here anyway is
if they edit the URL by hand or reopen a tab revoking
an already revoked token.
Right now once the user clicks through to the revoke-access page,
there's no longer any info printed about what access they are revoking.
The user is expected to click blindly to revoke access to whatever it is
and might end up revoking the wrong thing if they misclicked
in the applications page.

This just lists the application name and its permissions
when asking for confirmation for the revoking.
Copy link
Contributor

@yvanzo yvanzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🚢

@reosarevok reosarevok merged commit e4c7ef0 into metabrainz:master Jul 24, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QoL Non-urgent quality of life improvements
Projects
None yet
2 participants