Skip to content

Commit

Permalink
enable archiver for public shares
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas committed Oct 1, 2021
1 parent 4063323 commit 1b4ae06
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion graph/pkg/middleware/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func Auth(opts ...account.Option) func(http.Handler) http.Handler {
errorcode.InvalidAuthenticationToken.Render(w, r, http.StatusUnauthorized, "invalid token")
return
}
if ok, err := scope.VerifyScope(tokenScope, r); err != nil || !ok {
if ok, err := scope.VerifyScope(ctx, tokenScope, r); err != nil || !ok {
opt.Logger.Error().Err(err).Msg("verifying scope failed")
errorcode.InvalidAuthenticationToken.Render(w, r, http.StatusUnauthorized, "verifying scope failed")
return
Expand Down
2 changes: 1 addition & 1 deletion ocis-pkg/middleware/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func ExtractAccountUUID(opts ...account.Option) func(http.Handler) http.Handler
opt.Logger.Error().Err(err)
return
}
if ok, err := scope.VerifyScope(tokenScope, r); err != nil || !ok {
if ok, err := scope.VerifyScope(r.Context(), tokenScope, r); err != nil || !ok {
opt.Logger.Error().Err(err).Msg("verifying scope failed")
return
}
Expand Down
3 changes: 1 addition & 2 deletions proxy/pkg/middleware/public_share_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package middleware

import (
"net/http"
"strings"

gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
)
Expand All @@ -24,7 +23,7 @@ func PublicShareAuth(opts ...Option) func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Currently we only want to authenticate app open request coming from public shares.
shareToken := r.Header.Get(headerShareToken)
if shareToken == "" || !strings.HasPrefix(appProviderPathPrefix, r.URL.Path) {
if shareToken == "" {
// Don't authenticate
next.ServeHTTP(w, r)
return
Expand Down

0 comments on commit 1b4ae06

Please sign in to comment.