tokenauth

package
v0.0.0-...-4685c53 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

tokenauth package manages the authentication tokens

Index

Constants

View Source
const (
	DefaultLabel = "tokenauth"
	AdminToken   = "admin"
)

Variables

This section is empty.

Functions

func NewWithConfig

func NewWithConfig(c Config) (*auth, error)

Types

type Config

type Config struct {
	Label string        `json:"label,omitempty"`
	Path  string        `json:"path,omitempty"`
	File  string        `json:"file,omitempty"`
	Delta time.Duration `json:"delta,omitempty"`
}

func (Config) Name

func (c Config) Name() string

func (Config) New

func (c Config) New(ctx context.Context, provider Provider) (Task, error)

type Token

type Token struct {
	Value string    `json:"token,omitempty"`
	Time  time.Time `json:"access_time"`
}

func (*Token) String

func (t *Token) String() string

Jump to

Keyboard shortcuts

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