Skip to content

Commit

Permalink
feat!: updates Passage ctor to remove deprecated args
Browse files Browse the repository at this point in the history
  • Loading branch information
ctran88 committed Jan 2, 2025
1 parent 23a00b2 commit 5afbcb6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions passageidentity/passage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

from passageidentity.auth import Auth
from passageidentity.errors import PassageError
from passageidentity.user import User


Expand All @@ -13,16 +12,17 @@ class Passage:
COOKIE_AUTH = 1
HEADER_AUTH = 2

def __init__(self, app_id: str, api_key: str = "", auth_strategy: int = COOKIE_AUTH) -> None:
def __init__(self, app_id: str, api_key: str) -> None:
"""Initialize a new Passage instance."""
if not app_id:
msg = "A Passage app ID is required. Please include {app_id=YOUR_APP_ID, api_key=YOUR_API_KEY}."
raise PassageError(msg)
msg = "A Passage app ID is required. Please include (app_id=YOUR_APP_ID, api_key=YOUR_API_KEY)."
raise ValueError(msg)

self.app_id: str = app_id
self.passage_apikey: str = api_key
self.auth_strategy: int = auth_strategy
self.request_headers = {"Authorization": f"Bearer {api_key}"}
if not api_key:
msg = "A Passage API key is required. Please include (app_id=YOUR_APP_ID, api_key=YOUR_API_KEY)."
raise ValueError(msg)

self.auth = Auth(app_id, self.request_headers)
self.user = User(app_id, self.request_headers)
request_headers = {"Authorization": f"Bearer {api_key}"}

self.auth = Auth(app_id, request_headers)
self.user = User(app_id, request_headers)

0 comments on commit 5afbcb6

Please sign in to comment.