Skip to content

Commit 5afbcb6

Browse files
committed
feat!: updates Passage ctor to remove deprecated args
1 parent 23a00b2 commit 5afbcb6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

passageidentity/passage.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
from passageidentity.auth import Auth
6-
from passageidentity.errors import PassageError
76
from passageidentity.user import User
87

98

@@ -13,16 +12,17 @@ class Passage:
1312
COOKIE_AUTH = 1
1413
HEADER_AUTH = 2
1514

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

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

27-
self.auth = Auth(app_id, self.request_headers)
28-
self.user = User(app_id, self.request_headers)
25+
request_headers = {"Authorization": f"Bearer {api_key}"}
26+
27+
self.auth = Auth(app_id, request_headers)
28+
self.user = User(app_id, request_headers)

0 commit comments

Comments
 (0)