fix(ocm): Adjust for recend change for federated user IDs

The UserIds as returned by e.g. GetAcceptedUser do already contain
the provider domain in the IDP field now.

Also adjust the provider domain in the OCM config to be really a domain
without URI scheme and path.
This commit is contained in:
Ralf Haferkamp
2024-11-14 11:55:58 +01:00
parent 6d9915e936
commit 6f90abd22d
4 changed files with 25 additions and 11 deletions
-7
View File
@@ -8,7 +8,6 @@ import (
"github.com/CiscoM31/godata"
cs3group "github.com/cs3org/go-cs3apis/cs3/identity/group/v1beta1"
cs3user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
ocmuser "github.com/cs3org/reva/v2/pkg/ocm/user"
libregraph "github.com/owncloud/libre-graph-api-go"
"github.com/owncloud/ocis/v2/services/graph/pkg/errorcode"
)
@@ -134,12 +133,6 @@ func CreateUserModelFromCS3(u *cs3user.User) *libregraph.User {
OnPremisesSamAccountName: u.GetUsername(),
Id: &u.GetId().OpaqueId,
}
// decode the remote id if the user is federated
if u.GetId().GetType() == cs3user.UserType_USER_TYPE_FEDERATED {
remoteID := ocmuser.RemoteID(u.GetId())
user.Identities[0].Issuer = &remoteID.Idp
user.Identities[0].IssuerAssignedId = &remoteID.OpaqueId
}
return user
}