basicauth

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package basicauth is an authentication plugin that uses basic auth.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreds

func NewCreds(username, password string) grpc.DialOption

NewCreds returns a DialOption that sets the basic auth credentials.

Types

type Config

type Config struct {
	// HTPasswdFile is the path to an htpasswd file to use to verify client
	// credentials.
	HTPasswdFile string `mapstructure:"htpasswd-file" koanf:"htpasswd-file"`
}

Config is the configuration for the basic auth plugin.

func (*Config) AsMapStructure added in v0.3.1

func (c *Config) AsMapStructure() map[string]any

func (*Config) BindFlags added in v0.3.1

func (c *Config) BindFlags(prefix string, fs *pflag.FlagSet)

func (*Config) DefaultOptions added in v0.3.1

func (c *Config) DefaultOptions() *Config

DefaultOptions returns the default options for the plugin.

func (*Config) SetMapStructure added in v0.8.0

func (c *Config) SetMapStructure(in map[string]any)

type Plugin

type Plugin struct {
	v1.UnimplementedPluginServer
	v1.UnimplementedAuthPluginServer
	// contains filtered or unexported fields
}

Plugin is the basicauth plugin.

func (*Plugin) Authenticate

func (*Plugin) Close

func (p *Plugin) Close(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error)

func (*Plugin) Configure

func (p *Plugin) Configure(ctx context.Context, req *v1.PluginConfiguration) (*emptypb.Empty, error)

func (*Plugin) GetInfo

func (p *Plugin) GetInfo(context.Context, *emptypb.Empty) (*v1.PluginInfo, error)

Jump to

Keyboard shortcuts

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