Skip to content

Commit

Permalink
✨ Feature: allow integer app id (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
dosisod authored Mar 23, 2023
1 parent 840476e commit e195d41
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions githubkit/auth/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AppAuth(httpx.Auth):
"""GitHub App or Installation Authentication Hook"""

github: "GitHubCore"
app_id: str
app_id: Union[str, int]
private_key: str
client_id: Optional[str] = None
client_secret: Optional[str] = None
Expand All @@ -59,7 +59,7 @@ def _create_jwt(self) -> str:
time = datetime.now(timezone.utc) - timedelta(minutes=1)
expire_time = time + timedelta(minutes=10)
return jwt.encode(
{"iss": self.app_id, "iat": time, "exp": expire_time},
{"iss": str(self.app_id), "iat": time, "exp": expire_time},
self.private_key,
algorithm="RS256",
)
Expand Down Expand Up @@ -219,7 +219,7 @@ async def async_auth_flow(
class AppAuthStrategy(BaseAuthStrategy):
"""GitHub App Authentication"""

app_id: str
app_id: Union[str, int]
private_key: str
client_id: Optional[str] = None
client_secret: Optional[str] = None
Expand Down Expand Up @@ -266,7 +266,7 @@ def get_auth_flow(self, github: "GitHubCore") -> httpx.Auth:
class AppInstallationAuthStrategy(BaseAuthStrategy):
"""GitHub App Installation Authentication"""

app_id: str
app_id: Union[str, int]
private_key: str
installation_id: int
client_id: Optional[str] = None
Expand Down

0 comments on commit e195d41

Please sign in to comment.