Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/cryptography-41.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
primetheus authored Oct 10, 2023
2 parents 9370914 + d975887 commit 0516b60
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def sync_team(client=None, owner=None, team_id=None, slug=None):
try:
directory_group = get_directory_from_slug(slug, custom_map, org)
# If we're filtering on group prefix, skip if the group doesn't match
if group_prefix.length() > 0 and not directory_group.startswith(
if len(group_prefix) > 0 and not directory_group.startswith(
tuple(group_prefix)
):
print(f"skipping team {team.slug} - not in group prefix")
Expand Down
6 changes: 5 additions & 1 deletion githubapp/azuread.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ def get_group_members(self, token=None, group_name=None):
else:
username = user_info[self.USERNAME_ATTRIBUTE]
if self.AZURE_USER_IS_UPN:
username = username.split("@")[0]
if r"\\" in username:
username = username.split(r"\\")[1]
username = username.split("@")[0].split("#")[0].split("_")[0]
username = username.translate(str.maketrans("._!#^~", "------"))
username = username.lower()
if "EMU_SHORTCODE" in os.environ:
username = username + "_" + os.environ["EMU_SHORTCODE"]
user = {
Expand Down
5 changes: 5 additions & 0 deletions githubapp/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ def init_app(self, app):
methods=["POST"],
)

app.add_url_rule("/health_check", endpoint="health_check")
@app.endpoint("health_check")
def health_check():
return "Web server is running.", 200

@property
def id(self):
return current_app.config["GITHUBAPP_ID"]
Expand Down

0 comments on commit 0516b60

Please sign in to comment.