auth

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppNameTranslator

type AppNameTranslator interface {
	GetRelatedSourceIds(appNames []string, token string) map[string][]string
}

type CAPIClient

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

func NewCAPIClient

func NewCAPIClient(
	capiAddr string,
	externalCapiAddr string,
	client HTTPClient,
	m Metrics,
	log *log.Logger,
) *CAPIClient

func (*CAPIClient) AvailableSourceIDs

func (c *CAPIClient) AvailableSourceIDs(authToken string) []string

func (*CAPIClient) GetRelatedSourceIds

func (c *CAPIClient) GetRelatedSourceIds(appNames []string, authToken string) map[string][]string

func (*CAPIClient) IsAuthorized

func (c *CAPIClient) IsAuthorized(sourceID, authToken string) bool

type CFAuthMiddlewareProvider

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

func NewCFAuthMiddlewareProvider

func NewCFAuthMiddlewareProvider(
	oauth2Reader Oauth2ClientReader,
	logAuthorizer LogAuthorizer,
	metaFetcher MetaFetcher,
	promQLSourceIdExtractor PromQLSourceIdExtractor, appNameTranslator AppNameTranslator,
) CFAuthMiddlewareProvider

func (CFAuthMiddlewareProvider) Middleware

type HTTPClient

type HTTPClient interface {
	Do(r *http.Request) (*http.Response, error)
}

type LogAuthorizer

type LogAuthorizer interface {
	IsAuthorized(sourceID, token string) bool
	AvailableSourceIDs(token string) []string
}

type MetaFetcher

type MetaFetcher interface {
	Meta(context.Context) (map[string]*rpc.MetaInfo, error)
}

type Metrics

type Metrics interface {
	NewGauge(name string) func(value float64)
}

type Oauth2Client

type Oauth2Client struct {
	IsAdmin  bool
	ClientID string
	UserID   string
}

type Oauth2ClientReader

type Oauth2ClientReader interface {
	Read(token string) (Oauth2Client, error)
}

type PromQLSourceIdExtractor

type PromQLSourceIdExtractor func(query string) ([]string, error)

type UAAClient

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

func NewUAAClient

func NewUAAClient(
	uaaAddr string,
	client string,
	clientSecret string,
	httpClient HTTPClient,
	m Metrics,
	log *log.Logger,
) *UAAClient

func (*UAAClient) Read

func (c *UAAClient) Read(token string) (Oauth2Client, error)

Jump to

Keyboard shortcuts

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