authenticator

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticatorMiddleware

func AuthenticatorMiddleware(auth Authenticator, logger lager.Logger) gin.HandlerFunc

Types

type Authenticator

type Authenticator interface {
	Authenticate(username, password string) (User, error)
}

type BasicAuthenticator

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

func NewBasicAuthenticator

func NewBasicAuthenticator(cfURL string, httpClient *http.Client) *BasicAuthenticator

func (*BasicAuthenticator) Authenticate

func (a *BasicAuthenticator) Authenticate(username, password string) (User, error)

type BasicUser

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

func NewBasicUser

func NewBasicUser(cfClient cfclient.CloudFoundryClient, username string) *BasicUser

func (BasicUser) ListServiceInstancesMatchingPlanGUIDs

func (u BasicUser) ListServiceInstancesMatchingPlanGUIDs(servicePlanGuids []string) ([]cfclient.ServiceInstance, error)

func (BasicUser) Username

func (u BasicUser) Username() string

type MockAuthenticator

type MockAuthenticator struct {
	AllowedUsername string
	AllowedPassword string
}

func (*MockAuthenticator) Authenticate

func (a *MockAuthenticator) Authenticate(username, password string) (User, error)

type MockUser

type MockUser struct {
	MockUsername            string
	MockServiceInstances    []cfclient.ServiceInstance
	MockServiceInstancesErr error
}

func (*MockUser) ListServiceInstancesMatchingPlanGUIDs

func (u *MockUser) ListServiceInstancesMatchingPlanGUIDs(planGuids []string) ([]cfclient.ServiceInstance, error)

func (*MockUser) Username

func (u *MockUser) Username() string

type User

type User interface {
	Username() string
	ListServiceInstancesMatchingPlanGUIDs(planGuids []string) ([]cfclient.ServiceInstance, error)
}

Jump to

Keyboard shortcuts

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