Skip to content

Commit 5e75bcd

Browse files
authored
bump to 4.2.2 (#34)
* bump to 4.2.2 * make sure CI tests use the latest propelauth-py version * fix tests to work w/ new propelauth_py * matt messed up the requirements syntax * remove test that is now useless
1 parent b44b7b5 commit 5e75bcd

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fastapi
2-
propelauth-py
2+
propelauth-py==4.2.2
33
pytest
44
requests-mock
55
httpx

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
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",
@@ -21,7 +21,7 @@
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",

tests/conftest.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
from starlette.responses import PlainTextResponse
1111

1212
from 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

1417
TestRsaKeys = namedtuple("TestRsaKeys", ["public_pem", "private_pem"])
1518

@@ -79,8 +82,11 @@ async def read_main(current_user: Optional[User] = Depends(auth.optional_user)):
7982
def 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)

tests/test_init_auth.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff 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-
2518
def test_init_failure_raises():
2619
with pytest.raises(ValueError):
2720
mock_api_and_init_auth(BASE_AUTH_URL, 400, {})

0 commit comments

Comments
 (0)