Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion tap_github/authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ def __init__(self, env_key: str, rate_limit_buffer: Optional[int] = None, **kwar
parts = env_key.split(";;")
self.github_app_id = parts[0]
self.github_private_key = (parts[1:2] or [""])[0].replace("\\n", "\n")
self.github_installation_id: Optional[str] = (parts[2:3] or [""])[0]
self.github_installation_id: Optional[str] = (
parts[2] if len(parts) >= 3 else None
)

self.token_expires_at: Optional[datetime] = None
self.claim_token()
Expand Down
2 changes: 1 addition & 1 deletion tap_github/tests/test_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def test_initialization_with_2_part_env_key(self):
token_manager = AppTokenManager("12345;;key\\ncontent")
assert token_manager.github_app_id == "12345"
assert token_manager.github_private_key == "key\ncontent"
assert token_manager.github_installation_id == ""
assert token_manager.github_installation_id is None

def test_initialization_with_malformed_env_key(self):
expected_error_expression = re.escape(
Expand Down