projecthdl

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddProvidersRequest

type AddProvidersRequest struct {
	Providers ProvidersRequest `json:"providers"`
}

type AddProvidersResponse

type AddProvidersResponse struct {
	Providers []*ProviderResponse `json:"providers"`
}

type CreateProjectRequest

type CreateProjectRequest struct {
	Name                  string `json:"name"`
	GenerateEncryptionKey bool   `json:"generate_encryption_key,omitempty"`
}

type CreateProjectResponse

type CreateProjectResponse struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	APIKey         string `json:"api_key"`
	APISecret      string `json:"api_secret"`
	EncryptionPart string `json:"encryption_part,omitempty"`
}

type CustomProvider

type CustomProvider struct {
	ProviderID string  `json:"provider_id,omitempty"`
	JWK        string  `json:"jwk,omitempty"`
	PEM        string  `json:"pem,omitempty"`
	KeyType    KeyType `json:"key_type,omitempty"`
}

type EncryptBodyRequest

type EncryptBodyRequest struct {
	EncryptionPart string `json:"encryption_part"`
}

type GetProjectResponse

type GetProjectResponse struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type GetProviderResponse

type GetProviderResponse struct {
	ProviderID     string  `json:"provider_id"`
	Type           string  `json:"type"`
	PublishableKey string  `json:"publishable_key,omitempty"`
	JWK            string  `json:"jwk,omitempty"`
	PEM            string  `json:"pem,omitempty"`
	KeyType        KeyType `json:"key_type,omitempty"`
}

type GetProvidersResponse

type GetProvidersResponse struct {
	Providers []*ProviderResponse `json:"providers"`
}

type Handler

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

Handler is the REST handler for project operations

func New

New creates a new project handler

func (*Handler) AddProviders

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

AddProviders adds providers to a project @Summary Add providers @Description Add one or more providers to a project @Tags Project @Accept json @Produce json @Param X-API-Key header string true "API Key" @Param X-API-Secret header string true "API Secret" @Param addProvidersRequest body AddProvidersRequest true "Add Providers Request" @Success 200 {object} AddProvidersResponse "Providers added successfully" @Failure 400 "Bad Request" @Failure 500 {object} api.Error "Internal Server Error" @Router /project/providers [post]

func (*Handler) CreateProject

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

CreateProject creates a new project @Summary Create a new project @Description Create a new project with the provided name @Tags Project @Accept json @Produce json @Param createProjectRequest body CreateProjectRequest true "Create Project Request" @Success 201 {object} CreateProjectResponse "Project created successfully" @Failure 400 {object} api.Error "Bad Request" @Failure 500 {object} api.Error "Internal Server Error" @Router /register [post]

func (*Handler) DeleteProvider

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

DeleteProvider removes a provider from a project @Summary Delete a provider @Description Remove a specific provider from a project @Tags Project @Param X-API-Key header string true "API Key" @Param X-API-Secret header string true "API Secret" @Param provider path string true "Provider ID" @Success 200 "Provider deleted successfully" @Failure 404 "Provider not found" @Failure 500 {object} api.Error "Internal Server Error" @Router /project/providers/{provider} [delete]

func (*Handler) EncryptProjectShares

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

EncryptProjectShares encrypts all shares of a project (if not already encrypted) @Summary Encrypt project shares @Description Encrypt all shares of a project @Tags Project @Param X-API-Key header string true "API Key" @Param X-API-Secret header string true "API Secret" @Param encryptBodyRequest body EncryptBodyRequest true "Add Allowed Origin Request" @Success 200 "Shares encrypted successfully" @Failure 500 {object} api.Error "Internal Server Error" @Router /project/encrypt [post]

func (*Handler) GetProject

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

GetProject retrieves a project @Summary Get a project @Description Get details of a project @Tags Project @Produce json @Param X-API-Key header string true "API Key" @Param X-API-Secret header string true "API Secret" @Success 200 {object} GetProjectResponse "Successful response" @Failure 404 {object} api.Error "Not Found" @Failure 500 {object} api.Error "Internal Server Error" @Router /project [get]

func (*Handler) GetProvider

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

