http

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	// Authenticate returns information about the user if security is successful, a bool specifying
	// whether the authenticator ran or not and an error if one occurs
	Authenticate(req *web.Request) (*web.UserContext, Decision, error)
}

Authenticator extracts the authenticator information from the request and returns information about the current user or an error if security was not successful

type Authorizer

type Authorizer interface {
	// Authorize returns decision specifying whether the authorizer allowed, denied or abstained from giving access,
	// the access level associated with the decision and an error if one occurs
	Authorize(req *web.Request) (Decision, web.AccessLevel, error)
}

Authorizer extracts the information from the authenticated user and returns a decision if the authorization passed

type Decision

type Decision int

Decision represents a decision to allow or deny further processing or to abstain from taking a decision

const (
	// Abstain represents a decision to abstain from deciding - let another component decide
	Abstain Decision = iota

	// Allow represents decision to allow to proceed
	Allow

	// Deny represents decision to deny to proceed
	Deny
)

func (Decision) String

func (a Decision) String() string

String implements Stringer and converts the decision to human-readable value

type TokenData

type TokenData interface {
	// Claims reads the claims from the token into the specified struct
	Claims(v interface{}) error
}

TokenData represents the authentication token

type TokenVerifier

type TokenVerifier interface {
	// Verify verifies that the token is valid and returns a token if so, otherwise returns an error
	Verify(ctx context.Context, token string) (TokenData, error)
}

TokenVerifier attempts to verify a token and returns it or an error if the verification was not successful

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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