auth

package
v0.0.0-...-5f133c6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

type Flags struct {
	TimeLimit         time.Duration
	AuthURL           string
	Principals        string
	UseGroups         bool
	CA                []byte
	UserCertTimeLimit time.Duration
}

func DefaultFlags

func DefaultFlags() *Flags

func (*Flags) Register

func (f *Flags) Register(set kflags.FlagSet, prefix string) *Flags

type Jar

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

type Modifier

type Modifier func(*Server) error

func WithAuthURL

func WithAuthURL(url string) Modifier

WithAuthURL supplies the URL to send users to for authentication. It is the URL of a running astore server.

func WithCA

func WithCA(fileContent []byte) Modifier

func WithFlags

func WithFlags(f *Flags) Modifier

func WithLogger

func WithLogger(log logger.Logger) Modifier

func WithPrincipals

func WithPrincipals(raw string) Modifier

func WithTimeLimit

func WithTimeLimit(limit time.Duration) Modifier

func WithUseGroups

func WithUseGroups(use bool) Modifier

WithUseGroups enables (or disables) the propagation of user groups as principals.

func WithUserCertTimeLimit

func WithUserCertTimeLimit(duration time.Duration) Modifier

type Server

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

func New

func New(rng *rand.Rand, mods ...Modifier) (*Server, error)

func (*Server) Authenticate

func (s *Server) Authenticate(ctx context.Context, req *apb.AuthenticateRequest) (*apb.AuthenticateResponse, error)

func (*Server) FeedToken

func (s *Server) FeedToken(key common.Key, cookie oauth.AuthData)

func (*Server) GetChannel

func (s *Server) GetChannel(cancel context.CancelFunc, pub common.Key) chan oauth.AuthData

func (*Server) HostCertificate

func (s *Server) HostCertificate(ctx context.Context, request *apb.HostCertificateRequest) (*apb.HostCertificateResponse, error)

func (*Server) Token

func (s *Server) Token(ctx context.Context, req *apb.TokenRequest) (*apb.TokenResponse, error)

Jump to

Keyboard shortcuts

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