plugins

package
v1.4.25 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 27 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 (*AdminUIPlugin) SetupPrivateMux

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

type Claims

type Claims struct {
	jwt.RegisteredClaims
	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"`
	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

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"`
	MaxResponseTime 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 (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

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