store

package
v1.3.31 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const VersionContentAlreadyExists = "version content already exists"

Variables

View Source
var (
	AppStoreOfficialMaintainerPublicKeyOpenSSH = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKlo+3ABMOUtj4JSvbYVnIDhCqrxkiMvleXudu9Lwc87"

	ApiPrefix    = "/api"
	WipeDataPath = ApiPrefix + "/wipe-data"

	LoginPath                = userPath + "/login"
	LogoutPath               = userPath + "/logout"
	DeleteUserPath           = userPath + "/delete"
	ChangePasswordPath       = userPath + "/change-password"
	AccountDetailsPath       = userPath + "/details"
	SetupInitialPasswordPath = userPath + "/setup-password"
	EmailChangePath          = userPath + "/email-change"

	VersionPath                      = ApiPrefix + "/versions"
	VersionUploadPath                = VersionPath + "/upload"
	VersionDeletePath                = VersionPath + "/delete"
	GetVersionsPath                  = VersionPath + "/list"
	DownloadPath                     = VersionPath + "/download"
	DownloadByIDPath                 = VersionPath + "/download-by-id"
	DownloadNextVersionForUpdatePath = VersionPath + "/download-next-for-update"
	VersionMigrationCheckpointPath   = VersionPath + "/migration-checkpoint"

	AppPath         = ApiPrefix + "/apps"
	AppCreationPath = AppPath + "/create"
	AppGetListPath  = AppPath + "/get-list"
	AppDeletePath   = AppPath + "/delete"
	SearchAppsPath  = AppPath + "/search"

	EmailConfigPath      = ApiPrefix + "/email-config"
	EmailConfigReadPath  = EmailConfigPath + "/read"
	EmailConfigWritePath = EmailConfigPath + "/write"

	AdminEmailPath            = ApiPrefix + "/admin/email"
	AdminEmailTestPath        = AdminEmailPath + "/test"
	AdminEmailMaintainersPath = AdminEmailPath + "/maintainers"

	MaintainerPublicKeyPath     = ApiPrefix + "/maintainers/public-key"
	AdminMaintainerPath         = ApiPrefix + "/admin/maintainers"
	AdminMaintainerCreatePath   = AdminMaintainerPath + "/create"
	AdminMaintainerListPath     = AdminMaintainerPath + "/list"
	AdminMaintainerDeletePath   = AdminMaintainerPath + "/delete"
	AdminMaintainerSetSpacePath = AdminMaintainerPath + "/set-space"
)

Functions

func EncodeMaintainerPublicKeyPayload added in v1.3.8

func EncodeMaintainerPublicKeyPayload(maintainer string, publicKeyRaw []byte) ([]byte, error)

func SignMaintainerPublicKey added in v1.3.8

func SignMaintainerPublicKey(privateKey ed25519.PrivateKey, maintainer string, publicKeyRaw []byte) ([]byte, error)

func VerifyMaintainerPublicKeySignature added in v1.3.8

func VerifyMaintainerPublicKeySignature(adminPublicKey ed25519.PublicKey, record *MaintainerPublicKeyRecord) (bool, error)

Types

type AccountDetails

type AccountDetails struct {
	Name                 string
	Email                string
	PublicKeyRaw         []byte
	CookieExpirationDate time.Time
	UsedSpaceInBytes     int64
	StorageLimitInBytes  int64
	IsAdmin              bool
}

type AdminEmailRequest added in v1.3.8

type AdminEmailRequest struct {
	Subject string `validate:"email_subject"`
	Body    string `validate:"email_body"`
}

type AdminEmailSendFailure added in v1.3.8

type AdminEmailSendFailure struct {
	Recipient string
	Error     string
}

type AdminEmailSendResult added in v1.3.8

type AdminEmailSendResult struct {
	SentCount   int
	FailedCount int
	Failures    []AdminEmailSendFailure
}

type AdminMaintainer added in v1.3.19

type AdminMaintainer struct {
	Name         string
	Email        string
	PublicKeyRaw []byte
	IsActive     bool
}

type AdminMaintainerCreateForm added in v1.3.8

