Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Merge pull request #46 from owncloud/account-uuid-middleware
Browse files Browse the repository at this point in the history
Add account uuid extraction middleware
  • Loading branch information
kulmann authored May 27, 2020
2 parents 82ad593 + d2f138b commit 3242d53
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 4 deletions.
30 changes: 30 additions & 0 deletions account/option.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package account

import (
"github.com/owncloud/ocis-pkg/v2/log"
)

// Option defines a single option function.
type Option func(o *Options)

// Options defines the available options for this package.
type Options struct {
// Logger to use for logging, must be set
Logger log.Logger
// JWTSecret is the jwt secret for the reva token manager
JWTSecret string
}

// Logger provides a function to set the logger option.
func Logger(l log.Logger) Option {
return func(o *Options) {
o.Logger = l
}
}

// JWTSecret provides a function to set the jwt secret option.
func JWTSecret(s string) Option {
return func(o *Options) {
o.JWTSecret = s
}
}
6 changes: 6 additions & 0 deletions changelog/unreleased/add-account-middleware.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Change: add middleware for x-access-token distmantling

We added a middleware that dismantles the `x-access-token` from the request header and makes
it available in the context.

https://github.com/owncloud/ocis-pkg/pull/46
10 changes: 6 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ go 1.13

require (
github.com/ascarter/requestid v0.0.0-20170313220838-5b76ab3d4aee
github.com/coreos/go-oidc v2.1.0+incompatible
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/cs3org/reva v0.1.0
github.com/go-chi/chi v4.0.2+incompatible
github.com/justinas/alice v1.2.0
github.com/micro/cli/v2 v2.1.1
github.com/micro/go-micro/v2 v2.0.0
github.com/micro/go-plugins/wrapper/trace/opencensus/v2 v2.0.1
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
github.com/prometheus/client_golang v1.2.1
github.com/restic/calens v0.2.0 // indirect
github.com/rs/zerolog v1.17.2
github.com/rs/zerolog v1.18.0
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce
go.opencensus.io v0.22.2
go.opencensus.io v0.22.3
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
)

replace google.golang.org/grpc => google.golang.org/grpc v1.26.0
Loading

0 comments on commit 3242d53

Please sign in to comment.