Documentation ¶
Index ¶
- func Decrypt(key []byte, iv []byte, ciphertext []byte) ([]byte, error)
- func Encrypt(key []byte, iv []byte, plaintext []byte) ([]byte, error)
- func EnsureDir(ensurePath string) error
- func Exists(testPath string) (bool, error)
- func GenerateRandomBytes(n int) ([]byte, error)
- func HmacSha256(key []byte, dataToSign ...[]byte) []byte
- func Pkcs7Pad(data []byte, blocklen int) ([]byte, error)
- func Pkcs7Unpad(data []byte, blocklen int) ([]byte, error)
- type Command
- type Configuration
- type Item
- type LoginItem
- type LoginItemSecureContents
- type OnePasswordClient
- func NewClient(websocketURI string, websocketProtocol string, websocketOrigin string, ...) (*OnePasswordClient, error)
- func NewClientWithConfig(configuration *Configuration) (*OnePasswordClient, error)
- func NewCustomClient(websocketClient WebsocketClient, defaultHost string, stateDirectory string) (*OnePasswordClient, error)
- func (client *OnePasswordClient) Authenticate(register bool) (*Response, error)
- func (client *OnePasswordClient) Connect() error
- func (client *OnePasswordClient) Debug(secretB64 string, csB64 string, ccB64 string, m3B64 string, m4B64 string, ...)
- func (client *OnePasswordClient) LoadOrSetupState() error
- func (client *OnePasswordClient) ReceiveJSON() (*Response, error)
- func (client *OnePasswordClient) Register(code string) (*Response, error)
- func (client *OnePasswordClient) SendCommand(command *Command) (*Response, error)
- func (client *OnePasswordClient) SendEncryptedCommand(command *Command) (*Response, error)
- func (client *OnePasswordClient) SendHelloCommand() (*Response, error)
- func (client *OnePasswordClient) SendJSON(jsonStr []byte) error
- func (client *OnePasswordClient) SendShowPopupCommand() (*Response, error)
- type PasswordItem
- type PasswordItemSecureContents
- type Payload
- type Response
- type ResponsePayload
- type StateFileConfig
- type WebsocketClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomBytes ¶ added in v0.3.0
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func HmacSha256 ¶ added in v0.3.0
Types ¶
type Configuration ¶
type Configuration struct { WebsocketURI string `json:"websocketUri"` WebsocketProtocol string `json:"websocketProtocol"` WebsocketOrigin string `json:"websocketOrigin"` DefaultHost string `json:"defaultHost"` StateDirectory string `json:"stateDirectory"` }
Configuration struct
type LoginItem ¶ added in v0.3.0
type LoginItem struct { UUID string `json:"uuid"` NakedDomains []string `json:"nakedDomains"` Overview map[string]interface{} `json:"overview"` SecureContents LoginItemSecureContents `json:"secureContents"` }
func (LoginItem) GetPassword ¶ added in v0.3.0
type LoginItemSecureContents ¶ added in v0.3.0
type OnePasswordClient ¶
type OnePasswordClient struct { DefaultHost string StateDirectory string // contains filtered or unexported fields }
func NewClientWithConfig ¶
func NewClientWithConfig(configuration *Configuration) (*OnePasswordClient, error)
func NewCustomClient ¶
func NewCustomClient(websocketClient WebsocketClient, defaultHost string, stateDirectory string) (*OnePasswordClient, error)
func (*OnePasswordClient) Authenticate ¶ added in v0.3.0
func (client *OnePasswordClient) Authenticate(register bool) (*Response, error)
func (*OnePasswordClient) Connect ¶
func (client *OnePasswordClient) Connect() error
func (*OnePasswordClient) LoadOrSetupState ¶ added in v0.3.0
func (client *OnePasswordClient) LoadOrSetupState() error
func (*OnePasswordClient) ReceiveJSON ¶ added in v0.3.0
func (client *OnePasswordClient) ReceiveJSON() (*Response, error)
func (*OnePasswordClient) Register ¶ added in v0.3.0
func (client *OnePasswordClient) Register(code string) (*Response, error)
func (*OnePasswordClient) SendCommand ¶
func (client *OnePasswordClient) SendCommand(command *Command) (*Response, error)
func (*OnePasswordClient) SendEncryptedCommand ¶ added in v0.3.0
func (client *OnePasswordClient) SendEncryptedCommand(command *Command) (*Response, error)
func (*OnePasswordClient) SendHelloCommand ¶
func (client *OnePasswordClient) SendHelloCommand() (*Response, error)
func (*OnePasswordClient) SendJSON ¶ added in v0.3.0
func (client *OnePasswordClient) SendJSON(jsonStr []byte) error
func (*OnePasswordClient) SendShowPopupCommand ¶
func (client *OnePasswordClient) SendShowPopupCommand() (*Response, error)
type PasswordItem ¶ added in v0.3.0
type PasswordItem struct { UUID string `json:"uuid"` Overview map[string]interface{} `json:"overview"` SecureContents PasswordItemSecureContents `json:"secureContents"` }
func (PasswordItem) GetPassword ¶ added in v0.3.0
func (item PasswordItem) GetPassword() (string, error)
type PasswordItemSecureContents ¶ added in v0.3.0
type PasswordItemSecureContents struct {
Password string `json:"password"`
}
type Payload ¶
type Payload struct { Version string `json:"version,omitempty"` ExtID string `json:"extId,omitempty"` Method string `json:"method,omitempty"` Secret string `json:"secret,omitempty"` Capabilities []string `json:"capabilities,omitempty"` URL string `json:"url,omitempty"` Options map[string]string `json:"options,omitempty"` CC string `json:"cc,omitempty"` CS string `json:"cs,omitempty"` M4 string `json:"M4,omitempty"` M3 string `json:"M3,omitempty"` Algorithm string `json:"alg,omitempty"` Iv string `json:"iv,omitempty"` Data string `json:"data,omitempty"` Hmac string `json:"hmac,omitempty"` }
type Response ¶
type Response struct { Action string `json:"action"` Version string `json:"version"` Payload ResponsePayload `json:"payload"` }
func LoadResponse ¶
func (*Response) GetPassword ¶
type ResponsePayload ¶
type ResponsePayload struct { Item *json.RawMessage `json:"item"` Algorithm string `json:"alg"` Method string `json:"method"` Code string `json:"code"` Data string `json:"data"` Hmac string `json:"hmac"` Iv string `json:"iv"` M3 string `json:"m3"` CS string `json:"cs"` AssociatedData string `json:"adata"` Options map[string]interface{} `json:"options"` OpenInTabMode string `json:"openInTabMode"` Action string `json:"action"` }
type StateFileConfig ¶ added in v0.3.0
type WebsocketClient ¶
Click to show internal directories.
Click to hide internal directories.