type AdminMaintainerCreateForm struct {
	Name               string `validate:"default"`
	Email              string `validate:"email"`
	PublicKeyRaw       []byte
	PublicKeySignature []byte
}

type AdminMaintainerStorageLimitForm added in v1.3.19

type AdminMaintainerStorageLimitForm struct {
	Name                string `validate:"default"`
	StorageLimitInBytes int64
}

type AppNameString

type AppNameString struct {
	Value string `json:"value" validate:"default"`
}

type AppStoreClient

type AppStoreClient interface {
	Login(username, password string) error
	DeleteOwnAccount() error
	CreateApp(appName string) error
	SearchForApps(maintainerSearchTerm, appSearchTerm string, showUnofficialApps bool) ([]AppWithLatestVersion, error)
	ListOwnApps() ([]string, error)
	UploadVersionAndReturnCreatedVersion(appName, versionName string, creationTimestamp time.Time, content, signature []byte) (*CreatedVersionResponse, error)
	DownloadVersionByID(versionId int) (*Version, error)
	DownloadNextVersionForUpdate(userName, appName string, currentVersionCreationTimestamp time.Time) (*NextVersionForUpdateResponse, error)
	ListVersions(userName, appName string) ([]LeanVersionDto, error)
	DeleteVersionByID(versionId int) error
	SetVersionMigrationCheckpoint(versionId int, isMigrationCheckpoint bool) error
	DeleteApp(appName string) error
	ChangePassword(oldPassword, newPassword string) error
	Logout() error
	GetAccountDetails() (*AccountDetails, error)

	GetEmailConfig() (*u.EmailConfig, error)
	SetEmailConfig(emailConfig *u.EmailConfig) error

	ChangeEmail(email string) error

	CreateMaintainerByAdmin(name, email string, publicKeyRaw, publicKeySignature []byte) error
	ListMaintainersByAdmin() ([]AdminMaintainer, error)
	DeleteMaintainerByAdmin(name string) error
	SetMaintainerStorageLimitByAdmin(name string, storageLimitInBytes int64) error
	GetMaintainerPublicKeyRecord(maintainer string) (*MaintainerPublicKeyRecord, error)
	SetupInitialPassword(setupToken, password string) error

	SendTestEmailByAdmin(subject, body string) (*AdminEmailSendResult, error)
	SendEmailToMaintainersByAdmin(subject, body string) (*AdminEmailSendResult, error)
}

type AppStoreClientImpl

type AppStoreClientImpl struct {
	Parent u.ComponentClient
}

func (*AppStoreClientImpl) ChangeEmail added in v1.3.8

func (h *AppStoreClientImpl) ChangeEmail(email string) error

func (*AppStoreClientImpl) ChangePassword

func (h *AppStoreClientImpl) ChangePassword(oldPassword, newPassword string) error

func (*AppStoreClientImpl) CreateApp

func (h *AppStoreClientImpl) CreateApp(appName string) error

func (*AppStoreClientImpl) CreateMaintainerByAdmin added in v1.3.8

func (h *AppStoreClientImpl) CreateMaintainerByAdmin(name, email string, publicKeyRaw, publicKeySignature []byte) error

func (*AppStoreClientImpl) DeleteApp

func (h *AppStoreClientImpl) DeleteApp(appName string) error

func (*AppStoreClientImpl) DeleteMaintainerByAdmin added in v1.3.8

func (h *AppStoreClientImpl) DeleteMaintainerByAdmin(name string) error

func (*AppStoreClientImpl) DeleteOwnAccount

func (h *AppStoreClientImpl) DeleteOwnAccount() error

func (*AppStoreClientImpl) DeleteVersionByID added in v1.2.35

func (h *AppStoreClientImpl) DeleteVersionByID(versionId int) error

func (*AppStoreClientImpl) DownloadNextVersionForUpdate added in v1.3.8

func (h *AppStoreClientImpl) DownloadNextVersionForUpdate(userName, appName string, currentVersionCreationTimestamp time.Time) (*NextVersionForUpdateResponse, error)

