Skip to content

Commit 733203a

Browse files
authored
fix: add passage-version header to requests (#142)
1 parent b3b2f5a commit 733203a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

passageidentity/passage.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Provides the Passage class for interacting with the Passage API."""
22

3+
from importlib import metadata
4+
35
from passageidentity.auth import Auth
46
from passageidentity.user import User
57

@@ -17,7 +19,10 @@ def __init__(self, app_id: str, api_key: str) -> None:
1719
msg = "A Passage API key is required. Please include (app_id=YOUR_APP_ID, api_key=YOUR_API_KEY)."
1820
raise ValueError(msg)
1921

20-
request_headers = {"Authorization": f"Bearer {api_key}"}
22+
request_headers = {
23+
"Authorization": f"Bearer {api_key}",
24+
"Passage-Version": f"passage-python {metadata.version('passage-identity')}",
25+
}
2126

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

0 commit comments

Comments
 (0)