bitwarden

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

bitwarden implements an API client for bitwarden

References:

https://github.com/jcs/rubywarden/blob/master/API.md
https://github.com/mvdan/bitw/blob/master/auth.go
https://github.com/philhug/bitwarden-client-go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
}

func New

func New(opts ...client.ClientOpt) (*Client, error)

func (*Client) Login

func (c *Client) Login(session *schema.Session, opts ...LoginOpt) error

Login updates a session with a token. To create a new, empty session then pass an empty session to this method. Use OptCredentials option to pass a client_id and client_secret to the session.

func (*Client) Sync added in v1.0.1

func (c *Client) Sync(session *schema.Session) (*Sync, error)

Sync all items

type Login added in v1.0.1

type Login struct {
	GrantType    string `json:"grant_type"`
	Scope        string `json:"scope"`
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

type LoginOpt added in v1.0.1

type LoginOpt func(*schema.Session, *reqToken) error

func OptCredentials added in v1.0.1

func OptCredentials(clientId, secret string) LoginOpt

Set the client_id and client_secret

func OptDevice added in v1.0.1

func OptDevice(device schema.Device) LoginOpt

Set the device, populating missing fields

func OptForce added in v1.0.1

func OptForce() LoginOpt

Force login by clearing the token

type Sync added in v1.0.1

type Sync struct {
	*schema.Profile `json:"Profile,omitempty"`
	Folders         *schema.Folders `json:"Folders,omitempty"`
	Ciphers         *schema.Ciphers `json:"Ciphers,omitempty"`
	Domains         *schema.Domains `json:"Domains,omitempty"`
	Object          string          `json:"Object"`
}

func (Sync) String added in v1.0.1

func (s Sync) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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