embedded

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: MPL-2.0 Imports: 26 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 {
	GetFolder(ctx context.Context, obj models.Folder) (*models.Folder, error)
	GetItem(ctx context.Context, obj models.Item) (*models.Item, error)
	GetOrganization(context.Context, models.Organization) (*models.Organization, error)

	FindFolder(ctx context.Context, options ...bitwarden.ListObjectsOption) (*models.Folder, error)
	FindItem(ctx context.Context, options ...bitwarden.ListObjectsOption) (*models.Item, error)
	FindOrganization(ctx context.Context, options ...bitwarden.ListObjectsOption) (*models.Organization, error)
}

type MachineAccountClaims added in v0.10.0

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

type OrgMemberStore added in v0.13.0

type OrgMemberStore map[string][]models.OrgMember

func NewOrgMemberStore added in v0.13.0

func NewOrgMemberStore() OrgMemberStore

func (OrgMemberStore) AddMember added in v0.13.0

func (m OrgMemberStore) AddMember(orgId string, member models.OrgMember)

func (OrgMemberStore) FindMemberByEmail added in v0.13.0

func (m OrgMemberStore) FindMemberByEmail(orgId, userEmail string) (*models.OrgMember, error)

func (OrgMemberStore) FindMemberByID added in v0.13.0

func (m OrgMemberStore) FindMemberByID(orgId, memberId string) (*models.OrgMember, error)

func (OrgMemberStore) FindMemberByName added in v0.13.0

func (m OrgMemberStore) FindMemberByName(orgId, userName string) (*models.OrgMember, error)

func (OrgMemberStore) ForgetOrganization added in v0.13.0

func (m OrgMemberStore) ForgetOrganization(orgId string)

func (OrgMemberStore) LoadMembers added in v0.13.0

func (m OrgMemberStore) LoadMembers(orgId string, users []webapi.OrganizationUserDetails)

func (OrgMemberStore) OrganizationInitialized added in v0.13.0

func (m OrgMemberStore) OrganizationInitialized(orgId string) bool

type OrganizationSecret

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

type PasswordManagerClient added in v0.10.0

type PasswordManagerClient interface {
	BaseVault
	ConfirmInvite(ctx context.Context, orgId, userEmail string) (string, error)
	CreateFolder(ctx context.Context, obj models.Folder) (*models.Folder, error)
	CreateItem(ctx context.Context, obj models.Item) (*models.Item, error)
	CreateOrganization(ctx context.Context, organizationName, organizationLabel, billingEmail string) (string, error)
	CreateOrganizationCollection(ctx context.Context, collection models.OrgCollection) (*models.OrgCollection, error)
	CreateAttachmentFromContent(ctx context.Context, itemId, filename string, content []byte) (*models.Item, error)
	CreateAttachmentFromFile(ctx context.Context, itemId, filePath string) (*models.Item, error)
	DeleteAttachment(ctx context.Context, itemId, attachmentId string) error
	DeleteFolder(ctx context.Context, obj models.Folder) error
	DeleteItem(ctx context.Context, obj models.Item) error
	DeleteOrganizationCollection(ctx context.Context, obj models.OrgCollection) error
	EditFolder(ctx context.Context, obj models.Folder) (*models.Folder, error)
	EditItem(ctx context.Context, obj models.Item) (*models.Item, error)
	EditOrganizationCollection(ctx context.Context, collection models.OrgCollection) (*models.OrgCollection, error)
	FindOrganizationMember(ctx context.Context, options ...bitwarden.ListObjectsOption) (*models.OrgMember, error)
	FindOrganizationCollection(ctx context.Context, options ...bitwarden.ListObjectsOption) (*models.OrgCollection, error)
	GetAPIKey(ctx context.Context, username, password string) (*models.ApiKey, error)
	GetAttachment(ctx context.Context, itemId, attachmentId string) ([]byte, error)
	GetOrganization(context.Context, models.Organization) (*models.Organization, error)
	GetOrganizationMember(context.Context, models.OrgMember) (*models.OrgMember, error)
	GetOrganizationCollection(ctx context.Context, collection models.OrgCollection) (*models.OrgCollection, error)
	InviteUser(ctx context.Context, orgId, userEmail string, memberRoleType models.OrgMemberRoleType) 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

type SupportedCipher added in v0.13.0

type SupportedCipher interface {
	models.Item | models.Folder | webapi.Collection
}

Jump to

Keyboard shortcuts

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