handlers

package
v0.0.0-...-d892afd Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSecret

func CreateSecret(c echo.Context) error

CreateSecret creates a secret @Summary Create a secret. @Description Creates a secret. @Tags secrets @Accept json @Produce json @Security ApiKeyAuth @Param secret body addSecret true "The secret to create" @Success 201 {string} string "secret successfully set" @Failure 400 {string} string "Error binding or key is reserved." @Failure 500 {string} string "Cannot get or load secrets" @Router /secret [post]

func ListSecrets

func ListSecrets(c echo.Context) error

ListSecrets retrieves all secrets from the vault. @Summary List all secrets. @Description Retrieves all secrets from the vault. @Tags secrets @Produce json @Security ApiKeyAuth @Success 200 {array} addSecret "Secrets" @Failure 500 {string} string "Cannot get or load secrets" @Router /secrets [get]

func PermissionGetAll

func PermissionGetAll(c echo.Context) error

PermissionGetAll simply returns a list of all the roles available. @Summary Returns a list of default roles. @Description Returns a list of all the roles available. @Tags rbac @Security ApiKeyAuth @Success 200 {array} belaur.UserRoleCategory @Router /permission [get]

func RemoveSecret

func RemoveSecret(c echo.Context) error

RemoveSecret removes a secret from the vault. @Summary Removes a secret from the vault.. @Description Removes a secret from the vault. @Tags secrets @Produce plain @Security ApiKeyAuth @Param key body string true "Key" @Success 200 {string} string "secret successfully deleted" @Failure 400 {string} string "key is reserved and cannot be deleted" @Failure 500 {string} string "Cannot get or load secrets" @Router /secret/:key [delete]

func UpdateSecret

func UpdateSecret(c echo.Context) error

UpdateSecret updates a given secret @Summary Update a secret. @Description Update a secret. @Tags secrets @Accept json @Produce json @Security ApiKeyAuth @Param secret body updateSecret true "The secret to update with the new value" @Success 201 {string} string "secret successfully set" @Failure 400 {string} string "Error binding or key is reserved." @Failure 500 {string} string "Cannot get or load secrets"

Types

type AuthConfig

type AuthConfig struct {
	RoleCategories []*belaur.UserRoleCategory
	// contains filtered or unexported fields
}

AuthConfig is a simple config struct to be passed into AuthMiddleware. Currently allows the ability to specify the permission roles required for each echo endpoint.

type BelaurHandler

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

BelaurHandler defines handler functions throughout Bhojpur Belaur.

func NewBelaurHandler

func NewBelaurHandler(deps Dependencies) *BelaurHandler

NewBelaurHandler creates a new handler service with the required dependencies.

func (*BelaurHandler) InitHandlers

func (s *BelaurHandler) InitHandlers(e *echo.Echo) error

InitHandlers initializes(registers) all handlers.

type Dependencies

type Dependencies struct {
	Scheduler        service.BelaurScheduler
	PipelineService  pipeline.Servicer
	PipelineProvider pipelines.PipelineProviderer
	UserProvider     providers.UserProvider
	RBACProvider     providers.RBACProvider
	WorkerProvider   workers.WorkerProviderer
	Certificate      security.CAAPI
	RBACService      rbac.Service
	Store            store.BelaurStore
}

Dependencies define dependencies for this service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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