3rd-party-integrations / github-team-sync

Sync GitHub teams to groups in Active Directory, LDAP, Okta, OneLogin or AzureAD when using any authentication method for GitHub.
MIT License
199 stars 67 forks source link

OneLogin error in get_group_members #165

Closed rlinstorres closed 1 year ago

rlinstorres commented 1 year ago

I'm trying to use OneLogin settings but during the service initialization, I'm receiving this error below:

Traceback (most recent call last):
  File "/opt/github-team-sync/app.py", line 113, in directory_group_members
    members = directory.get_group_members(group_name=group)
  File "/opt/github-team-sync/githubapp/onelogin.py", line 21, in get_group_members
    users = self.client.get_users(query_parameters={"role_id": role[0].id})
TypeError: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/opt/github-team-sync/app.py", line 94, in sync_team
    if strtobool(os.environ["OPEN_ISSUE_ON_FAILURE"]):
  File "/usr/local/lib/python3.9/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'OPEN_ISSUE_ON_FAILURE'

These are my environment variables:

## GitHub App Settings ##
WEBHOOK_SECRET=SECRET
APP_ID=GITHUB_ID
PRIVATE_KEY_PATH=SSH_KEY

USER_DIRECTORY=ONELOGIN
USER_SYNC_ATTRIBUTE=username

## OneLogin Settings ##
ONELOGIN_CLIENT_ID='CLIENT_ID'
ONELOGIN_CLIENT_SECRET='CLIENT_SECRET'
REGION=EU

## Default (hourly): 0 * * * *
SYNC_SCHEDULE=0 * * * *
## Show the changes, but do not make any changes
## Default: false
#TEST_MODE=false
## Automatically add users missing from the organization
ADD_MEMBER=false
## Automatically remove users from the organisation that are not part of a team
REMOVE_ORG_MEMBERS_WITHOUT_TEAM=false

## Flask Settings ##
## Default: app
FLASK_APP=app
## Default: production
FLASK_ENV=production
## Default: 5000
FLASK_RUN_PORT=5000
## Default: 127.0.0.1
FLASK_RUN_HOST=0.0.0.0
rlinstorres commented 1 year ago

Everything is working fine, I was using the wrong credentials from OneLogin.