common

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package common contains the core AuthProvider interface and utility functions to be used by the auth providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthSecrets

func GetAuthSecrets(c client.Client, cluster *appv1.VDICluster, secrets *secrets.SecretEngine, keys ...string) (map[string]string, error)

GetAuthSecrets is a helper function for retrieving multiple secrets required for authentication.

Types

type AuthProvider

type AuthProvider interface {
	// Reconcile should ensure any k8s resources required for this authentication
	// provider.
	Reconcile(context.Context, logr.Logger, client.Client, *appv1.VDICluster, string) error
	// Setup is called when the kVDI app launches and is a chance for the provider
	// to setup any resources it needs to serve requests.
	Setup(client.Client, *appv1.VDICluster) error
	// Close is called after temporary uses of the auth provider. It should close
	// any open connections and perform cleanup. It should be non-destructive.
	Close() error

	// Authenticate is called for API authentication requests. It should generate
	// a new JWTClaims object and serve an AuthResult back to the API.
	Authenticate(*types.LoginRequest) (*types.AuthResult, error)
	// GetUsers should return a list of VDIUsers.
	GetUsers() ([]*types.VDIUser, error)
	// GetUser should retrieve a single VDIUser.
	GetUser(string) (*types.VDIUser, error)
	// CreateUser should handle any logic required to register a new user in kVDI.
	CreateUser(*types.CreateUserRequest) error
	// UpdateUser should update a VDIUser.
	UpdateUser(string, *types.UpdateUserRequest) error
	// DeleteUser should remove a VDIUser
	DeleteUser(string) error
}

AuthProvider defines an interface for handling login attempts. Currently only local auth (using the secrets backend) is supported, however other integrations such as LDAP or OAuth can implement this interface.

Jump to

Keyboard shortcuts

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