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 ¶
func FormatListenAddr ¶ added in v0.2.2
FormatListenAddr takes a hostport str, and appends an interface ip addr as a host if the original host was empty or 0.0.0.0.
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"` ExposeMetrics bool `flags:"expose-metrics,expose /metrics HTTP endpoint for prometheus to crawl"` AutoShutdown time.Duration `flags:"auto-shutdown,auto shutdown server after specified time,,duration"` // 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.