-
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
auth: add www-authenticate based on user agent #1009
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. |
Kudos, SonarCloud Quality Gate passed! |
@refs looks good to me. General question: how can we configure OCIS with a config file with all the necessary values? |
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.
LGTM 👯
Transcript from Gitter to have all within the same context:
|
What?
We now comply with HTTP spec by adding Www-Authenticate headers on every
401
request. Furthermore, we not only take care of such a thing at the Proxy but also Reva will take care of it. In addition, we now are able to lock-in a set of User-Agent to specific challenges.Admins can use this feature by configuring OCIS + Reva following this approach:
We introduced two new environment variables:
STORAGE_FRONTEND_MIDDLEWARE_AUTH_CREDENTIALS_BY_USER_AGENT
as well asPROXY_MIDDLEWARE_AUTH_CREDENTIALS_BY_USER_AGENT
, The reason they have the same value is not to rely on the os env on a distributed environment, so in redundancy we trust. They both configure the same on the backend storage and OCIS Proxy. Both variables are comma separated tuples ofUser-Agent:challenge
.#1009
TODO
make use ofStatusReader
to provide clarity on the logsTechnical Debt added while working on ocis-1132
Scenarios
curl -v -k -H "depth: 0" -X PROPFIND https://localhost:9200/remote.php/dav/files | xmllint --format -
curl -v -k -H "User-Agent: mirall" -H "depth: 0" -X PROPFIND https://localhost:9200/remote.php/dav/files | xmllint --format -
curl -k -v https://localhost:9200/ocs/v2.php/cloud/users/einstein | xmllint --format -
curl -k -v -H "User-Agent: mirall" https://localhost:9200/ocs/v2.php/cloud/users/einstein | xmllint --format -
Bottom line is:
How to run this?
Please do note that using environment variables is recommended as the runtime does not forward cli flags. This means when
ocis server
is ran, the server sub-command has no access to lower level flags, meaning even ifocis storage-frontend
is ran underserver
, there is no way to inject a cli flag all the way down to the sub-sub command, this is a design choice of our runtime.