diff --git a/tap_github/authenticator.py b/tap_github/authenticator.py index 8f5acf1e..6fe1aefc 100644 --- a/tap_github/authenticator.py +++ b/tap_github/authenticator.py @@ -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() diff --git a/tap_github/tests/test_authenticator.py b/tap_github/tests/test_authenticator.py index 68227815..2a325bb1 100644 --- a/tap_github/tests/test_authenticator.py +++ b/tap_github/tests/test_authenticator.py @@ -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(