Documentation ¶
Index ¶
- Constants
- Variables
- func AccountUUID(opts ...Option) func(next http.Handler) http.Handler
- func CreateHome(opts ...Option) func(next http.Handler) http.Handler
- func OpenIDConnect(opts ...Option) func(next http.Handler) http.Handler
- func PresignedURL(opts ...Option) func(next http.Handler) http.Handler
- func RedirectToHTTPS(next http.Handler) http.Handler
- type AccountsCacheEntry
- type M
- type OIDCProvider
- type Option
- func AccountsClient(ac acc.AccountsService) Option
- func HTTPClient(c *http.Client) Option
- func Logger(l log.Logger) Option
- func OIDCIss(iss string) Option
- func OIDCProviderFunc(f func() (OIDCProvider, error)) Option
- func PreSignedURLConfig(cfg config.PreSignedURL) Option
- func RevaGatewayClient(gc gateway.GatewayAPIClient) Option
- func Store(sc storepb.StoreService) Option
- func TokenManagerConfig(cfg config.TokenManager) Option
- type Options
Constants ¶
const ( // AccountsKey declares the svcKey for the Accounts service. AccountsKey = "accounts" // NodeKey declares the key that will be used to store the node address. // It is shared between services. NodeKey = "node" )
Variables ¶
var ( // ErrInvalidToken is returned when the request token is invalid. ErrInvalidToken = errors.New("invalid or missing token") )
Functions ¶
func AccountUUID ¶ added in v0.4.0
AccountUUID provides a middleware which mints a jwt and adds it to the proxied request based on the oidc-claims
func CreateHome ¶ added in v0.4.0
CreateHome provides a middleware which sends a CreateHome request to the reva gateway
func OpenIDConnect ¶
OpenIDConnect provides a middleware to check access secured by a static token.
func PresignedURL ¶ added in v0.5.0
PresignedURL provides a middleware to check access secured by a presigned URL.
Types ¶
type AccountsCacheEntry ¶ added in v0.4.0
AccountsCacheEntry stores a request to the accounts service on the cache. this type declaration should be on each respective service.
type OIDCProvider ¶ added in v0.4.0
type OIDCProvider interface {
UserInfo(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error)
}
OIDCProvider used to mock the oidc provider during tests
type Option ¶ added in v0.4.0
type Option func(o *Options)
Option defines a single option function.
func AccountsClient ¶ added in v0.4.0
func AccountsClient(ac acc.AccountsService) Option
AccountsClient provides a function to set the accounts client config option.
func HTTPClient ¶ added in v0.4.0
HTTPClient provides a function to set the http client config option.
func OIDCProviderFunc ¶ added in v0.4.0
func OIDCProviderFunc(f func() (OIDCProvider, error)) Option
OIDCProviderFunc provides a function to set the the oidc provider function option.
func PreSignedURLConfig ¶ added in v0.7.0
func PreSignedURLConfig(cfg config.PreSignedURL) Option
PreSignedURLConfig provides a function to set the PreSignedURL config
func RevaGatewayClient ¶ added in v0.4.0
func RevaGatewayClient(gc gateway.GatewayAPIClient) Option
RevaGatewayClient provides a function to set the the reva gateway service client option.
func Store ¶ added in v0.5.0
func Store(sc storepb.StoreService) Option
Store provides a function to set the store option.
func TokenManagerConfig ¶ added in v0.4.0
func TokenManagerConfig(cfg config.TokenManager) Option
TokenManagerConfig provides a function to set the token manger config option.
type Options ¶ added in v0.4.0
type Options struct { // Logger to use for logging, must be set Logger log.Logger // TokenManagerConfig for communicating with the reva token manager TokenManagerConfig config.TokenManager // HTTPClient to use for communication with the oidc provider HTTPClient *http.Client // AccountsClient for resolving accounts AccountsClient acc.AccountsService // OIDCProviderFunc to lazily initialize a provider, must be set for the oidcProvider middleware OIDCProviderFunc func() (OIDCProvider, error) // OIDCIss is the oidc-issuer OIDCIss string // RevaGatewayClient to send requests to the reva gateway RevaGatewayClient gateway.GatewayAPIClient // Store for persisting data Store storepb.StoreService // PreSignedURLConfig to configure the middleware PreSignedURLConfig config.PreSignedURL }
Options defines the available options for this package.