func (*AppStoreClientImpl) DownloadVersionByID added in v1.2.35

func (h *AppStoreClientImpl) DownloadVersionByID(versionId int) (*Version, error)

func (*AppStoreClientImpl) GetAccountDetails

func (h *AppStoreClientImpl) GetAccountDetails() (*AccountDetails, error)

func (*AppStoreClientImpl) GetEmailConfig

func (h *AppStoreClientImpl) GetEmailConfig() (*u.EmailConfig, error)

func (*AppStoreClientImpl) GetMaintainerPublicKeyRecord added in v1.3.8

func (h *AppStoreClientImpl) GetMaintainerPublicKeyRecord(maintainer string) (*MaintainerPublicKeyRecord, error)

func (*AppStoreClientImpl) ListMaintainersByAdmin added in v1.3.19

func (h *AppStoreClientImpl) ListMaintainersByAdmin() ([]AdminMaintainer, error)

func (*AppStoreClientImpl) ListOwnApps

func (h *AppStoreClientImpl) ListOwnApps() ([]string, error)

func (*AppStoreClientImpl) ListVersions

func (h *AppStoreClientImpl) ListVersions(userName, appName string) ([]LeanVersionDto, error)

func (*AppStoreClientImpl) Login

func (h *AppStoreClientImpl) Login(username, password string) error

func (*AppStoreClientImpl) Logout

func (h *AppStoreClientImpl) Logout() error

func (*AppStoreClientImpl) SearchForApps

func (h *AppStoreClientImpl) SearchForApps(maintainerSearchTerm, appSearchTerm string, showUnofficialApps bool) ([]AppWithLatestVersion, error)

func (*AppStoreClientImpl) SendEmailToMaintainersByAdmin added in v1.3.8

func (h *AppStoreClientImpl) SendEmailToMaintainersByAdmin(subject, body string) (*AdminEmailSendResult, error)

func (*AppStoreClientImpl) SendTestEmailByAdmin added in v1.3.8

func (h *AppStoreClientImpl) SendTestEmailByAdmin(subject, body string) (*AdminEmailSendResult, error)

func (*AppStoreClientImpl) SetEmailConfig

func (h *AppStoreClientImpl) SetEmailConfig(emailConfig *u.EmailConfig) error

func (*AppStoreClientImpl) SetMaintainerStorageLimitByAdmin added in v1.3.19

func (h *AppStoreClientImpl) SetMaintainerStorageLimitByAdmin(name string, storageLimitInBytes int64) error

func (*AppStoreClientImpl) SetVersionMigrationCheckpoint added in v1.3.8

func (h *AppStoreClientImpl) SetVersionMigrationCheckpoint(versionId int, isMigrationCheckpoint bool) error

func (*AppStoreClientImpl) SetupInitialPassword added in v1.3.8

func (h *AppStoreClientImpl) SetupInitialPassword(setupToken, password string) error

func (*AppStoreClientImpl) UploadVersionAndReturnCreatedVersion added in v1.2.35

func (h *AppStoreClientImpl) UploadVersionAndReturnCreatedVersion(appName, versionName string, creationTimestamp time.Time, content, signature []byte) (*CreatedVersionResponse, error)

func (*AppStoreClientImpl) WipeData

func (s *AppStoreClientImpl) WipeData()

type AppTree

type AppTree struct {
	Maintainer string `validate:"default"`
	AppName    string `validate:"default"`
}

type AppWithLatestVersion

type AppWithLatestVersion struct {
	Maintainer                     string
	AppName                        string
	LatestVersionId                int
	LatestVersionName              string
	LatestVersionCreationTimestamp time.Time
}

type ChangePasswordForm

type ChangePasswordForm struct {
	OldPassword string `validate:"password"`
	NewPassword string `validate:"password"`
}

type CreatedVersionResponse

type CreatedVersionResponse struct {
	AppId     int `json:"app_id"`
	VersionId int `json:"version_id"`
}

type EmailString

type EmailString struct {
	Value string `json:"value" validate:"email"`
}

type LeanVersionDto

