Skip to content

Commit

Permalink
Merge pull request #2657 from owncloud/remove-context-key
Browse files Browse the repository at this point in the history
remove deprecated context key
  • Loading branch information
David Christofas authored Oct 21, 2021
2 parents bd8a799 + 45fe331 commit acd2aa3
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions ocis-pkg/middleware/account.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package middleware

import (
"context"
"encoding/json"
"net/http"

Expand Down Expand Up @@ -30,10 +29,6 @@ const AccountID string = "Account-Id"
// RoleIDs serves as key for the roles in the context
const RoleIDs string = "Role-Ids"

// UUIDKey serves as key for the account uuid in the context
// Deprecated: UUIDKey exists for compatibility reasons. Use AccountID instead.
var UUIDKey struct{}

// ExtractAccountUUID provides a middleware to extract the account uuid from the x-access-token header value
// and write it to the context. If there is no x-access-token the middleware is omitted.
func ExtractAccountUUID(opts ...account.Option) func(http.Handler) http.Handler {
Expand Down Expand Up @@ -70,7 +65,6 @@ func ExtractAccountUUID(opts ...account.Option) func(http.Handler) http.Handler

// Important: user.Id.OpaqueId is the AccountUUID. Set this way in the account uuid middleware in ocis-proxy.
// https://github.com/owncloud/ocis-proxy/blob/ea254d6036592cf9469d757d1295e0c4309d1e63/pkg/middleware/account_uuid.go#L109
ctx = context.WithValue(ctx, UUIDKey, u.Id.OpaqueId)
// TODO: implement token manager in cs3org/reva that uses generic metadata instead of access token from header.
ctx = metadata.Set(ctx, AccountID, u.Id.OpaqueId)
if u.Opaque != nil {
Expand Down

0 comments on commit acd2aa3

Please sign in to comment.