keyring

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedToEncodeForKeyring = errors.New("failed to encode for keyring")
	ErrFailedContactingKeyring  = errors.New("failed to contact keyring invalid response")
	ErrDecodingKeyringResponse  = errors.New("failed to decode keyring response")

	ErrAuthorizationMissing = errors.New("authorization missing")

	ErrMissingScheme        = errors.New("missing `X-Forwarded-Proto`")
	ErrMissingHost          = errors.New("missing `X-Forwarded-Host`")
	ErrMissingRequestMethod = errors.New("missing `X-Forwarded-Method`")
	ErrMissingRequestURI    = errors.New("missing `X-Forwarded-Uri`")

	ErrFailedParsingAudience = errors.New("failed to parse audience value")

	ErrFailedAudienceCheck = errors.New("failed audience check")
)

Functions

This section is empty.

Types

type AllowedAudience

type AllowedAudience struct {
	Methods []string
	URL     string
}

func ParseAudienceValue

func ParseAudienceValue(s string) (*AllowedAudience, error)

func (*AllowedAudience) CheckMethod

func (m *AllowedAudience) CheckMethod(method string) bool

func (*AllowedAudience) CheckURL

func (m *AllowedAudience) CheckURL(url string) bool

type Authenticate

type Authenticate struct {
	AccessToken string `json:"AccessToken,omitempty"`
	// UUID v4
	RequestID     *string `json:"RequestID,omitempty"`
	Origin        *string `json:"Origin,omitempty"`
	Referer       *string `json:"Referer,omitempty"`
	XForwardedFor *string `json:"XForwardedFor,omitempty"`
}

type AuthenticatedFor

type AuthenticatedFor struct {
	// UUID v4
	RequestID *string `json:"RequestID,omitempty"`
	// UUID v4
	KeyID string `json:"KeyID,omitempty"`
	// UUID v4
	TenantID string `json:"TenantID,omitempty"`
	// UUID v4
	Identity *string `json:"Identity,omitempty"`
	// UUID v4
	Organization *string `json:"Organization,omitempty"`
	// UUID v4
	Customer *string  `json:"Customer,omitempty"`
	Audience []string `json:"Audience,omitempty"`
	Origin   *string  `json:"Origin,omitempty"`
	// comma separate list of CIDR notation networks that are allowed.
	CIDRs *string `json:"CIDRs,omitempty"`
	IP    *string `json:"IP,omitempty"`
}

type Client

type Client interface {
	Authenticate(authenticate Authenticate) (*AuthenticatedFor, error)
}

func NewClient

func NewClient(logger logging.Logger, serviceURL string, client *http.Client) (Client, error)

type Config

type Config struct {
	Server            string
	ImplicitAudiences []string
}

type Service

type Service interface {
	CanAuthenticate(request *common.Request) bool
	Authenticate(request *common.Request) (*middleware.TumblerClaims, error)
}

func NewService

func NewService(logger logging.Logger, client Client, config Config) Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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