api

package
v0.0.0-...-e080771 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: BSD-3-Clause Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Authenticator contains the current driver used by api service
	Authenticator authentication.AuthDriver
	// CacaoAPITokenAuthenticator contains the driver for cacao tokens
	CacaoAPITokenAuthenticator authentication.AuthDriver
)

Functions

func AuthAPIRouter

func AuthAPIRouter(router *mux.Router)

AuthAPIRouter will map the necessary auth functions to the endpoints

func AuthenticationMiddleware

func AuthenticationMiddleware(next http.Handler) http.Handler

AuthenticationMiddleware is a middleware function required on some routes to make sure a user is authenticated and authorizaed to access that endpoint

func CredentialAPIRouter

func CredentialAPIRouter(client credentials.Client, router *mux.Router)

CredentialAPIRouter creates routes for credential-related operations such as creating and updating credentials and logging in

func DeploymentAPIRouter

func DeploymentAPIRouter(deploymentsClient deployments.Client, router *mux.Router)

DeploymentAPIRouter creates routes for operations related to deployments.

func DocsAPIRouter

func DocsAPIRouter(router *mux.Router)

DocsAPIRouter maps documentation functions to endpoints.

func HealthCheckAPIRouter

func HealthCheckAPIRouter(router *mux.Router)

HealthCheckAPIRouter adds a health check endpoint, the endpoint can be used to check if api service is healthy (still responding to request). This is used by kubernetes readinessProbe and livenessProbe for the api service.

func InitAuthenticationDriver

func InitAuthenticationDriver(c *config.Config) error

InitAuthenticationDriver initializes the authentication driver

func InteractiveSessionAPIRouter

func InteractiveSessionAPIRouter(interactiveSessionsClient interactivesessions.Client, router *mux.Router)

InteractiveSessionAPIRouter routes for operations related to interactive sessions.

func JS2AllocationAPIRouter

func JS2AllocationAPIRouter(js2allocationsClient js2allocations.Client, router *mux.Router)

JS2AllocationAPIRouter creates routes for operations related to JS2 Allocations.

func ProviderAPIRouter

func ProviderAPIRouter(client providermetadata.Client, router *mux.Router)

ProviderAPIRouter creates routes for provider-related operations such as creating and updating providers and logging in

func ProviderSpecificAPIRouter

func ProviderSpecificAPIRouter(client providermetadata.Client, openstackAPI OpenStackProviderAPI, awsAPI AWSProviderAPI, router *mux.Router)

ProviderSpecificAPIRouter ...

func PublicAPIRouter

func PublicAPIRouter(templatesClient templates.Client, router *mux.Router)

PublicAPIRouter creates routes for public API endpoints (endpoints that does not require authentication).

func StorageAPIRouter

func StorageAPIRouter(client storage.Client, router *mux.Router)

StorageAPIRouter creates routes for operations related to storage.

func TemplateAPIRouter

func TemplateAPIRouter(templatesClient templates.Client, router *mux.Router)

TemplateAPIRouter creates routes for operations related to templates.

func TemplateWebhookAPIRouter

func TemplateWebhookAPIRouter(templatesClient templates.Client, router *mux.Router)

TemplateWebhookAPIRouter creates routes for webhooks for templates.

func TokenAPIRouter

func TokenAPIRouter(tokensClient tokens.Client, router *mux.Router)

TokenAPIRouter creates routes related to managing cacao api tokens

func UserAPIRouter

func UserAPIRouter(serviceClient service.UserClient, router *mux.Router)

UserAPIRouter creates routes for user-related operations such as creating and updating users and logging in

func UserActionAPIRouter

func UserActionAPIRouter(userActionsClient useractions.Client, router *mux.Router)

UserActionAPIRouter creates routes for operations related to user actions.

func VersionAPIRouter

func VersionAPIRouter(router *mux.Router, gitCommit string)

VersionAPIRouter setups version api that returns the version of cacao.

func WorkspaceAPIRouter

func WorkspaceAPIRouter(workspacesClient workspaces.Client, deploymentsClient deployments.Client, router *mux.Router)

WorkspaceAPIRouter creates routes for operations related to workspaces.

Types

type AWSProviderAPI

type AWSProviderAPI interface {
	AuthenticationTest(w http.ResponseWriter, r *http.Request)
	CredentialList(w http.ResponseWriter, r *http.Request)
	RegionList(w http.ResponseWriter, r *http.Request)
	ImageList(w http.ResponseWriter, r *http.Request)
	GetImage(w http.ResponseWriter, r *http.Request)
	FlavorList(w http.ResponseWriter, r *http.Request)
	GetFlavor(w http.ResponseWriter, r *http.Request)
}

AWSProviderAPI ...

func NewAWSProviderAPI

func NewAWSProviderAPI(client awsprovider.Client) AWSProviderAPI

NewAWSProviderAPI ...

type OSProviderConstructor

OSProviderConstructor describes the signature of a function that can create new OpenStackProvider. Useful for unit tests.

type OpenStackProviderAPI

type OpenStackProviderAPI interface {
	CreateApplicationCredential(w http.ResponseWriter, r *http.Request)
	ApplicationCredentialList(w http.ResponseWriter, r *http.Request)
	GetApplicationCredential(w http.ResponseWriter, r *http.Request)
	DeleteApplicationCredential(w http.ResponseWriter, r *http.Request)
	AuthenticationTest(w http.ResponseWriter, r *http.Request)
	CredentialList(w http.ResponseWriter, r *http.Request)
	RegionList(w http.ResponseWriter, r *http.Request)
	ImageList(w http.ResponseWriter, r *http.Request)
	GetImage(w http.ResponseWriter, r *http.Request)
	FlavorList(w http.ResponseWriter, r *http.Request)
	GetFlavor(w http.ResponseWriter, r *http.Request)
	ProjectList(w http.ResponseWriter, r *http.Request)
	GetProject(w http.ResponseWriter, r *http.Request)
	ZoneList(w http.ResponseWriter, r *http.Request)
	RecordsetList(w http.ResponseWriter, r *http.Request)
}

OpenStackProviderAPI ...

func NewOpenStackProviderAPI

func NewOpenStackProviderAPI(client openstackprovider.Client) OpenStackProviderAPI

NewOpenStackProviderAPI ...

Jump to

Keyboard shortcuts

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