Flagsmith / Flagsmith/flagsmith
Support Github organisations with IP restrictions
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 567
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 121
Description
As per the following error in Sentry, we don't currently support GH organisations that have an IP filter on their API access. I believe the only way to solve this would be to add an internet gateway with a static IP address that we can publish for our customers.
Sentry Issue: [FLAGSMITH-API-4YJ](https://flagsmith.sentry.io/issues/5795682623/?referrer=github_integration)
```
GithubException: 403 {"message": "Although you appear to have the correct authorization credentials, the `` organization has an IP allow list enabled, and your IP address is not permitted to access this resource.", "documentation_url": "https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app", "status": "403"}
(23 additional frame(s) were not displayed)
...
File "integrations/github/views.py", line 71, in wrapper
return func(*args, **kwargs)
File "integrations/github/views.py", line 239, in fetch_repositories
data = fetch_github_repositories(
File "integrations/github/client.py", line 205, in fetch_github_repositories
headers: dict[str, str] = build_request_headers(installation_id)
File "integrations/github/client.py", line 40, in build_request_headers
else generate_token(
File "integrations/github/client.py", line 62, in generate_token
token = auth.token
```
Contributor guide
Assessment
This issue has not been assessed yet.