Skip to content

Commit

Permalink
auth interceptor: Default to empty credentials chain
Browse files Browse the repository at this point in the history
When running with ocis, all external http-authentication is handled by the proxy
service. So the reva auth middleware should not try to do any basic or
bearer auth.

Related ocis ticket: owncloud/ocis#6692
  • Loading branch information
rhafer committed Oct 10, 2023
1 parent b512f85 commit 5da9c00
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
8 changes: 8 additions & 0 deletions changelog/unreleased/fix-auth-allow-empty-cred-chain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bugfix: Allow an empty credentials chain in the auth middleware

When running with ocis, all external http-authentication is handled by the proxy
service. So the reva auth middleware should not try to do any basic or
bearer auth.

https://github.com/cs3org/reva/pull/4241
https://github.com/owncloud/ocis/issues/6692
4 changes: 0 additions & 4 deletions internal/http/interceptors/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ func New(m map[string]interface{}, unprotected []string, tp trace.TracerProvider
conf.TokenManager = "jwt"
}

if len(conf.CredentialChain) == 0 {
conf.CredentialChain = []string{"basic", "bearer"}
}

if conf.CredentialsByUserAgent == nil {
conf.CredentialsByUserAgent = map[string]string{}
}
Expand Down
3 changes: 3 additions & 0 deletions tests/oc-integration-tests/drone/frontend-global.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ address = "0.0.0.0:20180"
[http.middlewares.cors]
allow_credentials = true

[http.middlewares.auth]
credential_chain = ["basic"]

[http.services.ocdav]
# serve ocdav on the root path
prefix = ""
Expand Down
3 changes: 3 additions & 0 deletions tests/oc-integration-tests/drone/frontend.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ address = "0.0.0.0:20080"
[http.middlewares.cors]
allow_credentials = true

[http.middlewares.auth]
credential_chain = ["basic"]

[http.services.ocdav]
# serve ocdav on the root path
prefix = ""
Expand Down
3 changes: 3 additions & 0 deletions tests/oc-integration-tests/local/frontend.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ address = "0.0.0.0:20080"
[http.middlewares.cors]
allow_credentials = true

[http.middlewares.auth]
credential_chain = ["basic"]

[http.services.ocdav]
# serve ocdav on the root path
prefix = ""
Expand Down

0 comments on commit 5da9c00

Please sign in to comment.