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

Add sudo support for auth tokens #3604

Merged
merged 1 commit into from Jun 28, 2016
Merged

Add sudo support for auth tokens #3604

merged 1 commit into from Jun 28, 2016

Conversation

mitsuhiko
Copy link
Member

@mitsuhiko mitsuhiko commented Jun 28, 2016

This fixes #3525

@mitsuhiko mitsuhiko changed the title Remember used 2FA OTP tokens Add sudo support for auth tokens Jun 28, 2016


def is_considered_sudo(request):
return request.is_sudo() or \
isinstance(request.auth, ApiKey)
isinstance(request.auth, ApiKey) or \
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just isinstance(request.auth, (ApiKey, ApiToken))?

Copy link
Member Author

Choose a reason for hiding this comment

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

No good reason. Originally because i did (isinstance(request.auth, ApiToken) && request.auth.user is None) but that does not actually work :D

@mattrobenolt
Copy link
Contributor

🍪

@mitsuhiko mitsuhiko merged commit 410581a into master Jun 28, 2016
@dcramer dcramer deleted the feature/sudo-tokens branch August 30, 2016 04:51
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Auth Tokens cannot pass sudo check
2 participants