-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fixes for /ocs/cloud/users when using the CS3 user backend #3096
Conversation
Up to now when using the CS3 backend (e.g. to use an external LDAP server) queries to /users/{userid}/groups just errored out. This add a simple stub to just return and empty group list for now. This allows using and external LDAP server without having to fiddle with the proxy configuration to redirect to the reva ocs implementation. (Which also is just returning an empty group list currently)
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
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.
Looks good. Just one nitpick.
ocis-pkg/roles/manager.go
Outdated
return nil, err | ||
} | ||
|
||
roleIDs := make([]string, 0) |
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.
roleIDs := make([]string, 0) | |
roleIDs := make([]string, len(assignmentResponse.Assignments)) |
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.
I guess you meant make([]string,0, len(assignmentResponse.Assignments))
? Without setting the initial length to zero the append will do funky things 😄.
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, you're right. :D
This we use reva to mint tokes for users when using the CS3 backend (owncloud#2528) the user's roles are no longer part of the token. This adds a workaround to the RequireSelfOrAdmin middleware to Request the user's role id on demand from the settings service. Partial Fix for owncloud#2646
Kudos, SonarCloud Quality Gate passed! |
Description
This PR includes two workaround to get the CS3 backend for the ocs API to a somewhat working state. With this we'd no longer need to switch to the reva implemenation of ocs, e.g. when using an external LDAP server.
Related Issue
Motivation and Context
When using an external LDAP server we currently have to adjust the proxy configuration to point to the reva implemation of the ocs API. With this fix this should no longer be needed. I aware that these are mainly workarounds, but as we (at least to my understanding) agreed on removing the /ocs/cloud/users and ./groups services in the (not so long) run, I think they should be good enough. (btw, the /users/userid/groups implementation in reva also just returns an empty list, so we're not loosing anything here)
How Has This Been Tested?
manually using the WebUI / curl
Types of changes