Skip to content

Fix some API calls with personal tokens #5627

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

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

ThiefMaster
Copy link
Member

When accessing APIs returning speaker information determining the sort order for speakers accesses session.user (as display_full_name uses a user preference), but doing so from an API call results in a call to get_request_user which does not know about the API and thus does another oauth scope check for the everything scopes, which fails if the token used to authenticate the API call doesn't have that scope.

The workaround (considering that the API is legacy) is to always return "no user" since legacy API calls are not really considered in the context of a user (except for access checks) anyway.

When accessing APIs returning speaker information determining the sort
order for speakers accesses `session.user` (as `display_full_name`
uses a user preference), but doing so from an API call results in a call
to `get_request_user` which does not know about the API and thus does
another oauth scope check for the `everything` scopes, which fails if
the token used to authenticate the API call doesn't have that scope.

The workaround (considering that the API is legacy) is to always return
"no user" since legacy API calls are not really considered in the context
of a user (except for access checks) anyway.
@ThiefMaster ThiefMaster added this to the v3.2 milestone Jan 18, 2023
@ThiefMaster ThiefMaster enabled auto-merge (rebase) January 18, 2023 12:02
@ThiefMaster ThiefMaster merged commit f0cbecb into indico:master Jan 18, 2023
@ThiefMaster ThiefMaster deleted the fix-api-token-error branch January 18, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant