Documentation ¶
Index ¶
Constants ¶
View Source
const BearerPrefix = "bearer "
Variables ¶
View Source
var ErrBadToken = errors.New("Bad token.")
View Source
var ErrTokenExpired = errors.New("Token expired.")
Functions ¶
Types ¶
type Config ¶
type Config struct { ListenAddr string `flags:"listen-addr,server listen host:addr (:34680)"` ReusePort bool `flags:"reuse-port,set SO_REUSEPORT on listener socket"` Names san.Names `flags:"subject-alt-name,set subjectAltNames to use on server certificate,san"` IssueHttp int `flags:"issue-http,enable certificate issue via HTTP API"` AutoShutdown time.Duration `flags:"auto-shutdown,auto shutdown server after specified time"` // Enable node bootstrapping with the given auth provider. Bootstrap TokenAuthProvider }
func DefaultConfig ¶
type FixedTokenAuthProvider ¶
func (*FixedTokenAuthProvider) Authenticate ¶
func (ta *FixedTokenAuthProvider) Authenticate(t string, now time.Time) error
func (*FixedTokenAuthProvider) LogHelpMessage ¶
func (ta *FixedTokenAuthProvider) LogHelpMessage(listenAddr, pubkeyhash string)
type Server ¶
func StartServer ¶
type TokenAuthProvider ¶
type TokenAuthProvider interface { Authenticate(token string, now time.Time) error LogHelpMessage(listenAddr, pubkeyhash string) }
func NewTokenFileAuthProvider ¶
func NewTokenFileAuthProvider(path string, logger *zap.Logger) (TokenAuthProvider, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.