Merge branch 'main' into ldap-tls
This commit is contained in:
Коммит
59b01a194d
|
@ -31,7 +31,8 @@ USER_SYNC_ATTRIBUTE=username
|
|||
## Your organizations Okta URL
|
||||
OKTA_ORG_URL=https://example.okta.com
|
||||
## The attribute which corresponds to the GitHub Username
|
||||
## NOTE: This cannot be an email address
|
||||
## NOTE: If this is an email address the @domain.tld will be stripped
|
||||
## Default if not set: login
|
||||
OKTA_USERNAME_ATTRIBUTE=github_username
|
||||
|
||||
###############################
|
||||
|
@ -43,7 +44,7 @@ OKTA_ACCESS_TOKEN=asdfghkjliptojkjsj00294759
|
|||
###############################
|
||||
## Okta OAuth authentication ##
|
||||
###############################
|
||||
## Auth method switch
|
||||
## Auth method: oauth or token
|
||||
OKTA_AUTH_METHOD=oauth
|
||||
## Okta OIDC app client ID
|
||||
OKTA_CLIENT_ID=abcdefghijkl
|
||||
|
|
2
Pipfile
2
Pipfile
|
@ -32,7 +32,7 @@ cryptography = "*"
|
|||
werkzeug = "*"
|
||||
|
||||
[pipenv]
|
||||
allow_prereleases = true
|
||||
allow_prereleases = false
|
||||
|
||||
[requires]
|
||||
python_version = "3.9"
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
2
app.py
2
app.py
|
@ -372,6 +372,7 @@ def is_team_in_map(slug, custom_map, org):
|
|||
else:
|
||||
return False
|
||||
|
||||
|
||||
def get_directory_from_slug(slug, custom_map, org):
|
||||
if not is_team_in_map(slug, custom_map, org):
|
||||
return slug
|
||||
|
@ -379,7 +380,6 @@ def get_directory_from_slug(slug, custom_map, org):
|
|||
return custom_map[(org.login, slug)]
|
||||
elif slug in custom_map:
|
||||
return custom_map[slug]
|
||||
|
||||
|
||||
|
||||
thread = threading.Thread(target=sync_all_teams)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import asyncio
|
||||
import os
|
||||
import logging
|
||||
import re
|
||||
from okta.client import Client as OktaClient
|
||||
|
||||
|
||||
|
@ -66,9 +67,12 @@ class Okta:
|
|||
users = loop.run_until_complete(get_members(client=self.client, groupId=gid))
|
||||
for user in users:
|
||||
try:
|
||||
username = getattr(user.profile, self.USERNAME_ATTRIBUTE)
|
||||
username = username.split("@")[0]
|
||||
username = re.sub('[^0-9a-zA-Z-]+', '-', username)
|
||||
member_list.append(
|
||||
{
|
||||
"username": getattr(user.profile, self.USERNAME_ATTRIBUTE),
|
||||
"username": username,
|
||||
"email": user.profile.email,
|
||||
}
|
||||
)
|
||||
|
|
Загрузка…
Ссылка в новой задаче