token

package
v0.0.0-...-7139e1e Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package token : hold token configurations to check sing HTTP Header.

license: Apache license 2.0
copyright: Nobuyuki Matsui <nobuyuki.matsui@gmail.com>

Index

Constants

View Source
const AuthTokens = "AUTH_TOKENS"

AuthTokens : AUTH_TOKENS is an environment vairable name to set token configurations.

View Source
const AuthTokensPath = "AUTH_TOKENS_PATH"

AuthTokensPath : AUTH_TOKENS_PATH is an environment vairable name to set the file path of token configurations file.

Variables

This section is empty.

Functions

This section is empty.

Types

type Holder

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

Holder : a struct to hold token configurations.

Holder construct token configurations from "AUTH_TOKEN" environment variable.

func NewHolder

func NewHolder() *Holder

NewHolder : a factory method to create Holder.

func (*Holder) GetAllowedPaths

func (holder *Holder) GetAllowedPaths(host string, token string) []*regexp.Regexp

GetAllowedPaths : get all allowed paths associated with the bearer token.

func (*Holder) GetBasicAuthConf

func (holder *Holder) GetBasicAuthConf(host string) map[string]map[string]string

GetBasicAuthConf : get all configurations of basic authentication associated with the host.

func (*Holder) GetHosts

func (holder *Holder) GetHosts() []string

GetHosts : get all hosts held in this Hoder.

func (*Holder) GetNoAuthPaths

func (holder *Holder) GetNoAuthPaths(host string) []string

GetNoAuthPaths : get all allowed paths without authentication associated with the host.

func (*Holder) GetTokens

func (holder *Holder) GetTokens(host string) []string

GetTokens : get all bearer tokens associated with the host.

func (*Holder) HasToken

func (holder *Holder) HasToken(host string, token string) bool

HasToken : check whether the bearer token associated with the host is held in this Holder.

Jump to

Keyboard shortcuts

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