Skip to content

Commit 1965827

Browse files
committed
Get journal permissions support auth_type
1 parent d287ec2 commit 1965827

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

bugout/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
__email__ = "engineering@bugout.dev"
99
__license__ = "MIT"
10-
__version__ = "0.2.3"
10+
__version__ = "0.2.4"
1111

1212
__all__ = (
1313
"__author__",

bugout/app.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,16 @@ def get_journal_permissions(
424424
journal_id: Union[str, uuid.UUID],
425425
holder_ids: Optional[List[Union[str, uuid.UUID]]] = None,
426426
timeout: float = REQUESTS_TIMEOUT,
427+
auth_type: str = data.AuthType.bearer.name,
428+
**kwargs: Dict[str, Any],
427429
) -> data.BugoutJournalPermissions:
428430
self.journal.timeout = timeout
429431
return self.journal.get_journal_permissions(
430-
token=token, journal_id=journal_id, holder_ids=holder_ids
432+
token=token,
433+
journal_id=journal_id,
434+
holder_ids=holder_ids,
435+
auth_type=data.AuthType[auth_type],
436+
**kwargs,
431437
)
432438

433439
def get_journal_scopes(

bugout/journal.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,15 @@ def get_journal_permissions(
8181
token: Union[str, uuid.UUID],
8282
journal_id: Union[str, uuid.UUID],
8383
holder_ids: Optional[List[Union[str, uuid.UUID]]] = None,
84+
auth_type: AuthType = AuthType.bearer,
85+
**kwargs: Dict[str, Any],
8486
) -> BugoutJournalPermissions:
8587
journal_scopes_path = f"journals/{journal_id}/permissions"
8688
headers = {
87-
"Authorization": f"Bearer {token}",
89+
"Authorization": f"{auth_type.value} {token}",
8890
}
91+
if "headers" in kwargs.keys():
92+
headers.update(kwargs["headers"])
8993
query_params = {}
9094
if holder_ids is not None:
9195
holder_ids_string = [str(holder_id) for holder_id in holder_ids]

0 commit comments

Comments
 (0)