Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadAndEncodeFile ¶
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 ¶
NewClusterInfoServer returns a new osprey server for use when serving cluster-info only
Click to show internal directories.
Click to hide internal directories.