Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.7k
Comments
Cannot import ''OAuth2PasswordRequestFormStrict''#1462
Cannot import ''OAuth2PasswordRequestFormStrict''#1462tiangolo merged 3 commits intofastapi:masterfrom
Conversation
Fixes an import error: from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestFormStrictImportError: cannot import name 'OAuth2PasswordRequestFormStrict'
codecovbot commentedMay 23, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## master #1462 +/- ##========================================= Coverage 100.00% 100.00% ========================================= Files 227 227 Lines 6807 6808 +1 =========================================+ Hits 6807 6808 +1
Continue to review full report at Codecov.
|
phy25 commentedMay 23, 2020
You may also want to change the corresponding documentation as well. |
RichardHoekstra commentedMay 24, 2020
I would but I don't know what corresponds. |
ghost commentedJun 4, 2020
I always found it weird that the strict version was not exported, I think this is a good improvement. 👍 |
tiangolo commentedJun 13, 2020
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 ! 🙇 |
Uh oh!
There was an error while loading.Please reload this page.
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.