Browse Source
✨ Export OAuth2PasswordRequestFormStrict from security (#1462)
* Update __init__.py
Fixes an import error:
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestFormStrict
ImportError: cannot import name 'OAuth2PasswordRequestFormStrict'
* Simplify import of OAuth2PasswordRequestFormStrict
* Simplify import of OAuth2PasswordRequestFormStrict
pull/1576/head
Richard Hoekstra
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
3 additions and
4 deletions
-
fastapi/security/__init__.py
-
tests/test_security_oauth2.py
-
tests/test_security_oauth2_optional.py
|
@ -11,6 +11,7 @@ from .oauth2 import ( |
|
|
OAuth2AuthorizationCodeBearer, |
|
|
OAuth2AuthorizationCodeBearer, |
|
|
OAuth2PasswordBearer, |
|
|
OAuth2PasswordBearer, |
|
|
OAuth2PasswordRequestForm, |
|
|
OAuth2PasswordRequestForm, |
|
|
|
|
|
OAuth2PasswordRequestFormStrict, |
|
|
SecurityScopes, |
|
|
SecurityScopes, |
|
|
) |
|
|
) |
|
|
from .open_id_connect_url import OpenIdConnect |
|
|
from .open_id_connect_url import OpenIdConnect |
|
|
|
@ -1,7 +1,6 @@ |
|
|
import pytest |
|
|
import pytest |
|
|
from fastapi import Depends, FastAPI, Security |
|
|
from fastapi import Depends, FastAPI, Security |
|
|
from fastapi.security import OAuth2 |
|
|
from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict |
|
|
from fastapi.security.oauth2 import OAuth2PasswordRequestFormStrict |
|
|
|
|
|
from fastapi.testclient import TestClient |
|
|
from fastapi.testclient import TestClient |
|
|
from pydantic import BaseModel |
|
|
from pydantic import BaseModel |
|
|
|
|
|
|
|
|
|
@ -2,8 +2,7 @@ from typing import Optional |
|
|
|
|
|
|
|
|
import pytest |
|
|
import pytest |
|
|
from fastapi import Depends, FastAPI, Security |
|
|
from fastapi import Depends, FastAPI, Security |
|
|
from fastapi.security import OAuth2 |
|
|
from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict |
|
|
from fastapi.security.oauth2 import OAuth2PasswordRequestFormStrict |
|
|
|
|
|
from fastapi.testclient import TestClient |
|
|
from fastapi.testclient import TestClient |
|
|
from pydantic import BaseModel |
|
|
from pydantic import BaseModel |
|
|
|
|
|
|
|
|