cauthn

package
v0.0.0-...-c5655c4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2017 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrVHUTMissing indicates that the VHUT header is missing
	ErrVHUTMissing = errors.New("VH-Authenticate header absent")
	// ErrVHUTInvalidFormat indicates that the VHUT was not formatted properly
	ErrVHUTInvalidFormat = errors.New("Invalid VHUT format")
)

Functions

This section is empty.

Types

type VHUT

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

VHUT represents a VH User Token

func (*VHUT) InitFromFile

func (v *VHUT) InitFromFile(filename string) error

InitFromFile initializes member vhut from contents of the file. This will most likley be invoked by a CLI program that stores the VHUT in a file Returns non-nil error if the file doesn't exist, can't be read or the data doesn't match the VHUT format. It is to be noted that this method doesn't validate the token

func (*VHUT) InitFromString

func (v *VHUT) InitFromString(token string) error

InitFromString initializes member vhut from a string.

func (*VHUT) UpdateRequest

func (v *VHUT) UpdateRequest(r *http.Request) error

UpdateRequest adds custom HTTP request header "VH-Authenticate" with vhut as value. This will most likely be invoked by a client program before making a HTTP(S) request. Updates the value if header "VH-Authenticate" already exists in the request r. Returns non-nil error if vhut is not initialized.

Jump to

Keyboard shortcuts

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