plugins

package
v1.3.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2021 License: MIT Imports: 25 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminUIPlugin

type AdminUIPlugin struct {
	bramble.BasePlugin
	// contains filtered or unexported fields
}

AdminUIPlugin serves a minimal administration interface.

func (*AdminUIPlugin) ID

func (p *AdminUIPlugin) ID() string

func (*AdminUIPlugin) Init

func (*AdminUIPlugin) SetupPrivateMux

func (p *AdminUIPlugin) SetupPrivateMux(mux *http.ServeMux)

type Claims

type Claims struct {
	jwt.StandardClaims
	Role string
}

type CorsPlugin

type CorsPlugin struct {
	bramble.BasePlugin
	// contains filtered or unexported fields
}

func NewCorsPlugin

func NewCorsPlugin(options CorsPluginConfig) *CorsPlugin

func (*CorsPlugin) ApplyMiddlewarePrivateMux

func (p *CorsPlugin) ApplyMiddlewarePrivateMux(h http.Handler) http.Handler

func (*CorsPlugin) ApplyMiddlewarePublicMux

func (p *CorsPlugin) ApplyMiddlewarePublicMux(h http.Handler) http.Handler

func (*CorsPlugin) Configure

func (p *CorsPlugin) Configure(cfg *bramble.Config, data json.RawMessage) error

func (*CorsPlugin) ID

func (p *CorsPlugin) ID() string

type CorsPluginConfig

type CorsPluginConfig struct {
	AllowedOrigins   []string `json:"allowed-origins"`
	AllowedHeaders   []string `json:"allowed-headers"`
	AllowCredentials bool     `json:"allow-credentials"`
	MaxAge           int      `json:"max-age"`
	Debug            bool     `json:"debug"`
}

type JWTPlugin

type JWTPlugin struct {
	bramble.BasePlugin
	// contains filtered or unexported fields
}

JWTPlugin validates that requests contains a valid JWT access token and add the necessary permissions and information to the context

func NewJWTPlugin

func NewJWTPlugin(keyProviders []SigningKeyProvider, roles map[string]bramble.OperationPermissions) *JWTPlugin

func (*JWTPlugin) ApplyMiddlewarePublicMux

func (p *JWTPlugin) ApplyMiddlewarePublicMux(h http.Handler) http.Handler

func (*JWTPlugin) Configure

func (p *JWTPlugin) Configure(cfg *bramble.Config, data json.RawMessage) error

func (*JWTPlugin) ID

func (p *JWTPlugin) ID() string

type JWTPluginConfig

type JWTPluginConfig struct {
	// List of JWKS endpoints
	JWKS []WellKnownKeyProvider `json:"jwks"`
	// Map of kid -> public key (RSA, PEM format)
	PublicKeys map[string]string                       `json:"public-keys"`
	Roles      map[string]bramble.OperationPermissions `json:"roles"`
}

type LimitsPlugin

type LimitsPlugin struct {
	bramble.BasePlugin
	// contains filtered or unexported fields
}

func NewLimitsPlugin

func NewLimitsPlugin(options LimitsPluginConfig) *LimitsPlugin

func (*LimitsPlugin) ApplyMiddlewarePublicMux

func (p *LimitsPlugin) ApplyMiddlewarePublicMux(h http.Handler) http.Handler

func (*LimitsPlugin) Configure

func (p *LimitsPlugin) Configure(cfg *bramble.Config, data json.RawMessage) error

func (*LimitsPlugin) ID

func (p *LimitsPlugin) ID() string

func (*LimitsPlugin) Init added in v1.2.0

func (p *LimitsPlugin) Init(es *bramble.ExecutableSchema)

type LimitsPluginConfig

type LimitsPluginConfig struct {
	MaxRequestBytes int64  `json:"max-request-bytes"`
	MaxResponeTime  string `json:"max-response-time"`
	// contains filtered or unexported fields
}

type ManualSigningKeysProvider

type ManualSigningKeysProvider struct {
	// contains filtered or unexported fields
}

func NewManualSigningKeysProvider

func NewManualSigningKeysProvider(keys map[string]string) (*ManualSigningKeysProvider, error)

func (*ManualSigningKeysProvider) Keys

func (*ManualSigningKeysProvider) Name

type MetaPlugin added in v1.2.0

type MetaPlugin struct {
	*bramble.BasePlugin
	// contains filtered or unexported fields
}

func NewMetaPlugin added in v1.2.0

func NewMetaPlugin() *MetaPlugin

func (*MetaPlugin) GraphqlQueryPath added in v1.2.0

func (i *MetaPlugin) GraphqlQueryPath() (bool, string)

func (*MetaPlugin) ID added in v1.2.0

func (i *MetaPlugin) ID() string

func (*MetaPlugin) Init added in v1.2.0

func (p *MetaPlugin) Init(s *bramble.ExecutableSchema)

func (*MetaPlugin) SetupPrivateMux added in v1.2.0

func (i *MetaPlugin) SetupPrivateMux(mux *http.ServeMux)

type PlaygroundPlugin

type PlaygroundPlugin struct {
	*bramble.BasePlugin
}

func (*PlaygroundPlugin) ID

func (p *PlaygroundPlugin) ID() string

func (*PlaygroundPlugin) SetupPublicMux

func (p *PlaygroundPlugin) SetupPublicMux(mux *http.ServeMux)

type SigningKeyProvider

type SigningKeyProvider interface {
	Name() string
	Keys() (map[string]*rsa.PublicKey, error)
}

type WellKnownKeyProvider

type WellKnownKeyProvider struct {
	// contains filtered or unexported fields
}

func NewWellKnownKeyProvider

func NewWellKnownKeyProvider(url string) *WellKnownKeyProvider

func (*WellKnownKeyProvider) Keys

func (w *WellKnownKeyProvider) Keys() (map[string]*rsa.PublicKey, error)

func (*WellKnownKeyProvider) MarshalJSON

func (w *WellKnownKeyProvider) MarshalJSON() ([]byte, error)

func (*WellKnownKeyProvider) Name

func (w *WellKnownKeyProvider) Name() string

func (*WellKnownKeyProvider) UnmarshalJSON

func (w *WellKnownKeyProvider) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL