Skip to content

Commit

Permalink
Merge pull request #17 from keystone-scim/fix-aad-missing-emails-issue
Browse files Browse the repository at this point in the history
Handle case with missing emails from AAD
  • Loading branch information
yuvalherziger authored Aug 16, 2022
2 parents 38a2ac1 + 6dad725 commit b861160
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion keystone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
_red = "\033[0;31m"
_nc = "\033[0m"

VERSION = "0.1.0-rc.1"
VERSION = "0.1.0-rc.2"
LOGO = """
..............
.--------------. :
Expand Down
3 changes: 2 additions & 1 deletion keystone/store/postgresql_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,15 @@ async def _create_user(self, resource: Dict):
active=resource.get("active"),
customAttributes=custom_schemas
).returning()
emails = resource.get("emails", [{"primary": True, "value": resource.get("userName"), "type": "work"}])
insert_emails = insert(tbl.user_emails).values([
{
"id": str(uuid.uuid4()),
"userId": user_id,
"primary": email.get("primary", True),
"value": email.get("value"),
"type": email.get("type")
} for email in resource.get("emails")
} for email in emails
])
engine = await self.get_engine()
async with engine.acquire() as conn:
Expand Down

0 comments on commit b861160

Please sign in to comment.