keepassxc_browser

package module
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: GPL-2.0 Imports: 15 Imported by: 0

README

golang-keepassxc-browser

A golang package to interface with KeePassXC over the KeePassXC Browser API

Documentation

Index

Constants

View Source
const BufSize int = 1024 * 1024
View Source
const SocketName string = "org.keepassxc.KeePassXC.BrowserServer"

Variables

This section is empty.

Functions

func DecryptBytes

func DecryptBytes(nonce sodium.BoxNonce, pubkey sodium.BoxPublicKey, privkey sodium.BoxSecretKey, data []byte) (ret []byte, err error)

func EncryptBytes

func EncryptBytes(nonce sodium.BoxNonce, pubkey sodium.BoxPublicKey, privkey sodium.BoxSecretKey, data []byte) (ret []byte)

func GenerateRequestID

func GenerateRequestID() string

Types

type Client

type Client struct {
	ClientId string
	IdKey    string
	AId      string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(clientId string) (client *Client, err error)

func (*Client) Associate

func (c *Client) Associate() (ret *MsgAssociate, err error)

func (*Client) ChangePublicKeys

func (c *Client) ChangePublicKeys() (ret *ConnMsg, err error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) CreateNewGroup

func (c *Client) CreateNewGroup(groupName string) (ret *MsgCreateNewGroup, err error)

func (*Client) GeneratePassword

func (c *Client) GeneratePassword(timeout int) (ret *MsgGeneratePassword, err error)

func (*Client) GetDatabaseGroups

func (c *Client) GetDatabaseGroups() (ret *MsgGetDatabaseGroups, err error)

func (*Client) GetDatabasehash

func (c *Client) GetDatabasehash() (ret *MsgGetDatabasehash, err error)

func (*Client) GetLogins

func (c *Client) GetLogins(url, submitUrl, httpAuth string) (ret *MsgGetLogins, err error)

func (*Client) GetTotp

func (c *Client) GetTotp(uuid string) (ret *MsgGetTotp, err error)

func (*Client) LoadAssoc

func (c *Client) LoadAssoc(file string) (err error)

func (*Client) LockDatabase

func (c *Client) LockDatabase() (err error)

func (*Client) SaveAssoc

func (c *Client) SaveAssoc(file string) (err error)

func (*Client) SendMsg

func (c *Client) SendMsg(req *ConnMsg) (ret *ConnMsg, err error)

func (*Client) SetLogin

func (c *Client) SetLogin(url, submitUrl, login, password, group, groupUuid, uuid string) (ret *MsgSetLogin, err error)

func (*Client) TestAssociate

func (c *Client) TestAssociate() (ret *MsgAssociate, err error)

type ConnMsg

type ConnMsg struct {
	ActionName string `json:"action"`
	Nonce      string `json:"nonce"`
	ClientId   string `json:"clientID"`
	RequestId  string `json:"requestID"`
	Message    string `json:"message"`
	PublicKey  string `json:"publicKey"`
	Success    string `json:"success"`
	Error      string `json:"error"`
	ErrorCode  string `json:"errorCode"`
	Version    string `json:"version"`
	// contains filtered or unexported fields
}

func GenerateConnReq

func GenerateConnReq(action, clientID string) (ret *ConnMsg, err error)

func ParseConnMsg

func ParseConnMsg(bmsg []byte) (ret *ConnMsg, err error)

func (*ConnMsg) GetData

func (c *ConnMsg) GetData() interface{}

type ConnectionI

type ConnectionI interface {
	Connect(string) error
	Close()
	Send([]byte) error
	Recv(int, int) ([]byte, error)
}

type GroupChild

type GroupChild struct {
	GroupEntry
	Children []GroupChild `json:"children"`
}

type GroupEntry

type GroupEntry struct {
	Name string `json:"name"`
	Uuid string `json:"uuid"`
}

type GroupsEntry

type GroupsEntry struct {
	Groups []GroupChild `json:"groups"`
}

type KpXcMitm

type KpXcMitm struct {
	// contains filtered or unexported fields
}

func NewKpXcMitm

func NewKpXcMitm(modifier KpXcMitmI) (ret *KpXcMitm, err error)

func (*KpXcMitm) HandleReq

func (k *KpXcMitm) HandleReq(breq []byte) (bres []byte, err error)

type KpXcMitmI

type KpXcMitmI interface {
	ModifyReq(*ConnMsg) error
	ModifyRes(*ConnMsg) error
}

type KpXcProxy

type KpXcProxy struct {
	// contains filtered or unexported fields
}

func NewKpXcProxy

func NewKpXcProxy() (ret *KpXcProxy, err error)

func (*KpXcProxy) HandleReq

func (k *KpXcProxy) HandleReq(breq []byte) (res []byte, err error)

type LoginEntry

type LoginEntry struct {
	Login        string              `json:"login"`
	Name         string              `json:"name"`
	Password     string              `json:"password"`
	Expired      string              `json:"expired,omitempty"`
	Uuid         string              `json:"uuid"`
	StringFields []map[string]string `json:"stringFields"`
}

type MsgAssociate

type MsgAssociate struct {
	MsgBase
	Key   string `json:"key"`
	IdKey string `json:"idKey"`
}

type MsgBase

type MsgBase struct {
	ActionName string `json:"action"`
	Hash       string `json:"hash"`
	Version    string `json:"version"`
	Success    string `json:"success"`
	Id         string `json:"id"`
	Nonce      string `json:"nonce"`
}

func (*MsgBase) IsSuccess

func (m *MsgBase) IsSuccess() bool

type MsgCreateNewGroup

type MsgCreateNewGroup struct {
	MsgBase
	GroupName string `json:"groupName"`
}

type MsgGeneratePassword

type MsgGeneratePassword struct {
	MsgBase
	Password string `json:"password"`
}

type MsgGetDatabaseGroups

type MsgGetDatabaseGroups struct {
	MsgBase
	DefaultGroup            string      `json:"defaultGroup"`
	DefaultGroupAlwaysAllow bool        `json:"defaultGroupAlwaysAllow"`
	Groups                  GroupsEntry `json:"groups"`
}

type MsgGetDatabasehash

type MsgGetDatabasehash struct {
	MsgBase
}

type MsgGetLogins

type MsgGetLogins struct {
	MsgBase
	Url       string       `json:"url"`
	SubmitUrl string       `json:"submitUrl,omitempty"`
	HttpAuth  string       `json:"httpAuth,omitempty"`
	Keys      []key        `json:"keys"`
	Entries   []LoginEntry `json:"entries"`
	Count     int          `json:"count"`
}

type MsgGetTotp

type MsgGetTotp struct {
	MsgBase
	Totp string `json:"totp"`
	Uuid string `json:"uuid"`
}

type MsgI

type MsgI interface {
	IsSuccess() bool
}

func GetMessageType

func GetMessageType(action string) (ret MsgI, err error)

type MsgLockDatabase

type MsgLockDatabase struct {
	MsgBase
}

type MsgSetLogin

type MsgSetLogin struct {
	MsgBase
	Url             string       `json:"url"`
	SubmitUrl       string       `json:"submitUrl"`
	Login           string       `json:"login"`
	Password        string       `json:"password"`
	Group           string       `json:"group"`
	GroupUuid       string       `json:"groupUuid"`
	Uuid            string       `json:"uuid"`
	DownloadFavicon bool         `json:"downloadFavicon"`
	Entries         []LoginEntry `json:"entries"`
	Count           int          `json:"count"`
}

type PosixConnection

type PosixConnection struct {
	// contains filtered or unexported fields
}

func (*PosixConnection) Close

func (conn *PosixConnection) Close()

func (*PosixConnection) Connect

func (conn *PosixConnection) Connect(address string) (err error)

func (*PosixConnection) Recv

func (conn *PosixConnection) Recv(bufsize int, timeout int) (ret []byte, err error)

func (*PosixConnection) Send

func (conn *PosixConnection) Send(message []byte) (err error)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(serv ServerI, conn ConnectionI) (ret *Server)

func (*Server) Run

func (s *Server) Run() (err error)

type ServerI

type ServerI interface {
	HandleReq([]byte) ([]byte, error)
}

type StdinoutConnection

type StdinoutConnection struct {
	// contains filtered or unexported fields
}

func (*StdinoutConnection) Close

func (conn *StdinoutConnection) Close()

func (*StdinoutConnection) Connect

func (conn *StdinoutConnection) Connect(address string) (err error)

func (*StdinoutConnection) Recv

func (conn *StdinoutConnection) Recv(bufsize int, timeout int) (ret []byte, err error)

func (*StdinoutConnection) Send

func (conn *StdinoutConnection) Send(message []byte) (err error)

Jump to

Keyboard shortcuts

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