Documentation ¶
Index ¶
- Constants
- type AdminUIPlugin
- type Claims
- type CorsPlugin
- type CorsPluginConfig
- type HeadersPlugin
- type HeadersPluginConfig
- type JWTPlugin
- type JWTPluginConfig
- type LimitsPlugin
- type LimitsPluginConfig
- type ManualSigningKeysProvider
- type MetaPlugin
- type PlaygroundPlugin
- type RequestIdentifierPlugin
- type SigningKeyProvider
- type WellKnownKeyProvider
Constants ¶
View Source
const BrambleRequestHeader = "X-Request-Id"
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 (p *AdminUIPlugin) Init(s *bramble.ExecutableSchema)
func (*AdminUIPlugin) SetupPrivateMux ¶
func (p *AdminUIPlugin) SetupPrivateMux(mux *http.ServeMux)
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"` AllowedMethods []string `json:"allowed-methods"` AllowCredentials bool `json:"allow-credentials"` ExposedHeaders []string `json:"exposed-headers"` MaxAge int `json:"max-age"` Debug bool `json:"debug"` }
type HeadersPlugin ¶ added in v1.4.11
type HeadersPlugin struct { bramble.BasePlugin // contains filtered or unexported fields }
func NewHeadersPlugin ¶ added in v1.4.11
func NewHeadersPlugin(options HeadersPluginConfig) *HeadersPlugin
func (*HeadersPlugin) ApplyMiddlewarePrivateMux ¶ added in v1.4.11
func (p *HeadersPlugin) ApplyMiddlewarePrivateMux(h http.Handler) http.Handler
func (*HeadersPlugin) ApplyMiddlewarePublicMux ¶ added in v1.4.11
func (p *HeadersPlugin) ApplyMiddlewarePublicMux(h http.Handler) http.Handler
func (*HeadersPlugin) Configure ¶ added in v1.4.11
func (p *HeadersPlugin) Configure(cfg *bramble.Config, data json.RawMessage) error
func (*HeadersPlugin) ID ¶ added in v1.4.11
func (p *HeadersPlugin) ID() string
type HeadersPluginConfig ¶ added in v1.4.11
type HeadersPluginConfig struct {
AllowedHeaders []string `json:"allowed-headers"`
}
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 ¶
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 ManualSigningKeysProvider ¶
type ManualSigningKeysProvider struct {
// contains filtered or unexported fields
}
func NewManualSigningKeysProvider ¶
func NewManualSigningKeysProvider(keys map[string]string) (*ManualSigningKeysProvider, error)
func (*ManualSigningKeysProvider) Keys ¶
func (m *ManualSigningKeysProvider) Keys() (map[string]*rsa.PublicKey, error)
func (*ManualSigningKeysProvider) Name ¶
func (m *ManualSigningKeysProvider) Name() string
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 (p *MetaPlugin) GraphqlQueryPath() (bool, string)
func (*MetaPlugin) ID ¶ added in v1.2.0
func (p *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 (p *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 RequestIdentifierPlugin ¶ added in v1.3.8
type RequestIdentifierPlugin struct {
bramble.BasePlugin
}
func (*RequestIdentifierPlugin) ApplyMiddlewarePrivateMux ¶ added in v1.3.8
func (p *RequestIdentifierPlugin) ApplyMiddlewarePrivateMux(h http.Handler) http.Handler
func (*RequestIdentifierPlugin) ApplyMiddlewarePublicMux ¶ added in v1.3.8
func (p *RequestIdentifierPlugin) ApplyMiddlewarePublicMux(h http.Handler) http.Handler
func (*RequestIdentifierPlugin) ID ¶ added in v1.3.8
func (p *RequestIdentifierPlugin) ID() string
type SigningKeyProvider ¶
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
Click to show internal directories.
Click to hide internal directories.