(Chore): Rm deprecate /installations route (#7945)

This commit is contained in:
Rohit Malhotra 2025-04-18 17:51:08 -04:00 committed by GitHub
parent 358166feb2
commit a09ecadba6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,39 +88,6 @@ async def get_user(
)
@app.get('/installations', response_model=list[int])
async def get_github_installation_ids(
provider_tokens: PROVIDER_TOKEN_TYPE | None = Depends(get_provider_tokens),
access_token: SecretStr | None = Depends(get_access_token),
):
if provider_tokens and ProviderType.GITHUB in provider_tokens:
token = provider_tokens[ProviderType.GITHUB]
client = GithubServiceImpl(
user_id=token.user_id, external_auth_token=access_token, token=token.token
)
try:
installations_ids: list[int] = await client.get_installation_ids()
return installations_ids
except AuthenticationError as e:
return JSONResponse(
content=str(e),
status_code=status.HTTP_401_UNAUTHORIZED,
)
except UnknownException as e:
return JSONResponse(
content=str(e),
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
)
return JSONResponse(
content='GitHub token required.',
status_code=status.HTTP_401_UNAUTHORIZED,
)
@app.get('/search/repositories', response_model=list[Repository])
async def search_repositories(
query: str,