Skip to content

Commit

Permalink
feat: remove auth origin comparison from jwt validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ctran88 committed Dec 23, 2024
1 parent 4c206d6 commit 58b1bad
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 44 deletions.
4 changes: 1 addition & 3 deletions passageidentity/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import jwt as pyjwt

from passageidentity.errors import PassageError
from passageidentity.helper import fetch_app
from passageidentity.models.magic_link_args import MagicLinkWithEmailArgs, MagicLinkWithPhoneArgs, MagicLinkWithUserArgs
from passageidentity.openapi_client.api.magic_links_api import MagicLinksApi
from passageidentity.openapi_client.exceptions import ApiException
Expand All @@ -32,7 +31,6 @@ def __init__(self, app_id: str, request_headers: dict[str, str]) -> None:
# must set a user agent to avoid 403 from CF
headers={"User-Agent": "passageidentity/python"},
)
self.app = fetch_app(self.app_id)

self.magic_links_api = MagicLinksApi()

Expand All @@ -48,7 +46,7 @@ def validate_jwt(self, jwt: str) -> str:
claims = pyjwt.decode(
jwt,
public_key,
audience=[self.app_id] if self.app["hosted"] else self.app["auth_origin"],
audience=self.app_id,
algorithms=["RS256"],
)

Expand Down
18 changes: 0 additions & 18 deletions passageidentity/helper.py

This file was deleted.

23 changes: 0 additions & 23 deletions passageidentity/requests.py

This file was deleted.

0 comments on commit 58b1bad

Please sign in to comment.