tokenauth_gateway

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: 10 Imported by: 0

Documentation

Overview

tokenauth_gateway plugin is a gateway for token authentication. It provides:

  • Middleware for token authentication, which checks for a "Authorization: Token <value>" http header and validates against the tokenauth plugin;
  • HTTP handlers for creating and revoking tokens;
  • Methods which can return a token name from a token value.

Index

Constants

View Source
const (
	DefaultLabelSuffix  = "-gw"
	DefaultPathSuffix   = "/v1"
	DefaultLabel        = tokenauth.DefaultLabel + DefaultLabelSuffix
	MiddlewareName      = tokenauth.DefaultLabel
	MiddlewareAdminName = tokenauth.DefaultLabel + "-admin"
)

Variables

This section is empty.

Functions

func NewWithConfig

func NewWithConfig(c Config) (Task, error)

Types

type Config

type Config struct {
	Label  string `json:"label,omitempty"`
	Prefix string `json:"prefix,omitempty"`
	Auth   Task   `json:"-"` // plugin.TokenAuth
	Router Task   `json:"-"` // plugin.Router
}

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 {
	tokenauth.Token
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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