Flagsmith / Flagsmith/flagsmith

Support Github organisations with IP restrictions

Open
#4,613 0 comments 0 reactions 0 assignees View on GitHub
api
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.