type LeanVersionDto struct {
	VersionId             int       `json:"version_id"`
	Name                  string    `json:"name"`
	CreationTimestamp     time.Time `json:"creation_timestamp"`
	SizeInBytes           int64     `json:"size_in_bytes"`
	IsMigrationCheckpoint bool      `json:"is_migration_checkpoint"`
	DownloadCount         int64     `json:"download_count"`
}

type LoginCredentials

type LoginCredentials struct {
	User     string `validate:"default"`
	Password string `validate:"password"`
}

type MaintainerNameString added in v1.3.8

type MaintainerNameString struct {
	Value string `json:"value" validate:"default"`
}

type MaintainerPublicKeyRecord added in v1.3.8

type MaintainerPublicKeyRecord struct {
	Maintainer         string
	PublicKeyRaw       []byte
	PublicKeySignature []byte
}

type NextVersionForUpdateRequest added in v1.3.8

type NextVersionForUpdateRequest struct {
	Maintainer                      string `validate:"default"`
	AppName                         string `validate:"default"`
	CurrentVersionCreationTimestamp time.Time
}

type NextVersionForUpdateResponse added in v1.3.8

type NextVersionForUpdateResponse struct {
	UpdateAvailable bool
	Version         *Version
}

type NumberString

type NumberString struct {
	Value string `json:"value" validate:"number"`
}

type SearchRequest

type SearchRequest struct {
	MaintainerSearchTerm string `validate:"search_term"`
	AppSearchTerm        string `validate:"search_term"`
	ShowUnofficialApps   bool
}

type SecretString

type SecretString struct {
	Value string `json:"value" validate:"secret"`
}

type SetupInitialPasswordForm added in v1.3.8

type SetupInitialPasswordForm struct {
	Token    string `validate:"secret"`
	Password string `validate:"password"`
}

type UserNameString

type UserNameString struct {
	Value string `json:"value" validate:"number"`
}

type Version

type Version struct {
	VersionId                        int `json:"version_id"`
	Maintainer, AppName, VersionName string
	Content, Signature               []byte
	MaintainerPublicKeyRaw           []byte
	VersionCreationTimestamp         time.Time
	IsMigrationCheckpoint            bool
}

type VersionID added in v1.2.35

type VersionID struct {
	VersionId int `json:"version_id"`
}

type VersionMigrationCheckpointRequest added in v1.3.8

type VersionMigrationCheckpointRequest struct {
	VersionId             int `json:"version_id"`
	IsMigrationCheckpoint bool
}

type VersionSigningCodec

type VersionSigningCodec interface {
	EncodeVersion(version *Version) ([]byte, error)
}

type VersionSigningCodecImpl

type VersionSigningCodecImpl struct{}

func (*VersionSigningCodecImpl) EncodeVersion

func (c *VersionSigningCodecImpl) EncodeVersion(version *Version) ([]byte, error)

type VersionSigningService

type VersionSigningService interface {
	SignVersion(privateKey ed25519.PrivateKey, version *Version) ([]byte, error)
	VerifyVersionSignature(publicKey ed25519.PublicKey, version *Version) (bool, error)
}

type VersionSigningServiceImpl

type VersionSigningServiceImpl struct {
	Codec       VersionSigningCodec
	BytesSigner u.BytesSigner
}

func (*VersionSigningServiceImpl) SignVersion

func (s *VersionSigningServiceImpl) SignVersion(privateKey ed25519.PrivateKey, version *Version) ([]byte, error)

func (*VersionSigningServiceImpl) VerifyVersionSignature

func (s *VersionSigningServiceImpl) VerifyVersionSignature(publicKey ed25519.PublicKey, version *Version) (bool, error)

type VersionTree

type VersionTree struct {
	Maintainer  string `validate:"default"`
	AppName     string `validate:"default"`
	VersionName string `validate:"version_name"`
}

type VersionUploadDto

type VersionUploadDto struct {
	AppName           string `validate:"default"`
	Version           string `validate:"version_name"`
	CreationTimestamp time.Time
	Content           []byte
	Signature         []byte
}

Jump to

Keyboard shortcuts

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