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 credentials property to Request objects #2357

Merged
merged 10 commits into from Jan 6, 2022

Conversation

SerGeRybakov
Copy link
Contributor

Credentials logics refactored.

Anytime there shall be _auth_type and token fields. Just in case of _auth_type == 'Basic' Credentials shall autocreate decoded (parsed) _username and _password fields, which can be reached by properties username and password.
If _auth_type != 'Basic' properties username and password raise AttributeError with correspondent message.

@SerGeRybakov SerGeRybakov requested a review from a team as a code owner January 5, 2022 08:29
@ahopkins
Copy link
Member

ahopkins commented Jan 5, 2022

#2346

@ahopkins ahopkins changed the title Credentials Add credentials property to Request objects Jan 5, 2022
sanic/request.py Outdated Show resolved Hide resolved
sanic/request.py Outdated Show resolved Hide resolved
sanic/request.py Outdated Show resolved Hide resolved
sanic/request.py Outdated Show resolved Hide resolved
sanic/request.py Outdated Show resolved Hide resolved
Copy link
Member

@ahopkins ahopkins left a comment

Choose a reason for hiding this comment

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

Looking good 💪

sanic/models/http_types.py Outdated Show resolved Hide resolved
sanic/models/http_types.py Outdated Show resolved Hide resolved
tests/test_requests.py Outdated Show resolved Hide resolved
ahopkins
ahopkins previously approved these changes Jan 6, 2022
@ahopkins ahopkins merged commit 101151b into sanic-org:main Jan 6, 2022
ChihweiLHBird pushed a commit to ChihweiLHBird/sanic that referenced this pull request Jun 1, 2022
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.

None yet

2 participants