Skip to content

Commit

Permalink
Update dependency on propelauth-py for metadata changes (#3)
Browse files Browse the repository at this point in the history
* Update dependency on propelauth-py for metadata changes

* Fix build by switching to ubuntu-latest
  • Loading branch information
andrew-propelauth authored Apr 21, 2023
1 parent 795fdb9 commit 701f95d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
build-n-publish:
name: Build and publish
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: push
jobs:
build-n-test:
name: Build and test
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
Expand Down
2 changes: 2 additions & 0 deletions propelauth_fastapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def _handle_forbidden_exception(e: ForbiddenException, debug_mode: bool):
"update_user_password",
"create_magic_link", "create_access_token",
"migrate_user_from_external_source", "create_org", "add_user_to_org",
"update_org_metadata",
"delete_user", "disable_user", "enable_user",
"allow_org_to_setup_saml_connection", "disallow_org_to_setup_saml_connection"
])
Expand Down Expand Up @@ -161,6 +162,7 @@ def init_auth(auth_url: str, api_key: str, token_verification_metadata: TokenVer
migrate_user_from_external_source=auth.migrate_user_from_external_source,
create_org=auth.create_org,
add_user_to_org=auth.add_user_to_org,
update_org_metadata=auth.update_org_metadata,
enable_user=auth.enable_user,
disable_user=auth.disable_user,
delete_user=auth.delete_user,
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="propelauth-fastapi",
version="2.0.2",
version="2.1.0",
description="A FastAPI library for managing authentication, backed by PropelAuth",
long_description=README,
long_description_content_type="text/markdown",
Expand All @@ -20,7 +20,7 @@
author="PropelAuth",
author_email="support@propelauth.com",
license="MIT",
install_requires=["propelauth-py==3.0.3", "requests"],
install_requires=["propelauth-py==3.1.0", "requests"],
setup_requires=pytest_runner,
tests_require=["pytest==4.4.1"],
test_suite="tests",
Expand Down
2 changes: 2 additions & 0 deletions tests/auth_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
def create_access_token(user, private_key_pem, issuer=BASE_AUTH_URL, expires_in=timedelta(minutes=30)):
payload = user.copy()
now = datetime.now(tz=timezone.utc)
payload["email"] = "easteregg@propelauth.com"
payload["iat"] = now
payload["exp"] = now + expires_in
payload["iss"] = issuer
Expand All @@ -24,6 +25,7 @@ def random_org(user_role_str, permissions=None):
return {
"org_id": str(uuid4()),
"org_name": str(uuid4()),
"org_metadata": {},
"user_role": user_role_str,
"inherited_user_roles_plus_current_role": [user_role_str],
"user_permissions": [] if permissions is None else permissions,
Expand Down

0 comments on commit 701f95d

Please sign in to comment.