-
Notifications
You must be signed in to change notification settings - Fork 148
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
Don't ignore --private-repos
when --no-auth
is used
#174
Comments
It would require a bit more work to support this. We currently have no username to compare to when auth is disabled, username will always be an empty string (see Would the Basic auth header be set by the check on your reverse proxy? |
You are right, my reverse proxy sets an additional header with the user name. I didn't realize that this header is not part of the basic auth header. |
What reverse proxy are you using, how is the authentication between your restic client and the proxy performed, and what is the normal way for the proxy to signal to the backend that the user is authenticated? |
I'm using Traefik as a reverse proxy. Right now Traefik is not authenticating the the clients, this is done by restic rest server at the moment. I would like to instead use Traefik to authenticate the users using ForwardAuth (https://doc.traefik.io/traefik/v2.0/middlewares/forwardauth/), so that we can have a single user database. The backend would not receive any not authenticated requests. A header that contains the user name would be added to authenticated requests. |
I have seen similar things before. I agree that adding something like |
Wouldn't it be easier to just let the reverse proxy check that the username and path prefix match? Since #112 all |
Maybe, but #117 shows the risks of having two different components try to interpret the request path. #140 also allows giving specific users additional permissions, which would not work in combination with a check on the proxy level. |
I stumbeled over this problem as well (I use nginx). Internet --https-->proxy/lb --http-->rest-server So normal TLS Termination. I found, that the current SSL Ciphers are week, and I cannot change them. For TLS Termination working correctly, the Rest-Server should Respect the X-Forwarded-Proto Header, to know, that the client talks https, but the requests comes through http. This would be enough for me. Basic Auth would still work, because the Authorization Header could also be proxied, as far as I understand. Also nice would be a health endpoint like /healthz with only response with http 200 if the Rest-Server is healthy. |
@GeorgFoc Basic-Auth at rest-server also works without enabling TLS. So, I don't understand what you need the |
@MichaelEischer |
Output of
rest-server --version
rest-server 0.10.0 compiled with go1.15.2 on linux/amd64
What should rest-server do differently?
It should still check whether username and path match, when flags
--no-auth
and--private-repos
are used simultaneously. I think that essentially means omitting!s.NoAuth
here:rest-server/handlers.go
Line 70 in 421da62
What are you trying to do? What is your use case?
This change would allow me to use a reverse proxy for authentication and still use
--private-repos
. I could use this to work around issues like #70, #73 or #111 more easily.Did rest-server help you today? Did it make you happy in any way?
Yes, I especially like the append only mode and the stateless simplicity.
The text was updated successfully, but these errors were encountered: