auth

package
v1.28.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogRequests added in v1.18.0

func LogRequests(log *zap.Logger, h http.Handler) http.Handler

LogRequests logs requests.

func LogResponses added in v1.18.0

func LogResponses(log *zap.Logger, h http.Handler) http.Handler

LogResponses logs responses.

func OpenKV

func OpenKV(ctx context.Context, log *zap.Logger, kvurl string) (_ authdb.KV, err error)

OpenKV opens the database connection with the appropriate driver.

Types

type Config

type Config struct {
	Endpoint          string        `help:"Gateway endpoint URL to return to clients" default:""`
	AuthToken         string        `help:"auth security token to validate requests" releaseDefault:"" devDefault:""`
	POSTSizeLimit     memory.Size   `help:"maximum size that the incoming POST request body with access grant can be" default:"4KiB"`
	AllowedSatellites []string      `help:"list of satellite NodeURLs allowed for incoming access grants" default:"https://www.storj.io/dcs-satellites"`
	CacheExpiration   time.Duration `help:"length of time satellite addresses are cached for" default:"10m"`

	KVBackend string `help:"key/value store backend url" default:""`
	Migration bool   `help:"create or update the database schema, and then continue service startup" default:"false"`

	ListenAddr    string `user:"true" help:"public HTTP address to listen on" default:":20000"`
	ListenAddrTLS string `user:"true" help:"public HTTPS address to listen on" default:":20001"`

	DRPCListenAddr    string `user:"true" help:"public DRPC address to listen on" default:":20002"`
	DRPCListenAddrTLS string `user:"true" help:"public DRPC+TLS address to listen on" default:":20003"`

	LetsEncrypt bool   `user:"true" help:"use lets-encrypt to handle TLS certificates" default:"false"`
	CertFile    string `user:"true" help:"server certificate file" default:""`
	KeyFile     string `user:"true" help:"server key file" default:""`
	PublicURL   string `user:"true" help:"public url for the server, for the TLS certificate" devDefault:"http://localhost:20000" releaseDefault:""`

	DeleteUnused DeleteUnusedConfig

	Node badgerauth.Config
}

Config holds authservice's configuration.

type DeleteUnusedConfig

type DeleteUnusedConfig struct {
	Run                bool          `help:"whether to run unused records deletion chore" default:"false"`
	Interval           time.Duration `help:"interval unused records deletion chore waits to start next iteration" default:"24h"`
	AsOfSystemInterval time.Duration `help:"the interval specified in AS OF SYSTEM in unused records deletion chore query as negative interval" default:"5s"`
	SelectSize         int           `help:"batch size of records selected for deletion at a time" default:"10000"`
	DeleteSize         int           `help:"batch size of records to delete from selected records at a time" default:"1000"`
}

DeleteUnusedConfig is a config struct for configuring unused records deletion chores.

type Peer

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

Peer is the representation of authservice.

func New

func New(ctx context.Context, log *zap.Logger, config Config, configDir string) (*Peer, error)

New constructs new Peer.

TODO(artur): New and constructors, in general, shouldn't take context.Context as a parameter.

func (*Peer) Close

func (p *Peer) Close() error

Close closes all authservice's resources. It must not be called concurrently.

func (*Peer) Run

func (p *Peer) Run(ctx context.Context) (err error)

Run starts authservice.

func (*Peer) ServeDRPC added in v1.17.0

func (p *Peer) ServeDRPC(ctx context.Context, listener net.Listener) (err error)

ServeDRPC starts serving DRPC clients.

func (*Peer) ServeHTTP added in v1.17.0

func (p *Peer) ServeHTTP(listener net.Listener) error

ServeHTTP starts serving HTTP clients.

type TLSInfo

type TLSInfo struct {
	LetsEncrypt bool
	CertFile    string
	KeyFile     string
	PublicURL   string
	ConfigDir   string
}

TLSInfo is a struct to handle the preferred/configured TLS options.

Directories

Path Synopsis
badgerauthtest
Package badgerauthtest is roughly inspired by the design of the storj/satellite/metabase/metabasetest package.
Package badgerauthtest is roughly inspired by the design of the storj/satellite/metabase/metabasetest package.
pb
Package pb includes protobufs for the badgerauth package.
Package pb includes protobufs for the badgerauth package.
Package drpcauth implements the same functionality as package httpauth but with DRPC as transport.
Package drpcauth implements the same functionality as package httpauth but with DRPC as transport.
dbx

Jump to

Keyboard shortcuts

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