embedded

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeviceIdentifier

func NewDeviceIdentifier() string

Types

type Account

type Account struct {
	AccountUUID            string                  `json:"accountUuid,omitempty"`
	Email                  string                  `json:"email,omitempty"`
	VaultFormat            string                  `json:"vaultFormat,omitempty"`
	KdfConfig              models.KdfConfiguration `json:"kdfConfig,omitempty"`
	ProtectedSymmetricKey  string                  `json:"protectedSymmetricKey,omitempty"`
	ProtectedRSAPrivateKey string                  `json:"protectedRSAPrivateKey,omitempty"`
	Secrets                AccountSecrets          `json:"-"`
}

func (*Account) LoggedIn added in v0.11.1

func (a *Account) LoggedIn() bool

func (*Account) SecretsLoaded added in v0.11.1

func (a *Account) SecretsLoaded() bool

func (*Account) ToJSON

func (a *Account) ToJSON() string

type AccountSecrets

type AccountSecrets struct {
	MasterPasswordHash  string
	MainKey             symmetrickey.Key
	OrganizationSecrets map[string]OrganizationSecret
	RSAPrivateKey       *rsa.PrivateKey
}

func (*AccountSecrets) GetOrganizationKey

func (s *AccountSecrets) GetOrganizationKey(orgId string) (*symmetrickey.Key, error)

type BaseVault

type BaseVault interface {
	GetObject(ctx context.Context, obj models.Object) (*models.Object, error)
	ListObjects(ctx context.Context, objType models.ObjectType, options ...bitwarden.ListObjectsOption) ([]models.Object, error)
}

type MachineAccountClaims added in v0.10.0

type MachineAccountClaims struct {
	Organization string `json:"organization"`
	jwt.RegisteredClaims
}

type OrganizationSecret

type OrganizationSecret struct {
	Key              symmetrickey.Key
	OrganizationUUID string
	Name             string
}

type PasswordManagerClient added in v0.10.0

type PasswordManagerClient interface {
	BaseVault
	CreateObject(ctx context.Context, obj models.Object) (*models.Object, error)
	CreateOrganization(ctx context.Context, organizationName, organizationLabel, billingEmail string) (string, error)
	CreateAttachmentFromContent(ctx context.Context, itemId, filename string, content []byte) (*models.Object, error)
	CreateAttachmentFromFile(ctx context.Context, itemId, filePath string) (*models.Object, error)
	DeleteAttachment(ctx context.Context, itemId, attachmentId string) error
	DeleteObject(ctx context.Context, obj models.Object) error
	EditObject(ctx context.Context, obj models.Object) (*models.Object, error)
	GetAPIKey(ctx context.Context, username, password string) (*models.ApiKey, error)
	GetAttachment(ctx context.Context, itemId, attachmentId string) ([]byte, error)
	LoginWithAPIKey(ctx context.Context, password, clientId, clientSecret string) error
	LoginWithPassword(ctx context.Context, username, password string) error
	Logout(ctx context.Context) error
	RegisterUser(ctx context.Context, name, username, password string, kdfConfig models.KdfConfiguration) error
	Sync(ctx context.Context) error
	Unlock(ctx context.Context, password string) error
}

func NewPasswordManagerClient added in v0.10.0

func NewPasswordManagerClient(serverURL, deviceIdentifier, providerVersion string, opts ...PasswordManagerOptions) PasswordManagerClient

type PasswordManagerOptions added in v0.10.0

type PasswordManagerOptions func(c bitwarden.PasswordManager)

func DisableCryptoSafeMode

func DisableCryptoSafeMode() PasswordManagerOptions

DisableCryptoSafeMode disables the safe mode for crypto operations, which reverses crypto.Encrypt() to make sure it can decrypt the result.

func DisableObjectEncryptionVerification

func DisableObjectEncryptionVerification() PasswordManagerOptions

DisableObjectEncryptionVerification disables the systematic attempts to decrypt objects (items, folders, collections) after they have been created or edited, to verify that the encryption can be reverse.

func DisableSyncAfterWrite

func DisableSyncAfterWrite() PasswordManagerOptions

DisableSyncAfterWrite disables the systematic Sync() after a write operation (create, edit, delete) to the vault. Write operations already return the object that was created or edited, so Sync() is not strictly necessary.

func EnablePanicOnEncryptionError

func EnablePanicOnEncryptionError() PasswordManagerOptions

Panic on error is useful for debugging, but should not be used in production.

func WithPasswordManagerHttpOptions added in v0.10.0

func WithPasswordManagerHttpOptions(opts ...webapi.Options) PasswordManagerOptions

type SecretType added in v0.11.0

type SecretType interface {
	webapi.SecretSummary | webapi.Secret
}

type SecretsManager added in v0.10.0

type SecretsManager interface {
	CreateProject(ctx context.Context, project models.Project) (*models.Project, error)
	CreateSecret(ctx context.Context, secret models.Secret) (*models.Secret, error)
	DeleteProject(ctx context.Context, project models.Project) error
	DeleteSecret(ctx context.Context, secret models.Secret) error
	EditProject(ctx context.Context, project models.Project) (*models.Project, error)
	EditSecret(ctx context.Context, secret models.Secret) (*models.Secret, error)
	GetProject(ctx context.Context, project models.Project) (*models.Project, error)
	GetSecret(ctx context.Context, secret models.Secret) (*models.Secret, error)
	GetSecretByKey(ctx context.Context, secretKey string) (*models.Secret, error)
	LoginWithAccessToken(ctx context.Context, accessToken string) error
}

func NewSecretsManagerClient added in v0.10.0

func NewSecretsManagerClient(serverURL, deviceIdentifier, providerVersion string, opts ...SecretsManagerOptions) SecretsManager

type SecretsManagerOptions added in v0.10.0

type SecretsManagerOptions func(c bitwarden.SecretsManager)

func WithSecretsManagerHttpOptions added in v0.10.0

func WithSecretsManagerHttpOptions(opts ...webapi.Options) SecretsManagerOptions

Jump to

Keyboard shortcuts

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