awslabs / ssosync

Populate AWS SSO directly with your G Suite users and groups using either a CLI or AWS Lambda

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sync fails for user with apostrophe in email address

cgrice opened this issue · comments

Describe the bug
When syncing using the groups method, any users with an apostrophe in their email cause the sync to fail.

To Reproduce
Steps to reproduce the behavior:

  1. Find a group with a user who has an email containing an apostrophe
  2. Run a sync using groups mode, with a --group-match set to match that group
  3. The sync fails with an "Error 400: Invalid Input: query, invalid" error

Expected behavior
The sync should work as expected, including the user with the apostrophe.

Additional context
I believe the issue is caused by these lines -

ssosync/internal/sync.go

Lines 565 to 566 in 0651894

q := fmt.Sprintf("email:%s", m.Email)
u, err := s.google.GetUsers(q) // TODO: implement GetUser(m.Email)
- there's a note to move to GetUser(m.Email) which I think would solve the issue.

I've managed to work around this by adding an email alias without an apostrophe, and ignoring the user in question with --ignore-users