Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Cannot import ''OAuth2PasswordRequestFormStrict''#1462

Merged
tiangolo merged 3 commits intofastapi:masterfrom
RichardHoekstra:patch-1
Jun 13, 2020
Merged

Cannot import ''OAuth2PasswordRequestFormStrict''#1462
tiangolo merged 3 commits intofastapi:masterfrom
RichardHoekstra:patch-1

Conversation

@RichardHoekstra
Copy link
Contributor

@RichardHoekstraRichardHoekstra commentedMay 23, 2020
edited
Loading

Fixes an import error:

from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestFormStrict
ImportError: cannot import name 'OAuth2PasswordRequestFormStrict'

Currently using the workaround:
from fastapi.security.oauth2 import OAuth2PasswordRequestFormStrict

Not sure whether the maintainers intended for the import to be different from the rest of the security imports. I assume this is a simple oversight.

Fixes an import error:     from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestFormStrictImportError: cannot import name 'OAuth2PasswordRequestFormStrict'
@RichardHoekstraRichardHoekstra changed the titleUpdate __init__.pyCannot import ''OAuth2PasswordRequestFormStrict''May 23, 2020
@codecov
Copy link

codecovbot commentedMay 23, 2020
edited
Loading

Codecov Report

Merging#1462 intomaster willnot change coverage.
The diff coverage is100.00%.

Impacted file tree graph

@@            Coverage Diff            @@##            master     #1462   +/-   ##=========================================  Coverage   100.00%   100.00%           =========================================  Files          227       227             Lines         6807      6808    +1     =========================================+ Hits          6807      6808    +1
Impacted FilesCoverage Δ
fastapi/security/__init__.py100.00% <ø> (ø)
tests/test_security_oauth2.py100.00% <100.00%> (ø)
tests/test_security_oauth2_optional.py100.00% <100.00%> (ø)
fastapi/utils.py100.00% <0.00%> (ø)
fastapi/openapi/utils.py100.00% <0.00%> (ø)
fastapi/dependencies/utils.py100.00% <0.00%> (ø)
...test_tutorial/test_path_params/test_tutorial005.py100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update98bb9f1...694cb3e. Read thecomment docs.

@phy25
Copy link

You may also want to change the corresponding documentation as well.

@RichardHoekstra
Copy link
ContributorAuthor

You may also want to change the corresponding documentation as well.

I would but I don't know what corresponds.

@phy25
Copy link

@ghost
Copy link

I always found it weird that the strict version was not exported, I think this is a good improvement. 👍

@tiangolotiangolo merged commitbd2acbc intofastapi:masterJun 13, 2020
@tiangolo
Copy link
Member

Thanks for your contribution@RichardHoekstra ! 🚀

So, it was actually intentional, I would expect (and suggest) everyone to use the non-strict version, as the strict version enforces clients to send a constant value doesn't add much, as it's just a constant.

Because of that, I didn't expose it directly.

But... I think this is like the 3th PR suggesting that change 😂

So I guess it's gonna be more intuitive if it's just there even though I don't expect many people to use it.

Thanks for the review@phy25 ! 🙇

RichardHoekstra reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@RichardHoekstra@phy25@tiangolo

[8]ページ先頭

©2009-2026 Movatter.jp