bitwarden

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WEBSOCKET_SLEEP_DURATION_SECONDS = 5
)

Variables

This section is empty.

Functions

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"`
}

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
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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