Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: update Passage ctor signature to remove deprecated args #132

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading