handlers

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 24 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware added in v0.2.3

func AuthMiddleware(roleAuth *AuthConfig) echo.MiddlewareFunc

AuthMiddleware is middleware used for each request. Includes functionality that validates the JWT tokens and user permissions.

func GitWebHook added in v0.2.1

func GitWebHook(c echo.Context) error

GitWebHook handles callbacks from GitHub's webhook system.

func ListSecrets added in v0.2.1

func ListSecrets(c echo.Context) error

ListSecrets retrieves all secrets from the vault.

func PermissionGetAll added in v0.2.3

func PermissionGetAll(c echo.Context) error

PermissionGetAll simply returns a list of all the roles available.

func RemoveSecret added in v0.2.1

func RemoveSecret(c echo.Context) error

RemoveSecret removes a secret from the vault.

func SetSecret added in v0.2.1

func SetSecret(c echo.Context) error

SetSecret creates or updates a given secret

func SettingsPollGet added in v0.2.4

func SettingsPollGet(c echo.Context) error

SettingsPollGet get status of polling functionality.

func SettingsPollOff added in v0.2.4

func SettingsPollOff(c echo.Context) error

SettingsPollOff turn off polling functionality.

func SettingsPollOn added in v0.2.4

func SettingsPollOn(c echo.Context) error

SettingsPollOn turn on polling functionality.

func UserAdd

func UserAdd(c echo.Context) error

UserAdd adds a new user to the store.

func UserChangePassword

func UserChangePassword(c echo.Context) error

UserChangePassword changes the password from a user.

func UserDelete

func UserDelete(c echo.Context) error

UserDelete deletes the given user

func UserGetAll

func UserGetAll(c echo.Context) error

UserGetAll returns all users stored in store.

func UserGetPermissions added in v0.2.3

func UserGetPermissions(c echo.Context) error

UserGetPermissions returns the permissions for a user.

func UserLogin

func UserLogin(c echo.Context) error

UserLogin authenticates the user with the given credentials.

func UserPutPermissions added in v0.2.3

func UserPutPermissions(c echo.Context) error

UserPutPermissions adds or updates permissions for a user.

func UserResetTriggerToken added in v0.2.3

func UserResetTriggerToken(c echo.Context) error

UserResetTriggerToken will generate and save a new Remote trigger token for a given user.

Types

type AuthConfig added in v0.2.3

type AuthConfig struct {
	RoleCategories []*gaia.UserRoleCategory
}

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 Dependencies added in v0.2.4

type Dependencies struct {
	Scheduler       service.GaiaScheduler
	PipelineService pipeline.Service
	Certificate     security.CAAPI
}

Dependencies define dependencies for this service.

type GaiaHandler added in v0.2.4

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

GaiaHandler defines handler functions throughout Gaia.

func NewGaiaHandler added in v0.2.4

func NewGaiaHandler(deps Dependencies) *GaiaHandler

NewGaiaHandler creates a new handler service with the required dependencies.

func (*GaiaHandler) InitHandlers added in v0.2.4

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

InitHandlers initializes(registers) all handlers.

type Hook added in v0.2.1

type Hook struct {
	Signature string
	Event     string
	ID        string
	Payload   []byte
}

Hook represent a github based webhook context.

type Payload added in v0.2.1

type Payload struct {
	Repo Repository `json:"repository"`
}

Payload contains information about the event like, user, commit id and so on. All we care about for the sake of identification is the repository.

type Repository added in v0.2.1

type Repository struct {
	GitURL  string `json:"git_url"`
	SSHURL  string `json:"ssh_url"`
	HTMLURL string `json:"html_url"`
}

Repository contains information about the repository. All we care about here are the possible urls for identification.

Directories

Path Synopsis
providers

Jump to

Keyboard shortcuts

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