-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(proxy): Update selected attributes of autoprovisioned users #9166
Conversation
When autoprovisioning is enabled, we now update autoprovisioned users when their display name or email address claims change. Closes: owncloud#8955
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
authRes, err := gatewayClient.Authenticate(newctx, &gateway.AuthenticateRequest{ | ||
Type: "serviceaccounts", | ||
ClientId: c.serviceAccount.ServiceAccountID, | ||
ClientSecret: c.serviceAccount.ServiceAccountSecret, | ||
}) | ||
if err != nil { | ||
return err | ||
} | ||
if authRes.GetStatus().GetCode() != rpcv1beta1.Code_CODE_OK { | ||
return fmt.Errorf("error authenticating service user: %s", authRes.GetStatus().GetMessage()) | ||
} | ||
|
||
lgClient, err := c.setupLibregraphClient(newctx, authRes.GetToken()) | ||
if err != nil { | ||
c.logger.Error().Err(err).Msg("Error setting up libregraph client") | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to extract the service account token in other places too? It might make sense to move this to the utils
package then. I like how the service account authentication is hidden in some helper pkg...
Not relevant for this PR - just asking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, good thought. I think we're using it just here currently (but here already twice). I'll check if I can rework that in another PR.
When autoprovisioning is enabled, we now update autoprovisioned users when their display name or email address claims change.
Closes: #8955