Documentation
¶
Index ¶
- func GetAvailableAuthorizerPlugins() []string
- func GetAvailablePlugins() map[string][]string
- func GetAvailableQuerierPlugins() []string
- func GetAvailableResolverPlugins() []string
- func InitAuthorizer(ctx context.Context, name, cfgPath string) (authz.Authorizer, error)
- func InitQuerier(ctx context.Context, name, cfgPath string) (distributed.Querier, error)
- func InitResolver(ctx context.Context, name, cfgPath string) (hosts.Resolver, error)
- func InitResolvers(ctx context.Context, cfg *HostResolverConfig) (*hosts.ResolverMap, error)
- func RegisterAuthorizer(name string, initFn AuthorizerInitializer)
- func RegisterQuerier(name string, initFn QuerierInitializer)
- func RegisterResolver(name string, initFn ResolverInitializer)
- type AppConfig
- type AuthorizerInitializer
- type HostResolverConfig
- type Initializer
- type QuerierInitializer
- type ResolverConfig
- type ResolverInitializer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAvailableAuthorizerPlugins ¶
func GetAvailableAuthorizerPlugins() []string
GetAvailableAuthorizerPlugins returns a list of all registered authorizer plugins
func GetAvailablePlugins ¶
GetAvailablePlugins returns a list of all registered plugins by plugin type
func GetAvailableQuerierPlugins ¶
func GetAvailableQuerierPlugins() []string
GetAvailableQuerierPlugins returns a list of all registered querier plugins
func GetAvailableResolverPlugins ¶ added in v4.1.18
func GetAvailableResolverPlugins() []string
GetAvailableResolverPlugins returns a list of all registered resolver plugins
func InitAuthorizer ¶
InitAuthorizer initializes the authorizer plugin with the given name and configuration path. If the plugin never registered itself, an error naming it is returned
func InitQuerier ¶
InitQuerier will initialize a querier plugin with the given name and configuration path. If the plugin never registered itself, an error will be returned
func InitResolver ¶ added in v4.1.18
InitResolver returns a resolver by name or an error if it isn't registered.
func InitResolvers ¶ added in v4.1.19
func InitResolvers(ctx context.Context, cfg *HostResolverConfig) (*hosts.ResolverMap, error)
InitResolvers initializes all registered resolver plugins
func RegisterAuthorizer ¶
func RegisterAuthorizer(name string, initFn AuthorizerInitializer)
RegisterAuthorizer registers an authorizer initializer function with a given name. It is typically called from init() in an authorizer package. RegisterAuthorizer will panic if an authorizer with the same name has already been registered
func RegisterQuerier ¶
func RegisterQuerier(name string, initFn QuerierInitializer)
RegisterQuerier registers a querier initializer function with a given name. This function is meant to be used by querier plugins to register themselves. RegisterQuerier will panic if a querier with the same name has already been registered
func RegisterResolver ¶ added in v4.1.18
func RegisterResolver(name string, initFn ResolverInitializer)
RegisterResolver is typically called from init() in a resolver package.
Types ¶
type AppConfig ¶ added in v4.1.19
type AppConfig struct {
Hosts *HostResolverConfig `mapstructure:"hosts"`
}
AppConfig holds the application configuration configurable through viper only
type AuthorizerInitializer ¶
AuthorizerInitializer constructs an authorizer, optionally using a config file. Mirrors the QuerierInitializer and ResolverInitializer pattern
type HostResolverConfig ¶ added in v4.1.19
type HostResolverConfig struct {
Resolvers []*ResolverConfig `mapstructure:"resolvers"`
}
HostResolverConfig holds all resolver configuration
type Initializer ¶
Initializer is a singleton that holds all registered plugins
func GetInitializer ¶
func GetInitializer() *Initializer
GetInitializer returns the singleton Initializer instance. It is safe to call this function concurrently. Repeated calls will return the same instance
func (*Initializer) LogValue ¶
func (i *Initializer) LogValue() slog.Value
type QuerierInitializer ¶
QuerierInitializer is a function that initializes a querier instance. The cfgPath parameter mandates that the querier plugin must be able to read in its configuration from a file
type ResolverConfig ¶ added in v4.1.19
type ResolverConfig struct {
Type string `mapstructure:"type"` // Type is the type of the resolver (e.g. the name)
Config string `mapstructure:"config"` // Config is the path to the configuration file
}
ResolverConfig is the configuration relevant for resolver plugin configuration
func (*ResolverConfig) LogValue ¶ added in v4.1.19
func (rc *ResolverConfig) LogValue() slog.Value
LogValue returns the log representation of the resolver config
Directories
¶
| Path | Synopsis |
|---|---|
|
Package authorizer enumerates the default authorizer plugin list.
|
Package authorizer enumerates the default authorizer plugin list. |
|
header
Package header implements the in-tree authorizer that reads the scope of a request from a header set by a trusted gateway.
|
Package header implements the in-tree authorizer that reads the scope of a request from a header set by a trusted gateway. |