bitwarden

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WEBSOCKET_SLEEP_DURATION_SECONDS = 60
)

Variables

This section is empty.

Functions

func CreateSend added in v0.2.11

func CreateSend(ctx context.Context, cfg *config.Config, vault *vault.Vault, name string, text string) (string, error)

func DeleteCipher

func DeleteCipher(ctx context.Context, uuid string, cfg *config.Config) error

func DoFullSync

func DoFullSync(ctx context.Context, vault *vault.Vault, config *config.Config, userSymmetricKey *crypto.SymmetricEncryptionKey, allowCache bool) error

func GetCipher

func GetCipher(ctx context.Context, uuid string, cfg *config.Config) (models.Cipher, error)

func PostCipher

func PostCipher(ctx context.Context, cipher models.Cipher, cfg *config.Config) (models.Cipher, error)

func PutAuthRequest

func PutAuthRequest(ctx context.Context, requestUUID string, authRequest AuthRequestData, config *config.Config) error

func PutCipher

func PutCipher(ctx context.Context, uuid string, cipher models.Cipher, cfg *config.Config) (models.Cipher, error)

func ReadVault

func ReadVault(path string) (models.SyncData, error)

func RefreshToken

func RefreshToken(ctx context.Context, cfg *config.Config) bool

func RunWebsocketDaemon

func RunWebsocketDaemon(ctx context.Context, vault *vault.Vault, cfg *config.Config)

func Sync

func Sync(ctx context.Context, config *config.Config) (models.SyncData, error)

func WriteVault

func WriteVault(data models.SyncData, path string) error

Types

type AuthRequestData

type AuthRequestData struct {
	CreationDate       time.Time `json:"creationDate"`
	ID                 string    `json:"id"`
	Key                string    `json:"key"`
	MasterPasswordHash string    `json:"masterPasswordHash"`
	Object             string    `json:"object"`
	Origin             string    `json:"origin"`
	PublicKey          string    `json:"publicKey"`
	RequestApproved    bool      `json:"requestApproved"`
	RequestDeviceType  string    `json:"requestDeviceType"`
	RequestIpAddress   string    `json:"requestIpAddress"`
	ResponseDate       time.Time `json:"responseDate"`
}

func CreateAuthRequest added in v0.1.4

func CreateAuthRequest(ctx context.Context, code string, deviceIdentifier string, email string, publicKey string, config *config.Config) (AuthRequestData, error)

func GetAuthRequest

func GetAuthRequest(ctx context.Context, requestUUID string, config *config.Config) (AuthRequestData, error)

func GetAuthRequests

func GetAuthRequests(ctx context.Context, config *config.Config) ([]AuthRequestData, error)

func GetAuthResponse added in v0.1.6

func GetAuthResponse(ctx context.Context, code string, requestUUID string, config *config.Config) (AuthRequestData, error)

type AuthRequestResponseData

type AuthRequestResponseData struct {
	DeviceIdentifier   string `json:"deviceIdentifier"`
	Key                string `json:"key"`
	MasterPasswordHash string `json:"masterPasswordHash"`
	Requestapproved    bool   `json:"requestApproved"`
}

func CreateAuthResponse

func CreateAuthResponse(ctx context.Context, authRequest AuthRequestData, keyring *crypto.Keyring, config *config.Config) (AuthRequestResponseData, error)

type AuthToken

type AuthToken struct{}

type CreateAuthRequestData added in v0.1.4

type CreateAuthRequestData struct {
	AccessCode       string `json:"accessCode"`
	DeviceIdentifier string `json:"deviceIdentifier"`
	Email            string `json:"email"`
	PublicKey        string `json:"publicKey"`
	Type             int    `json:"type"`
}

type LoginResponseToken

type LoginResponseToken struct {
	AccessToken    string `json:"access_token"`
	ExpiresIn      int    `json:"expires_in"`
	TokenType      string `json:"token_type"`
	RefreshToken   string `json:"refresh_token"`
	Key            string `json:"key"`
	Kdf            int    `json:"Kdf"`
	KdfIterations  int    `json:"KdfIterations"`
	KdfMemory      int    `json:"KdfMemory"`
	KdfParallelism int    `json:"KdfParallelism"`
}

func LoginWithApiKey added in v0.2.8

func LoginWithApiKey(ctx context.Context, email string, cfg *config.Config, vault *vault.Vault) (LoginResponseToken, crypto.MasterKey, string, error)

func LoginWithDevice added in v0.1.4

func LoginWithDevice(ctx context.Context, email string, cfg *config.Config, vault *vault.Vault) (LoginResponseToken, crypto.MasterKey, string, error)

func LoginWithMasterpassword

func LoginWithMasterpassword(ctx context.Context, email string, cfg *config.Config, vault *vault.Vault) (LoginResponseToken, crypto.MasterKey, string, error)

func Perform2FA added in v0.1.4

func Perform2FA(values url.Values, errsc *errStatusCode, cfg *config.Config, ctx context.Context) (LoginResponseToken, error)

type NotificationMessageType

type NotificationMessageType int64
const (
	SyncCipherUpdate NotificationMessageType = 0
	SyncCipherCreate NotificationMessageType = 1
	SyncLoginDelete  NotificationMessageType = 2
	SyncFolderDelete NotificationMessageType = 3
	SyncCiphers      NotificationMessageType = 4

	SyncVault        NotificationMessageType = 5
	SyncOrgKeys      NotificationMessageType = 6
	SyncFolderCreate NotificationMessageType = 7
	SyncFolderUpdate NotificationMessageType = 8
	SyncCipherDelete NotificationMessageType = 9
	SyncSettings     NotificationMessageType = 10

	LogOut NotificationMessageType = 11

	SyncSendCreate NotificationMessageType = 12
	SyncSendUpdate NotificationMessageType = 13
	SyncSendDelete NotificationMessageType = 14

	AuthRequest         NotificationMessageType = 15
	AuthRequestResponse NotificationMessageType = 16
)

type SendCreateRequest added in v0.2.11

type SendCreateRequest struct {
	AccessCount    *int             `json:"accessCount"`
	AccessId       *string          `json:"accessId"`
	DeletionDate   string           `json:"deletionDate"`
	Disabled       bool             `json:"disabled"`
	ExpirationDate *string          `json:"expirationDate"`
	HideEmail      bool             `json:"hideEmail"`
	Key            string           `json:"key"`
	MaxAccessCount *int             `json:"maxAccessCount"`
	Name           string           `json:"name"`
	Notes          *string          `json:"notes"`
	Text           SendTextMetadata `json:"text"`
	Type           int              `json:"type"`
}

type SendFileMetadata added in v0.2.11

type SendFileMetadata struct {
	FileName string `json:"fileName"`
	Id       string `json:"id"`
	Size     int    `json:"size"`
	SizeName string `json:"sizeName"`
}

type SendMetadata added in v0.2.11

type SendMetadata struct {
	CreatorIdentifier string
	ExpirationDate    string
	File              SendFileMetadata
	Id                string
	Name              string
	Object            string
	Text              SendTextMetadata
	Type              int
}

type SendTextMetadata added in v0.2.11

type SendTextMetadata struct {
	Hidden   bool    `json:"hidden"`
	Response *string `json:"response"`
	Text     string  `json:"text"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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