Skip to content
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

Merged
merged 1 commit into from
May 15, 2024

Conversation

rhafer
Copy link
Contributor

@rhafer rhafer commented May 14, 2024

When autoprovisioning is enabled, we now update autoprovisioned users when their display name or email address claims change.

Closes: #8955

@rhafer rhafer self-assigned this May 14, 2024
When autoprovisioning is enabled, we now update autoprovisioned users when their
display name or email address claims change.

Closes: owncloud#8955
@rhafer rhafer marked this pull request as ready for review May 14, 2024 13:32
Copy link

sonarcloud bot commented May 14, 2024

Copy link
Collaborator

@kobergj kobergj left a comment

Choose a reason for hiding this comment

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

Nice 👍

Comment on lines +253 to +269
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
}
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@rhafer rhafer merged commit 7ca8391 into owncloud:master May 15, 2024
4 checks passed
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.

[ocis] Autoprovisioning: Update users when attributes change
2 participants