GetProvider retrieves a specific provider @Summary Get a provider @Description Get details of a specific provider @Tags Project @Produce json @Param X-API-Key header string true "API Key" @Param X-API-Secret header string true "API Secret" @Param provider path string true "Provider ID" @Success 200 {object} GetProviderResponse "Successful response" @Failure 404 "Provider not found" @Failure 500 {object} api.Error "Internal Server Error" @Router /project/providers/{provider} [get]

func (*Handler) GetProviders

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

GetProviders lists all providers of a project @Summary List providers @Description Get a list of all providers associated with a project @Tags Project @Produce json @Param X-API-Key header string true "API Key" @Param X-API-Secret header string true "API Secret" @Success 200 {object} GetProvidersResponse "Successful response" @Failure 500 {object} api.Error "Internal Server Error" @Router /project/providers [get]

func (*Handler) RegisterEncryptionKey

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

RegisterEncryptionKey registers an encryption key for a project @Summary Register encryption key @Description Register an encryption key for a project @Tags Project @Accept json @Produce json @Param X-API-Key header string true "API Key" @Param X-API-Secret header string true "API Secret" @Success 200 {object} RegisterEncryptionKeyResponse "Encryption key registered successfully" @Failure 400 "Bad Request" @Failure 500 {object} api.Error "Internal Server Error" @Router /project/encryption-key [post]

func (*Handler) RegisterEncryptionSession

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

RegisterEncryptionSession registers a session with a one-time encryption key for a project @Summary Register encryption session @Description Register a session with a one-time encryption key for a project @Tags Project @Accept json @Produce json @Param X-API-Key header string true "API Key" @Param X-API-Secret header string true "API Secret" @Param registerEncryptionSessionRequest body RegisterEncryptionSessionRequest true "Add Allowed Origin Request" @Success 200 {object} RegisterEncryptionSessionResponse "Encryption session registered successfully" @Failure 400 "Bad Request" @Failure 500 {object} api.Error "Internal Server Error" @Router /project/encryption-session [post]

func (*Handler) UpdateProvider

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

UpdateProvider updates a provider's configuration @Summary Update a provider @Description Update the configuration of a specific provider @Tags Project @Accept json @Param X-API-Key header string true "API Key" @Param X-API-Secret header string true "API Secret" @Param provider path string true "Provider ID" @Param updateProviderRequest body UpdateProviderRequest true "Update Provider Request" @Success 200 "Provider updated successfully" @Failure 400 "Bad Request" @Failure 500 {object} api.Error "Internal Server Error" @Router /project/providers/{provider} [put]

type KeyType

type KeyType string
const (
	KeyTypeRSA     KeyType = "rsa"
	KeyTypeECDSA   KeyType = "ecdsa"
	KeyTypeEd25519 KeyType = "ed25519"
)

type OpenfortProvider

type OpenfortProvider struct {
	ProviderID     string `json:"provider_id,omitempty"`
	PublishableKey string `json:"publishable_key,omitempty"`
}

type ProviderResponse

type ProviderResponse struct {
	ProviderID string `json:"provider_id"`
	Type       string `json:"type"`
}

type ProvidersRequest

type ProvidersRequest struct {
	Openfort *OpenfortProvider `json:"openfort,omitempty"`
	Custom   *CustomProvider   `json:"custom,omitempty"`
}

type RegisterEncryptionKeyResponse

type RegisterEncryptionKeyResponse struct {
	EncryptionPart string `json:"encryption_part"`
}

type RegisterEncryptionSessionRequest

type RegisterEncryptionSessionRequest struct {
	EncryptionPart string `json:"encryption_part"`
}

type RegisterEncryptionSessionResponse

type RegisterEncryptionSessionResponse struct {
	SessionID string `json:"session_id"`
}

type UpdateProviderRequest

type UpdateProviderRequest struct {
	PublishableKey string  `json:"publishable_key,omitempty"`
	JWK            string  `json:"jwk,omitempty"`
	PEM            string  `json:"pem,omitempty"`
	KeyType        KeyType `json:"key_type,omitempty"`
}

Jump to

Keyboard shortcuts

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