-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add read-only interceptor to use on storage providers #1849
Conversation
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. |
@labkode It took me a while to figure out the interceptors concept in reva. It works now when you add the interceptor to the storage provider config. |
f0dbc00
to
a9cb0e7
Compare
@micbar awesome, this can be useful in many places, not only for a migration, for example to give access to read only storages. Can you add in the PR description or in some example config how to enable it? The CI complains about some tests. |
Yes. I am on it. Still working on the WebDAV response Codes and Response Body. |
@ishank011 Can you point me to some resources / docs / tickets regarding the scopes? |
Hi @micbar. There's a brief description in the PR #1669 and the workflow is detailed here https://codimd.web.cern.ch/XTib-1TzTyqx2IZJJOq5pA. I'll add some proper documentation as well. As a summary, the auth provider returns the scope for which the token is valid. For example, for basic auth and in ocis, this token has the 'owner' scope, i.e., unrestricted access to all resources. For public shares, users are restricted to only that particular share and resource. We can add a similar read-only scope, and make it configurable in the auth providers. The checks can be done like this. I skipped the reader/editor checks because of issues with the WebDAV response codes as well. So it'll be good to fix those. |
cfe1699
to
13ba6cc
Compare
@ishank011 I am trying to protect a storage by keeping it in a forced read-only mode to make sure that nothing changes "on disk" regardless of the accessing user and the auth method. I would really like to keep the scope narrow in this PR. We need this for a migration scenario where you have a parallel usage of the same storage by two instances where only one instance has write access. |
@labkode I added an example config to the top post |
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.
omg so many fixes!
@micbar @ishank011 let's keep the context of this PR for sysadmins to force a storage in read-only. |
Description
For migration scenarios it can be handy to use a storage provider in read-only mode. For example if we use the ownCloud SQL driver to connect to a ownCloud Classic, readonly mode is a vital step in the migration process.
Changes
readonly
InterceptorHow it works
read-only
interceptor uses a list of known request types which are allowed.WebUI
Config
Example storage-home.toml
Known Issue
storagehome
andstorageusers
which share the same physical storage (which is IMO weird and will be changed in the future)