osprey

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAndEncodeFile

func ReadAndEncodeFile(file string) (string, error)

ReadAndEncodeFile load the file contents and base64 encodes it

Types

type Osprey

type Osprey interface {
	// GetAccessToken will return an OIDC token if the request is valid
	GetAccessToken(ctx context.Context, username, password string) (*pb.LoginResponse, error)
	// Authorise handles the authorisation redirect callback from OAuth2 auth flow
	Authorise(ctx context.Context, code, state, failure string) (*pb.LoginResponse, error)
	// GetClusterInfo will return the api-server URL and CA
	GetClusterInfo(ctx context.Context) (*pb.ClusterInfoResponse, error)
	// Ready returns false if the oidcProvider has not been created
	Ready(ctx context.Context) error
}

Osprey defines behaviour to initiate and handle an oauth2 flow

func NewAuthenticationServer

func NewAuthenticationServer(environment, secret, redirectURL, issuerHost, issuerPath, issuerCA, apiServerURL, apiServerCA string, serveClusterInfo bool, client *http.Client) (Osprey, error)

NewAuthenticationServer returns a new osprey server with authentication enabled

func NewClusterInfoServer

func NewClusterInfoServer(apiServerURL, apiServerCA string) (Osprey, error)

NewClusterInfoServer returns a new osprey server for use when serving cluster-info only

Jump to

Keyboard shortcuts

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