server

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package server runs a throwaway Passbolt in Docker for integration tests.

Keep identical to internal/e2e/server/server.go in go-passbolt.

Index

Constants

View Source
const (

	// PassboltImageEnv overrides the Passbolt image, to test another release.
	PassboltImageEnv = "PASSBOLT_TEST_IMAGE"
)

Images are pinned by tag and digest. Update both together.

Variables

This section is empty.

Functions

func PassboltImage

func PassboltImage() string

PassboltImage returns the Passbolt image Start will use.

Types

type Credentials

type Credentials struct {
	UserID     string
	Email      string
	Password   string
	PrivateKey string // armored, locked with Password
}

Credentials of a Passbolt user.

type Passbolt

type Passbolt struct {
	BaseURL string
	// contains filtered or unexported fields
}

Passbolt is a running Passbolt server.

func Start

func Start(ctx context.Context) (*Passbolt, error)

Start runs MariaDB and Passbolt in Docker. The caller must Close it.

func (*Passbolt) Close

func (p *Passbolt) Close(ctx context.Context) error

Close stops the containers and network. Safe to call more than once.

func (*Passbolt) CreateUser

func (p *Passbolt) CreateUser(ctx context.Context, email, first, last, role, password string) (Credentials, error)

CreateUser registers a user and completes their account setup.

func (*Passbolt) EnableV5Resources

func (p *Passbolt) EnableV5Resources(ctx context.Context, admin Credentials) error

EnableV5Resources creates a shared metadata key and allows V5 resources, which a new server does not. Call it before other clients log in, since clients cache these settings at login. admin must have the admin role.

func (*Passbolt) RegisterUser

func (p *Passbolt) RegisterUser(ctx context.Context, email, first, last, role string) (userID, token string, err error)

RegisterUser invites a user and returns their ID and setup token. role is "user" or "admin".

Jump to

Keyboard shortcuts

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