File tree Expand file tree Collapse file tree 4 files changed +11
-12
lines changed
Expand file tree Collapse file tree 4 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 11fastapi
2- propelauth-py
2+ propelauth-py == 4.2.2
33pytest
44requests-mock
55httpx
Original file line number Diff line number Diff line change 1212
1313setup (
1414 name = "propelauth-fastapi" ,
15- version = "4.2.0 " ,
15+ version = "4.2.2 " ,
1616 description = "A FastAPI library for managing authentication, backed by PropelAuth" ,
1717 long_description = README ,
1818 long_description_content_type = "text/markdown" ,
2121 author = "PropelAuth" ,
2222 author_email = "support@propelauth.com" ,
2323 license = "MIT" ,
24- install_requires = ["propelauth-py==4.2.0 " , "requests" ],
24+ install_requires = ["propelauth-py==4.2.2 " , "requests" ],
2525 setup_requires = pytest_runner ,
2626 tests_require = ["pytest==4.4.1" ],
2727 test_suite = "tests" ,
Original file line number Diff line number Diff line change 1010from starlette .responses import PlainTextResponse
1111
1212from propelauth_fastapi import init_auth , User
13+ from propelauth_py .api import BACKEND_API_BASE_URL as BASE_INTERNAL_API_URL
14+ from propelauth_py .validation import _validate_and_extract_auth_hostname
15+
1316
1417TestRsaKeys = namedtuple ("TestRsaKeys" , ["public_pem" , "private_pem" ])
1518
@@ -79,8 +82,11 @@ async def read_main(current_user: Optional[User] = Depends(auth.optional_user)):
7982def mock_api_and_init_auth (auth_url , status_code , json ):
8083 with requests_mock .Mocker () as m :
8184 api_key = "api_key"
82- m .get (BASE_AUTH_URL + "/api/v1/token_verification_metadata" ,
83- request_headers = {'Authorization' : 'Bearer ' + api_key },
85+ m .get (BASE_INTERNAL_API_URL + "/api/v1/token_verification_metadata" ,
86+ request_headers = {
87+ 'Authorization' : 'Bearer ' + api_key ,
88+ 'X-Propelauth-url' : _validate_and_extract_auth_hostname (auth_url )
89+ },
8490 json = json ,
8591 status_code = status_code )
8692 return init_auth (auth_url , api_key )
Original file line number Diff line number Diff line change @@ -15,13 +15,6 @@ def test_init_with_slash(rsa_keys):
1515 })
1616
1717
18- def test_init_with_http_fails (rsa_keys ):
19- with pytest .raises (ValueError ):
20- mock_api_and_init_auth (HTTP_BASE_AUTH_URL , 200 , {
21- "verifier_key_pem" : rsa_keys .public_pem
22- })
23-
24-
2518def test_init_failure_raises ():
2619 with pytest .raises (ValueError ):
2720 mock_api_and_init_auth (BASE_AUTH_URL , 400 , {})
You can’t perform that action at this time.
0 commit comments