-
Notifications
You must be signed in to change notification settings - Fork 187
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
allow querying federated sharing roles #9765
Conversation
786060f
to
e8c6715
Compare
e8c6715
to
bb5a199
Compare
775db8f
to
8d10125
Compare
To make requesting only actions more speciffic, we can add a query parameter: |
8d10125
to
f98f7bd
Compare
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
f98f7bd
to
966b4e1
Compare
@@ -283,7 +283,7 @@ func createShareRequestToFederatedUser(user libregraph.User, resourceId *storage | |||
Id: &storageprovider.Grantee_UserId{UserId: &userpb.UserId{ | |||
Type: userpb.UserType_USER_TYPE_FEDERATED, | |||
OpaqueId: user.GetId(), | |||
Idp: providerInfo.Domain, // the domain is persisted in the grant as u:{opaqueid}:{domain} | |||
Idp: *user.GetIdentities()[0].Issuer, // the domain is persisted in the grant as u:{opaqueid}:{domain} |
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.
Is it guaranteed that
A) len(user.GetIdentities()) > 0
B) user.GetIdentities()[0] != nil
? Otherwise we need checks for this because it would panic.
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.
yes there is a check above the only line making a call to this function:
if len(user.Identities) < 1 {
return libregraph.Permission{}, errorcode.New(errorcode.InvalidRequest, "user has no federated identity")
}
// [...]
createShareRequest := createShareRequestToFederatedUser(user, statResponse.GetInfo().GetId(), providerInfoResp.ProviderInfo, cs3ResourcePermissions)
Co-authored-by: kobergj <[email protected]>
0c766c3
to
921e99e
Compare
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
921e99e
to
99c6b66
Compare
Quality Gate passedIssues Measures |
allow querying federated sharing roles
When listing permissions clients can now fetch the list of available federated sharing roles by sending a
GET /graph/v1beta1/drives/{driveid}/items/{itemid}/[email protected]/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))
request. Note that this is the only supported filter expression. Federated sharing roles will be omitted from requests without this filter.The
/roleManagement/permissions/roleDefinitions
also returns the new roles. Filtering them is done in a subsequent PR which requires #9727server part of #9745