handlers

package
v0.0.0-...-6371a9c Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

handlers/lineage.go

Index

Constants

View Source
const (
	AccessLevelRead   = "read"
	AccessLevelCreate = "create"
	AccessLevelDelete = "delete"
	AccessLevelOwner  = "owner"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateKeyRequest

type CreateKeyRequest struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type CreateKeyResponse

type CreateKeyResponse struct {
	KeyID        int       `json:"key_id"`
	CreationDate time.Time `json:"creation_date"`
}

type CreateSecretRequest

type CreateSecretRequest struct {
	PathID           int64                  `json:"path_id"`
	Key              string                 `json:"key"`
	Value            string                 `json:"value"`
	MultiValue       map[string]interface{} `json:"multi_value"`
	ExpiresAt        *time.Time             `json:"expires_at,omitempty"`
	Metadata         map[string]interface{} `json:"metadata"`
	IsOneTime        bool                   `json:"is_one_time"`
	RotationInterval string                 `json:"rotation_interval"`
	IsMultiValue     bool                   `json:"is_multi_value"`
	Path             string                 `json:"path"`
	Tags             []string               `json:"tags"`
}

type DecryptRequest

type DecryptRequest struct {
	KeyID      int    `json:"key_id"`
	Ciphertext string `json:"ciphertext"`
}

type DecryptResponse

type DecryptResponse struct {
	Plaintext string `json:"plaintext"`
}

type EncryptRequest

type EncryptRequest struct {
	KeyID     int    `json:"key_id"`
	Plaintext string `json:"plaintext"`
}

type EncryptResponse

type EncryptResponse struct {
	Ciphertext string `json:"ciphertext"`
}

type Handler

type Handler struct {
	DB     *pg.DB
	Config models.Config
	Syncer sync.SecretSyncer
}

func (*Handler) AassignSecretAccess

func (h *Handler) AassignSecretAccess(w http.ResponseWriter, r *http.Request)

func (*Handler) AccessSecret

func (h *Handler) AccessSecret(w http.ResponseWriter, r *http.Request)
func (h *Handler) AccessSharedLink(w http.ResponseWriter, r *http.Request)

Access a shared link

func (*Handler) AddUserToGroup

func (h *Handler) AddUserToGroup(w http.ResponseWriter, r *http.Request)

func (*Handler) ApproveRequest

func (h *Handler) ApproveRequest(w http.ResponseWriter, r *http.Request)

func (*Handler) AssignGroupAccess

func (h *Handler) AssignGroupAccess(w http.ResponseWriter, r *http.Request)

func (*Handler) AuthenticateAppRole

func (h *Handler) AuthenticateAppRole(w http.ResponseWriter, r *http.Request)

func (*Handler) AuthenticateUser

func (h *Handler) AuthenticateUser(w http.ResponseWriter, r *http.Request)

func (*Handler) CheckPermission

func (h *Handler) CheckPermission(permission string, next http.Handler) http.Handler

func (*Handler) CreateAppRole

func (h *Handler) CreateAppRole(w http.ResponseWriter, r *http.Request)

func (*Handler) CreateApprovalRequest

func (h *Handler) CreateApprovalRequest(w http.ResponseWriter, r *http.Request)

func (*Handler) CreateGroup

func (h *Handler) CreateGroup(w http.ResponseWriter, r *http.Request)

func (*Handler) CreateOrUpdatePathPermission

func (h *Handler) CreateOrUpdatePathPermission(w http.ResponseWriter, r *http.Request)

Create or update a path permission

func (*Handler) CreatePath

func (h *Handler) CreatePath(w http.ResponseWriter, r *http.Request)

func (*Handler) CreateSecret

func (h *Handler) CreateSecret(w http.ResponseWriter, r *http.Request)
func (h *Handler) CreateSharedLink(w http.ResponseWriter, r *http.Request)

Create a shared link

func (*Handler) CreateUser

func (h *Handler) CreateUser(w http.ResponseWriter, r *http.Request)

func (*Handler) Decrypt

func (h *Handler) Decrypt(w http.ResponseWriter, r *http.Request)

func (*Handler) DeletePolicy

func (h *Handler) DeletePolicy(w http.ResponseWriter, r *http.Request)

func (*Handler) DeleteSecret

func (h *Handler) DeleteSecret(w http.ResponseWriter, r *http.Request)

func (*Handler) DownloadCertificate

func (h *Handler) DownloadCertificate(w http.ResponseWriter, r *http.Request)

func (*Handler) Encrypt

func (h *Handler) Encrypt(w http.ResponseWriter, r *http.Request)

func (*Handler) GetAppRoles

func (h *Handler) GetAppRoles(w http.ResponseWriter, r *http.Request)

func (*Handler) GetAuditLogs

func (h *Handler) GetAuditLogs(w http.ResponseWriter, r *http.Request)

func (*Handler) GetDeletedSecrets

func (h *Handler) GetDeletedSecrets(w http.ResponseWriter, r *http.Request)

func (*Handler) GetNotifications

func (h *Handler) GetNotifications(w http.ResponseWriter, r *http.Request)

func (*Handler) GetPathPermissions

func (h *Handler) GetPathPermissions(w http.ResponseWriter, r *http.Request)

Get path permissions for a user

func (*Handler) GetPathPolicy

func (h *Handler) GetPathPolicy(w http.ResponseWriter, r *http.Request)

func (*Handler) GetPolicies

func (h *Handler) GetPolicies(w http.ResponseWriter, r *http.Request)

func (*Handler) GetSecret

func (h *Handler) GetSecret(w http.ResponseWriter, r *http.Request)

func (*Handler) GetSecretAccesses

func (h *Handler) GetSecretAccesses(w http.ResponseWriter, r *http.Request)

func (*Handler) GetSecretHistory

func (h *Handler) GetSecretHistory(w http.ResponseWriter, r *http.Request)

func (*Handler) GetSecretLineage

func (h *Handler) GetSecretLineage(w http.ResponseWriter, r *http.Request)

func (*Handler) GetSecretVersion

func (h *Handler) GetSecretVersion(w http.ResponseWriter, r *http.Request)

func (*Handler) GetSecrets

func (h *Handler) GetSecrets(w http.ResponseWriter, r *http.Request)

func (*Handler) Hmac

func (h *Handler) Hmac(w http.ResponseWriter, r *http.Request)

func (*Handler) ListAllPaths

func (h *Handler) ListAllPaths(w http.ResponseWriter, r *http.Request)

ListAllPaths returns all paths regardless of permissions

func (*Handler) ListApprovalRequests

func (h *Handler) ListApprovalRequests(w http.ResponseWriter, r *http.Request)

func (*Handler) ListGroupUsers

func (h *Handler) ListGroupUsers(w http.ResponseWriter, r *http.Request)

func (*Handler) ListGroups

func (h *Handler) ListGroups(w http.ResponseWriter, r *http.Request)

func (*Handler) ListPathSecrets

func (h *Handler) ListPathSecrets(w http.ResponseWriter, r *http.Request)

func (*Handler) ListPaths

func (h *Handler) ListPaths(w http.ResponseWriter, r *http.Request)

func (*Handler) ListTransitKeys

func (h *Handler) ListTransitKeys(w http.ResponseWriter, r *http.Request)

func (*Handler) ListUserGroups

func (h *Handler) ListUserGroups(w http.ResponseWriter, r *http.Request)

func (*Handler) ListUsers

func (h *Handler) ListUsers(w http.ResponseWriter, r *http.Request)

func (*Handler) LogSecretAccess

func (h *Handler) LogSecretAccess(secretID, userID int64, source string) error

func (*Handler) NewHandler

func (h *Handler) NewHandler() *mux.Router

func (*Handler) RegisterUser

func (h *Handler) RegisterUser(w http.ResponseWriter, r *http.Request)

func (*Handler) RejectRequest

func (h *Handler) RejectRequest(w http.ResponseWriter, r *http.Request)

func (*Handler) RemoveUserFromGroup

func (h *Handler) RemoveUserFromGroup(w http.ResponseWriter, r *http.Request)

func (*Handler) RestoreDeletedSecret

func (h *Handler) RestoreDeletedSecret(w http.ResponseWriter, r *http.Request)

func (*Handler) RotateSecret

func (h *Handler) RotateSecret(w http.ResponseWriter, r *http.Request)

func (*Handler) SavePolicy

func (h *Handler) SavePolicy(w http.ResponseWriter, r *http.Request)

func (*Handler) ScanForSecrets

func (h *Handler) ScanForSecrets(w http.ResponseWriter, r *http.Request)

func (*Handler) SearchSecrets

func (h *Handler) SearchSecrets(w http.ResponseWriter, r *http.Request)

func (*Handler) Sign

func (h *Handler) Sign(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdatePath

func (h *Handler) UpdatePath(w http.ResponseWriter, r *http.Request)

func (*Handler) UpdateSecretMetadata

func (h *Handler) UpdateSecretMetadata(w http.ResponseWriter, r *http.Request)

func (*Handler) UserInGroup

func (h *Handler) UserInGroup(userID int64, groupName string) bool

func (*Handler) Verify

func (h *Handler) Verify(w http.ResponseWriter, r *http.Request)

type LineageEdge

type LineageEdge struct {
	ID     string `json:"id"`
	Source string `json:"source"`
	Target string `json:"target"`
}

type LineageNode

type LineageNode struct {
	ID       string `json:"id"`
	Label    string `json:"label"`
	Type     string `json:"type"`
	ParentID string `json:"parent_id,omitempty"`
}

type LineageResponse

type LineageResponse struct {
	Nodes []LineageNode `json:"nodes"`
	Edges []LineageEdge `json:"edges"`
}

type SignRequest

type SignRequest struct {
	KeyID   int    `json:"key_id"`
	Message string `json:"message"`
}

type SignResponse

type SignResponse struct {
	Signature string `json:"signature"`
}

type VerifyRequest

type VerifyRequest struct {
	KeyID     int    `json:"key_id"`
	Message   string `json:"message"`
	Signature string `json:"signature"`
}

type VerifyResponse

type VerifyResponse struct {
	Verified bool `json:"verified"`
}

Jump to

Keyboard shortcuts

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