vault

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func New

func New(
	repo repository.Repo,
	subscriptions service.SubscriptionService,
) *Service

func (*Service) AcceptInvite

func (s *Service) AcceptInvite(ctx context.Context, token string) error

func (*Service) AddMember

func (s *Service) AddMember(ctx context.Context, vaultID, targetUserUuid uuid.UUID, role artel_q.VaultRole) error
func (s *Service) CreateInviteLink(
	ctx context.Context,
	vaultID uuid.UUID,
	role artel_q.VaultRole,
) (domain.VaultInvite, error)

func (*Service) CreateVault

func (s *Service) CreateVault(ctx context.Context, vaultName string) (domain.Vault, error)

func (*Service) DeleteVault

func (s *Service) DeleteVault(ctx context.Context, vaultID uuid.UUID) error

func (*Service) DisablePostgresDatabase added in v1.0.15

func (s *Service) DisablePostgresDatabase(ctx context.Context, vaultID uuid.UUID) error

DisablePostgresDatabase best-effort drops vaultID's provisioned database+role (tolerating a server that's gone or unreachable — DropDatabase/DropRole are already IF EXISTS/idempotent, see vaultpg.AdminClient), then deletes the row. No-op if Postgres was never enabled for this vault. Only the vault owner may disable it, mirroring PublishVault/UnpublishVault's owner check for other destructive per-vault settings.

func (*Service) EnablePostgresDatabase added in v1.0.15

func (s *Service) EnablePostgresDatabase(ctx context.Context, vaultID uuid.UUID) (domain.VaultPostgresDatabase, error)

EnablePostgresDatabase provisions a Postgres database+role for vaultID on a pool instance resolved via postgresInstancesRepo.PickForUser (prefers the caller's BYOK postgres connection, falling back to the shared admin pool). The vaultPostgresRepo row is created up front with status=provisioning (see repository.VaultPostgresDatabases.Create) before the live provisioning calls run, so a mid-flight failure leaves a retryable/inspectable 'error' row rather than silently returning an error with no persisted trace — mirrors the Workbench provisioning->ready/error lifecycle.

func (*Service) GetPostgresDatabase added in v1.0.15

func (s *Service) GetPostgresDatabase(ctx context.Context, vaultID uuid.UUID) (sql.Null[domain.VaultPostgresDatabase], error)

GetPostgresDatabase returns vaultID's Postgres database row, Valid: false when Postgres has never been enabled for this vault.

func (*Service) GetVault

func (s *Service) GetVault(ctx context.Context, vaultID uuid.UUID) (domain.Vault, error)

func (*Service) LinkS3Bucket

func (s *Service) LinkS3Bucket(ctx context.Context, vaultID uuid.UUID, s3InstanceID *uuid.UUID, bucketName string) error

LinkS3Bucket links vaultID to an S3 bucket on s3InstanceID. When s3InstanceID is nil, the instance is auto-resolved via s3InstancesRepo.PickForUser (prefers the caller's BYOK s3 connection, falling back to the shared admin pool) instead of requiring an explicit id.

func (s *Service) ListInviteLinks(ctx context.Context, vaultID uuid.UUID) ([]domain.VaultInvite, error)

func (*Service) ListMembers

func (s *Service) ListMembers(ctx context.Context, vaultID uuid.UUID) ([]domain.VaultMemberInfo, error)

func (*Service) ListVaults

func (s *Service) ListVaults(ctx context.Context) ([]domain.Vault, error)

func (*Service) PublishVault

func (s *Service) PublishVault(ctx context.Context, vaultID uuid.UUID, slug string) (domain.Vault, error)

func (*Service) RemoveMember

func (s *Service) RemoveMember(ctx context.Context, vaultID, targetUserUuid uuid.UUID) error
func (s *Service) RevokeInviteLink(ctx context.Context, inviteID uuid.UUID) error

func (*Service) SetUseCouchDBForBinaries

func (s *Service) SetUseCouchDBForBinaries(ctx context.Context, vaultID uuid.UUID, useCouchDB bool) error

func (*Service) UnlinkS3Bucket

func (s *Service) UnlinkS3Bucket(ctx context.Context, vaultID uuid.UUID) error

func (*Service) UnpublishVault

func (s *Service) UnpublishVault(ctx context.Context, vaultID uuid.UUID) error

Jump to

Keyboard shortcuts

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