Back to godoc.org

Package auth

v0.0.0-...-3ce1eab
Latest Go to latest

The latest major version is .

Published: Sep 18, 2019 | Licenses: Apache-2.0 , BSD-3-Clause , MIT | Module: code.cloudfoundry.org/loggregator

Index

type CAPIClient

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

CAPIClient defines a client for accessing the CC API

func NewCAPIClient

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

NewCAPIClient returns a new CAPIClient

func (*CAPIClient) AvailableSourceIDs

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

AvailableSourceIDs returns all the available source ids a client has access to

func (*CAPIClient) IsAuthorized

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

IsAuthorized determines autorization to a given sourceID is valid

type HTTPClient

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

HTTClient defines the interface for communication over HTTP

type Metrics

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

Metrics defines the interface for creating metrics

type Oauth2Client

type Oauth2Client struct {
	IsAdmin  bool
	ClientID string
	UserID   string
}

Oauth2Client defines an OAuth2 client

type UAAClient

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

UAAClient defines an http client for UAA

func NewUAAClient

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

NewUAAClient returns a UAA client

func (*UAAClient) Read

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

Read retrieves an OAuth2 client from UAA

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier