middleware

package
v0.0.0-...-b5648fb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PKI_ASN1_PREFIX = "MII"
	PKIZ_PREFIX     = "PKIZ_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RevokedList

type RevokedList struct {
	Revoked []openstack.Token
}

type Validator

type Validator struct {
	// Service account to talk to keystone
	SvcAuthOpts openstack.AuthOpts
	// File path the signing cert would be stored/cached
	CachedSigningKeyPath string
	TokenId              string
	// Token revocation list memory cache duration
	RevCacheDuration time.Duration
}

func NewValidator

func NewValidator(authOpts openstack.AuthOpts, token string, signingKeyPath string, revCacheSecs int) *Validator

NewValidator gets the credential for service account, token need to be validated, signing cert location (will store the cert from keystone if not there), and the revocation list cache duration (in seconds) and returns the validator.

func (*Validator) Validate

func (validator *Validator) Validate() (*openstack.AuthToken, error)

Validate does the local validation for PKI & PKIZ token and sends to keystone for other format tokens validation. It returns the extracted AuthToken struct

func (*Validator) ValidateOffline

func (validator *Validator) ValidateOffline() ([]byte, error)

Validate the token locally without sending to keystone It take the token body and return the extracted access object as []byte

func (*Validator) ValidateRemote

func (validator *Validator) ValidateRemote() ([]byte, error)

Jump to

Keyboard shortcuts

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