bwcli

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterObjectsByType

func FilterObjectsByType(objs []models.Object, itemType models.ItemType) []models.Object

Types

type CLIClient

type CLIClient interface {
	CreateAttachment(ctx context.Context, itemId, filePath string) (*models.Object, error)
	CreateObject(context.Context, models.Object) (*models.Object, error)
	EditObject(context.Context, models.Object) (*models.Object, error)
	GetAttachment(ctx context.Context, itemId, attachmentId string) ([]byte, error)
	GetObject(context.Context, models.Object) (*models.Object, error)
	GetSessionKey() string
	HasSessionKey() bool
	ListObjects(ctx context.Context, objType models.ObjectType, options ...bitwarden.ListObjectsOption) ([]models.Object, error)
	LoginWithAPIKey(ctx context.Context, password, clientId, clientSecret string) error
	LoginWithPassword(ctx context.Context, username, password string) error
	Logout(context.Context) error
	DeleteAttachment(ctx context.Context, itemId, attachmentId string) error
	DeleteObject(context.Context, models.Object) error
	SetServer(context.Context, string) error
	SetSessionKey(string)
	Status(context.Context) (*Status, error)
	Sync(context.Context) error
	Unlock(ctx context.Context, password string) error
}

func NewClient

func NewClient(execPath string, opts ...Options) CLIClient

type Options

type Options func(c bitwarden.Client)

func DisableRetryBackoff

func DisableRetryBackoff() Options

func DisableSync

func DisableSync() Options

func WithAppDataDir

func WithAppDataDir(appDataDir string) Options

func WithExtraCACertsPath

func WithExtraCACertsPath(extraCACertsPath string) Options

type Status

type Status struct {
	ServerURL string      `json:"serverURL,omitempty"`
	LastSync  time.Time   `json:"lastSync,omitempty"`
	UserEmail string      `json:"userEmail,omitempty"`
	UserID    string      `json:"userID,omitempty"`
	Status    VaultStatus `json:"status,omitempty"`
}

func (*Status) VaultFromServer

func (s *Status) VaultFromServer(serverUrl string) bool

func (*Status) VaultOfUser

func (s *Status) VaultOfUser(email string) bool

type VaultStatus

type VaultStatus string
const (
	StatusLocked          VaultStatus = "locked"
	StatusUnauthenticated VaultStatus = "unauthenticated"
	StatusUnlocked        VaultStatus = "unlocked"
)

Jump to

Keyboard shortcuts

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