sharehdl

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const EncryptionPartHeader = "X-Encryption-Part"

Variables

This section is empty.

Functions

This section is empty.

Types

type Entropy

type Entropy string
const (
	EntropyNone    Entropy = "none"
	EntropyUser    Entropy = "user"
	EntropyProject Entropy = "project"
)

type GetShareResponse

type GetShareResponse Share

type Handler

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

func New

func (*Handler) DeleteShare added in v0.1.6

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

DeleteShare deletes a share @Summary Delete share @Description Delete a share for the user @Tags Share @Accept json @Produce json @Param X-API-Key header string true "API Key" @Param Authorization header string true "Bearer token" @Param X-Auth-Provider header string true "Auth Provider" @Param X-Openfort-Provider header string false "Openfort Provider" @Param X-Openfort-Token-Type header string false "Openfort Token Type" @Success 204 "Description: Share deleted successfully" @Failure 404 "Description: Not Found" @Failure 500 "Description: Internal Server Error" @Router /shares [delete]

func (*Handler) GetShare

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

GetShare gets a share @Summary Get share @Description Get a share for the user @Tags Share @Accept json @Produce json @Param X-API-Key header string true "API Key" @Param Authorization header string true "Bearer token" @Param X-Auth-Provider header string true "Auth Provider" @Param X-Openfort-Provider header string false "Openfort Provider" @Param X-Openfort-Token-Type header string false "Openfort Token Type" @Param X-Encryption-Part header string false "Encryption Part" @Success 200 {object} GetShareResponse "Successful response" @Failure 404 "Description: Not Found" @Failure 500 "Description: Internal Server Error" @Router /shares [get]

func (*Handler) RegisterShare

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

RegisterShare registers a new share @Summary Register new share @Description Register a new share for the user @Tags Share @Accept json @Produce json @Param X-API-Key header string true "API Key" @Param Authorization header string true "Bearer token" @Param X-Auth-Provider header string true "Auth Provider" @Param X-Openfort-Provider header string false "Openfort Provider" @Param X-Openfort-Token-Type header string false "Openfort Token Type" @Param registerShareRequest body RegisterShareRequest true "Register Share Request" @Success 201 "Description: Share registered successfully" @Failure 400 {object} api.Error "Bad Request" @Failure 404 {object} api.Error "Not Found" @Failure 500 {object} api.Error "Internal Server Error" @Router /shares/register [post]

type RegisterShareRequest

type RegisterShareRequest Share

type Share

type Share struct {
	Secret         string  `json:"secret"`
	Entropy        Entropy `json:"entropy"`
	Salt           string  `json:"salt,omitempty"`
	Iterations     int     `json:"iterations,omitempty"`
	Length         int     `json:"length,omitempty"`
	Digest         string  `json:"digest,omitempty"`
	EncryptionPart string  `json:"encryption_part,omitempty"`
}

Jump to

Keyboard shortcuts

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