Skip to content

use email as id for external users#67

Open
jessegeens wants to merge 2 commits intomasterfrom
feat/lw-acls-email
Open

use email as id for external users#67
jessegeens wants to merge 2 commits intomasterfrom
feat/lw-acls-email

Conversation

@jessegeens
Copy link
Copy Markdown
Contributor

No description provided.

@jessegeens jessegeens force-pushed the feat/lw-acls-email branch from 60e8894 to 5189142 Compare April 8, 2026 12:43
@jessegeens jessegeens marked this pull request as ready for review April 8, 2026 12:43
Copy link
Copy Markdown
Member

@glpatcern glpatcern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments, knowing this is not to be merged immediately


func (m *manager) fetchExternalIdentities(ctx context.Context, email string) ([]*userpb.ExternalIdentity, error) {
log := appctx.GetLogger(ctx)
url := fmt.Sprintf("%s/api/v1.0/Identity/by_email/%s?filter=blocked%%3Afalse&filter=disabled%%3Afalse&field=upn&field=primaryAccountEmail&field=displayName&field=uid&field=gid&field=type&field=source&field=activeUser", m.conf.APIBaseURL, email)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do this or we have to populate all fields of Identity?

Suggested change
url := fmt.Sprintf("%s/api/v1.0/Identity/by_email/%s?filter=blocked%%3Afalse&filter=disabled%%3Afalse&field=upn&field=primaryAccountEmail&field=displayName&field=uid&field=gid&field=type&field=source&field=activeUser", m.conf.APIBaseURL, email)
url := fmt.Sprintf("%s/api/v1.0/Identity/by_email/%s?filter=blocked%%3Afalse&filter=disabled%%3Afalse&field=upn&field=source", m.conf.APIBaseURL, email)

if i.UserType() == userpb.UserType_USER_TYPE_LIGHTWEIGHT && i.PrimaryAccountEmail != "" {
u.Id.OpaqueId = i.PrimaryAccountEmail
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we do now if user type == LIGHTWEIGHT and email == "" ? I fear we can't infer this is a linked account, which we have agreed to not support, but anyhow we probably want to fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants