Documentation ¶
Index ¶
- Constants
- Variables
- func Base64HmacFromString(key []byte, message string) string
- func Base64ToBytes(text string) []byte
- func Base64ToString(base64Text string) string
- func Base64ToStringSafe(base64Text string) string
- func ByteToInt(b []byte) string
- func BytesToBase64(data []byte) string
- func BytesToString(b []byte) string
- func BytesToUrlSafeStr(data []byte) string
- func ClearBytes(bytes []byte)
- func CloneByteSlice(src []byte) []byte
- func Decrypt(data, key []byte) ([]byte, error)
- func DecryptAesCbc(data, key []byte) ([]byte, error)
- func DecryptRecord(data, secretKey []byte) (string, error)
- func DictToJson(dict map[string]interface{}) string
- func DictToJsonWithDefultIndent(dict map[string]interface{}) string
- func DictToJsonWithIndent(dict map[string]interface{}, indent string) string
- func ECDH(priv PrivateKey, pub PublicKey) ([]byte, error)
- func ECDH_Ecdsa(priv *ecdsa.PrivateKey, pub *ecdsa.PublicKey) ([]byte, error)
- func EcPublicKeyFromEncodedPoint(publicKey []byte) (crypto.PublicKey, error)
- func EcPublicKeyToEncodedPoint(pub *ecdsa.PublicKey) ([]byte, error)
- func EncryptAesCbc(data []byte, key []byte) ([]byte, error)
- func EncryptAesCbcFull(data, key, nonce []byte) ([]byte, error)
- func EncryptAesGcm(data []byte, key []byte) ([]byte, error)
- func EncryptAesGcmFull(data, key, nonce []byte) ([]byte, error)
- func GeneratePassword(minLength int, ...) (string, error)
- func GeneratePasswordWithOptions(options *PasswordOptions) (string, error)
- func GeneratePrivateKeyDer() ([]byte, error)
- func GenerateRandomBytes(size int) ([]byte, error)
- func GenerateUid() string
- func GenerateUidBytes() (bytes []byte, err error)
- func GenerateUidWithLength(bitLength int) string
- func GetClientVersion(hardcode bool) string
- func GetDefaultOwnerPublicKey() string
- func GetOS() string
- func GetRandomBytes(size int) ([]byte, error)
- func GetServerHostname(hostname string, configStore IKeyValueStorage) string
- func GetSharedFolderKey(folders []*KeeperFolder, responseFolders []interface{}, parent string) []byte
- func HmacDigest(key []byte, message []byte) []byte
- func IsFieldClass(field interface{}) bool
- func IsJson(jsonStr string) bool
- func JsonToDict(content string) map[string]interface{}
- func NewFileCache(filePath string) *fileCache
- func NewFileKeyValueStorage(filePath ...interface{}) *fileKeyValueStorage
- func NewMemoryCache() *memoryCache
- func NewMemoryKeyValueStorage(config ...interface{}) *memoryKeyValueStorage
- func NowMilliseconds() int64
- func ObjToDict(obj interface{}) map[string]interface{}
- func PadBinary(s []byte) []byte
- func PathExists(path string) (bool, error)
- func PublicEncrypt(data []byte, serverPublicRawKeyBytes []byte, idz []byte) (encrypted []byte, err error)
- func Sign(data []byte, privateKey *PrivateKey) ([]byte, error)
- func StrToBool(val string) (bool, error)
- func StringToBytes(s string) []byte
- func UnpadBinary(s []byte) []byte
- func UrlSafeSha256FromString(text string) string
- func UrlSafeStrToBytes(text string) []byte
- func UrlSafeStrToBytesSafe(text string) []byte
- func Verify(data []byte, signature []byte, publicKey *PublicKey) error
- type AccountNumber
- type AddFileResponse
- type Address
- type AddressRef
- type Addresses
- type AllowedSettings
- type AppData
- type AppFiller
- type AppFillers
- type BankAccount
- type BankAccounts
- type BirthDate
- type CardRef
- type Checkbox
- type ClientOptions
- type CompleteTransactionPayload
- type ConfigKey
- type Context
- type CopyableMap
- type CopyableSlice
- type CreateFolderPayload
- type CreateOptions
- type CreatePayload
- type DatabaseType
- type Date
- type DeleteFolderPayload
- type DeleteFolderResponse
- type DeleteFoldersResponse
- type DeletePayload
- type DeleteSecretResponse
- type DeleteSecretsResponse
- type DirectoryType
- type Dropdown
- type ECDSASignature
- type Email
- type EncryptedPayload
- type ExpirationDate
- type FieldSectionFlag
- type FieldTokenFlag
- type FileRef
- type FileUploadPayload
- type Folder
- type GetPayload
- type HOTP
- type Host
- type Hosts
- type ICache
- type IKeyValueStorage
- type IsSsidHidden
- type KeeperFile
- func (f *KeeperFile) DecryptFileKey() []byte
- func (f *KeeperFile) DeepCopy() *KeeperFile
- func (f *KeeperFile) GetFileData() []byte
- func (f *KeeperFile) GetMeta() map[string]interface{}
- func (f *KeeperFile) GetUrl() string
- func (f *KeeperFile) SaveFile(path string, createFolders bool) bool
- func (f *KeeperFile) ToString() string
- type KeeperFileData
- type KeeperFileUpload
- type KeeperFolder
- type KeeperRecordData
- type KeeperRecordField
- type KeyPair
- type KeyPairs
- type KsmHttpResponse
- type LicenseNumber
- type Login
- type Multiline
- type Name
- type Names
- type NotationSection
- type OneTimeCode
- type OneTimePassword
- type PamHostname
- type PamRbiConnection
- type PamRemoteBrowserSetting
- type PamRemoteBrowserSettings
- type PamResource
- type PamResources
- type PamSetting
- type PamSettings
- type PamSettingsConnection
- type PamSettingsPortForward
- type ParserTuple
- type Passkey
- type PasskeyPrivateKey
- type Passkeys
- type Password
- type PasswordComplexity
- type PasswordOptions
- type PaymentCard
- type PaymentCards
- type Phone
- type Phones
- type PinCode
- type PrivateKey
- func DerBase64PrivateKeyToPrivateKey(privateKeyDerBase64 string) (*PrivateKey, error)
- func GenerateKeys(curve elliptic.Curve) (PrivateKey, error)
- func GenerateNewEccKey() (PrivateKey, error)
- func GenerateP256Keys() (PrivateKey, error)
- func GeneratePrivateKeyEcc() (PrivateKey, error)
- func LoadDerPrivateKeyDer(data []byte) (*PrivateKey, error)
- func (priv *PrivateKey) Bytes() []byte
- func (priv *PrivateKey) Equals(k *PrivateKey) bool
- func (priv *PrivateKey) GetPublicKey() *PublicKey
- func (priv *PrivateKey) Hex() string
- func (priv *PrivateKey) SetBytes(d []byte) *PrivateKey
- func (priv *PrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)
- type PublicKey
- type QueryOptions
- type RbiUrl
- type Record
- func FindSecretByTitle(recordTitle string, records []*Record) *Record
- func FindSecretsByTitle(recordTitle string, records []*Record) []*Record
- func NewRecord(templateRecordUid string, records []*Record, newRecordUid string) (*Record, error)
- func NewRecordClone(templateRecordUid string, records []*Record, newRecordUid string) (*Record, error)
- func NewRecordFromJson(recordDict map[string]interface{}, secretKey []byte, folderUid string) *Record
- func NewRecordFromRecordData(recordData *RecordCreate, folder *Folder) *Record
- func NewRecordFromRecordDataWithUid(recordUid string, recordData *RecordCreate, folder *Folder) *Record
- func (r *Record) AddCustomField(field interface{}) error
- func (r *Record) CanClone() bool
- func (r *Record) DownloadFile(fileUid string, path string) bool
- func (r *Record) DownloadFileByTitle(title string, path string) bool
- func (r *Record) FieldExists(section, name string) bool
- func (r *Record) FindFile(name string) *KeeperFile
- func (r *Record) FindFileByFilename(filename string) *KeeperFile
- func (r *Record) FindFileByTitle(title string) *KeeperFile
- func (r *Record) FindFiles(name string) []*KeeperFile
- func (r *Record) FolderUid() string
- func (r *Record) GetCustomFieldValue(fieldType string, single bool) ([]interface{}, error)
- func (r *Record) GetCustomFieldValueByLabel(fieldLabel string) string
- func (r *Record) GetCustomFieldValueByType(fieldType string) string
- func (r *Record) GetCustomFieldValues(label string, fieldType string) []string
- func (r *Record) GetCustomFieldsByLabel(fieldLabel string) []map[string]interface{}
- func (r *Record) GetCustomFieldsByType(fieldType string) []map[string]interface{}
- func (r *Record) GetFieldValueByLabel(fieldLabel string) string
- func (r *Record) GetFieldValueByType(fieldType string) string
- func (r *Record) GetFieldValuesByType(fieldType string) []string
- func (r *Record) GetFieldsByLabel(fieldLabel string) []map[string]interface{}
- func (r *Record) GetFieldsByMask(fieldToken string, fieldTokenFlag FieldTokenFlag, fieldType FieldSectionFlag) []map[string]interface{}
- func (r *Record) GetFieldsBySection(fieldSectionType FieldSectionFlag) []interface{}
- func (r *Record) GetFieldsByType(fieldType string) []map[string]interface{}
- func (r *Record) GetStandardFieldValue(fieldType string, single bool) ([]interface{}, error)
- func (r *Record) InnerFolderUid() string
- func (r *Record) InsertField(section string, field interface{}) error
- func (r *Record) Notes() string
- func (r *Record) Password() string
- func (r *Record) Print()
- func (r *Record) RemoveField(section, name string, removeAll bool) int
- func (r *Record) SetCustomFieldValue(fieldType string, value interface{}) error
- func (r *Record) SetCustomFieldValueSingle(fieldLabel, value string)
- func (r *Record) SetFieldValueSingle(fieldType, value string)
- func (r *Record) SetNotes(notes string)
- func (r *Record) SetPassword(password string)
- func (r *Record) SetStandardFieldValue(fieldType string, value interface{}) error
- func (r *Record) SetTitle(title string)
- func (r *Record) SetType(newType string)
- func (r *Record) Title() string
- func (r *Record) ToString() string
- func (r *Record) Type() string
- func (r *Record) UpdateField(section string, field interface{}) error
- type RecordCreate
- type RecordField
- type RecordRef
- type Schedule
- type Schedules
- type Script
- type Scripts
- type Secret
- type SecretsManager
- func (c *SecretsManager) CompleteTransaction(recordUid string, rollback bool) (err error)
- func (c *SecretsManager) CreateFolder(createOptions CreateOptions, folderName string, folders []*KeeperFolder) (folderUid string, err error)
- func (c *SecretsManager) CreateSecret(record *Record) (recordUid string, err error)
- func (c *SecretsManager) CreateSecretWithRecordData(recUid, folderUid string, recordData *RecordCreate) (recordUid string, err error)
- func (c *SecretsManager) CreateSecretWithRecordDataAndOptions(createOptions *CreateOptions, recordData *RecordCreate, ...) (recordUid string, err error)
- func (c *SecretsManager) CreateSecretWithRecordDataUidAndOptions(recUid string, createOptions *CreateOptions, recordData *RecordCreate, ...) (recordUid string, err error)
- func (c *SecretsManager) DefaultKeeperServerPublicKeyId() string
- func (c *SecretsManager) DeleteFolder(folderUids []string, forceDeletion bool) (statuses map[string]string, err error)
- func (c *SecretsManager) DeleteSecrets(recordUids []string) (statuses map[string]string, err error)
- func (c *SecretsManager) FindNotation(records []*Record, notation string) (fieldValue []interface{}, err error)
- func (c *SecretsManager) GenerateTransmissionKey(keyId string) *TransmissionKey
- func (c *SecretsManager) GetFolders() ([]*KeeperFolder, error)
- func (c *SecretsManager) GetNotation(notation string) (fieldValue []interface{}, err error)
- func (c *SecretsManager) GetNotationResults(notation string) ([]string, error)
- func (c *SecretsManager) GetSecretByTitle(recordTitle string) (record *Record, err error)
- func (c *SecretsManager) GetSecrets(uids []string) (records []*Record, err error)
- func (c *SecretsManager) GetSecretsByTitle(recordTitle string) (records []*Record, err error)
- func (c *SecretsManager) GetSecretsFullResponse(uids []string) (response *SecretsManagerResponse, err error)
- func (c *SecretsManager) GetSecretsFullResponseWithOptions(queryOptions QueryOptions) (response *SecretsManagerResponse, err error)
- func (c *SecretsManager) GetSecretsWithOptions(queryOptions QueryOptions) (records []*Record, err error)
- func (c *SecretsManager) HandleHttpError(rs *http.Response, body []byte, httpError error) (retry bool, err error)
- func (c *SecretsManager) LoadSecretKey() string
- func (c *SecretsManager) NotationPrefix() string
- func (c *SecretsManager) PostFunction(url string, transmissionKey *TransmissionKey, ...) (*KsmHttpResponse, error)
- func (c *SecretsManager) PostQuery(path string, payload interface{}) (body []byte, err error)
- func (c *SecretsManager) PrepareContext() *Context
- func (c *SecretsManager) Save(record *Record) (err error)
- func (c *SecretsManager) SaveBeginTransaction(record *Record, transactionType UpdateTransactionType) (err error)
- func (c *SecretsManager) SetCache(cache ICache)
- func (c *SecretsManager) TryGetNotationResults(notation string) []string
- func (c *SecretsManager) UpdateFolder(folderUid, folderName string, folders []*KeeperFolder) (err error)
- func (c *SecretsManager) UploadFile(record *Record, file *KeeperFileUpload) (uid string, err error)
- func (c *SecretsManager) UploadFilePath(record *Record, filePath string) (uid string, err error)
- type SecretsManagerResponse
- type SecureNote
- type SecurityQuestion
- type SecurityQuestions
- type TOTP
- type Text
- type TotpCode
- type TrafficEncryptionSeed
- type TransmissionKey
- type UpdateFolderPayload
- type UpdatePayload
- type UpdateTransactionType
- type Url
- type WifiEncryption
Constants ¶
const ( Aes256KeySize = 32 AesGcmNonceSize = 12 AesCbcNonceSize = 16 DefaultBlockSize = 16 )
const AsciiDigits string = "0123456789"
const AsciiLowercase string = "abcdefghijklmnopqrstuvwxyz"
const AsciiSpecialCharacters string = "\"!@#$%()+;<>=?[]{}^.,"
const AsciiUppercase string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
const (
DEFAULT_CONFIG_PATH string = "client-config.json"
)
const DefaultPasswordLength int = 32
Generate password
const EscapeChar = '\\'
New notation parser/extractor allows to search by title/label and to escape special chars
const EscapeChars = "/[]\\" // /[]\ -> \/ ,\[, \], \\
Variables ¶
var ErrKeyExchange = errors.New("key exchange failed")
ErrKeyExchange is returned if the key exchange fails.
Functions ¶
func Base64HmacFromString ¶
Base64HmacFromString generates base64 encoded HMAC of the message string with the given key
func Base64ToBytes ¶
func Base64ToString ¶
func Base64ToStringSafe ¶
func BytesToBase64 ¶
func BytesToString ¶
func BytesToUrlSafeStr ¶
func ClearBytes ¶
func ClearBytes(bytes []byte)
func CloneByteSlice ¶
func DecryptAesCbc ¶ added in v1.6.0
Decrypt AES-CBC encrypted message
func DecryptRecord ¶
func DictToJson ¶
func DictToJsonWithIndent ¶
func ECDH ¶
func ECDH(priv PrivateKey, pub PublicKey) ([]byte, error)
ECDH computes a shared key from a private key and a peer's public key.
func ECDH_Ecdsa ¶
ECDH computes a shared key from a private key and a peer's public key.
func EncryptAesCbc ¶ added in v1.6.0
Encrypt a message using AES-CBC.
func EncryptAesCbcFull ¶ added in v1.6.0
Encrypt a message using AES-CBC with custom nonce.
func EncryptAesGcm ¶
Encrypt a message using AES-GCM.
func EncryptAesGcmFull ¶
Encrypt a message using AES-GCM with custom nonce.
func GeneratePassword ¶
func GeneratePassword(minLength int, lowercase, uppercase, digits, specialCharacters, specialCharacterSet string) (string, error)
GeneratePassword returns a new password of specified minimum length using provided number of uppercase, lowercase, digits and special characters.
Empty strings or strings with invalid int values are treated as nil and used only if sum of the non nil values don't reach minLength
Note: If all character groups are unspecified or all have exact zero length then password characters are chosen from all groups uniformly at random.
Note: If all charset lengths are negative or 0 but can't reach min_length then all exact/negative charset lengths will be treated as minimum number of characters instead.
minLength is the minimum password length - default: 32 lowercase is the minimum number of lowercase characters if positive, exact if 0 or negative uppercase is the minimum number of uppercase characters if positive, exact if 0 or negative digits is the minimum number of digits if positive, exact if 0 or negative specialCharacters is the minimum number of special characters if positive, exact if 0 or negative specialCharacterSet is a string containing custom set of special characters to pick from
func GeneratePasswordWithOptions ¶
func GeneratePasswordWithOptions(options *PasswordOptions) (string, error)
GeneratePasswordWithOptions generates new password using provided options If options is nil the new password will be generated using defaults All lengths are optional and substituted with reasonable defaults when missing To exclude a charset - set corresponding option to 0 To use default length value - set its option to empty string "" Note: Any strings containing non integer values will be treated as empty string
func GeneratePrivateKeyDer ¶
func GenerateRandomBytes ¶
func GenerateUid ¶
func GenerateUid() string
func GenerateUidBytes ¶ added in v1.6.4
func GenerateUidWithLength ¶
func GetClientVersion ¶
getClientVersion returns the version of the client
func GetDefaultOwnerPublicKey ¶
func GetDefaultOwnerPublicKey() string
func GetRandomBytes ¶
func GetServerHostname ¶
func GetServerHostname(hostname string, configStore IKeyValueStorage) string
func GetSharedFolderKey ¶ added in v1.6.0
func GetSharedFolderKey(folders []*KeeperFolder, responseFolders []interface{}, parent string) []byte
func HmacDigest ¶
func IsFieldClass ¶
func IsFieldClass(field interface{}) bool
func JsonToDict ¶
func NewFileCache ¶
func NewFileCache(filePath string) *fileCache
func NewFileKeyValueStorage ¶
func NewFileKeyValueStorage(filePath ...interface{}) *fileKeyValueStorage
func NewMemoryCache ¶
func NewMemoryCache() *memoryCache
func NewMemoryKeyValueStorage ¶
func NewMemoryKeyValueStorage(config ...interface{}) *memoryKeyValueStorage
func NowMilliseconds ¶
func NowMilliseconds() int64
func PathExists ¶
PathExists returns whether the given file or directory exists
func PublicEncrypt ¶
func StringToBytes ¶
func UnpadBinary ¶
func UrlSafeSha256FromString ¶
UrlSafeSha256FromString generates URL safe encoded SHA256 sum of data in URL safe base64 encoded string
func UrlSafeStrToBytes ¶
func UrlSafeStrToBytesSafe ¶
UrlSafeStrToBytesSafe decodes base64 text to bytes, returns empty byte slice on error
Types ¶
type AccountNumber ¶
type AccountNumber struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
func NewAccountNumber ¶
func NewAccountNumber(value string) *AccountNumber
type AddFileResponse ¶
type AddFileResponse struct { Url string `json:"url"` Parameters string `json:"parameters"` SuccessStatusCode int `json:"successStatusCode"` }
func AddFileResponseFromJson ¶
func AddFileResponseFromJson(jsonData string) (*AddFileResponse, error)
type AddressRef ¶
type AddressRef struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
func NewAddressRef ¶
func NewAddressRef(value string) *AddressRef
type Addresses ¶
type Addresses struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []Address `json:"value,omitempty"` }
func NewAddresses ¶
type AllowedSettings ¶ added in v1.6.4
type AppData ¶
type AppData struct { Title string `json:"title,omitempty"` AppType string `json:"type,omitempty"` }
Application info
func NewAppData ¶
type AppFillers ¶ added in v1.6.4
type AppFillers struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []AppFiller `json:"value,omitempty"` }
func NewAppFillers ¶ added in v1.6.4
func NewAppFillers(value AppFiller) *AppFillers
type BankAccount ¶
type BankAccounts ¶
type BankAccounts struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []BankAccount `json:"value,omitempty"` }
func NewBankAccounts ¶
func NewBankAccounts(value BankAccount) *BankAccounts
type BirthDate ¶
type BirthDate struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []int64 `json:"value,omitempty"` }
func NewBirthDate ¶
type CardRef ¶
type CardRef struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
func NewCardRef ¶
type Checkbox ¶ added in v1.5.2
type Checkbox struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []bool `json:"value,omitempty"` }
func NewCheckbox ¶ added in v1.5.2
type ClientOptions ¶
type ClientOptions struct { // Token specifies a One-Time Access Token used // to generate the configuration to use with core.SecretsManager client Token string // InsecureSkipVerify controls whether the client verifies // server's certificate chain and host name InsecureSkipVerify bool // Config specifies either one of the built-in IKeyValueStorage interfaces or a custom one Config IKeyValueStorage // LogLevel overrides the default log level for the logger LogLevel klog.LogLevel // Deprecated: Use Token instead. If both are set, hostname from the token takes priority. Hostname string }
type CompleteTransactionPayload ¶ added in v1.5.2
type CompleteTransactionPayload struct { ClientVersion string `json:"clientVersion"` ClientId string `json:"clientId"` RecordUid string `json:"recordUid"` }
func (*CompleteTransactionPayload) CompleteTransactionPayloadFromJson ¶ added in v1.5.2
func (p *CompleteTransactionPayload) CompleteTransactionPayloadFromJson(jsonData string)
func (*CompleteTransactionPayload) CompleteTransactionPayloadToJson ¶ added in v1.5.2
func (p *CompleteTransactionPayload) CompleteTransactionPayloadToJson() (string, error)
type ConfigKey ¶
type ConfigKey string
const ( KEY_URL ConfigKey = "url" // base URL for the Secrets Manager service KEY_SERVER_PUBLIC_KEY_ID ConfigKey = "serverPublicKeyId" KEY_CLIENT_ID ConfigKey = "clientId" KEY_CLIENT_KEY ConfigKey = "clientKey" // The key that is used to identify the client before public key KEY_APP_KEY ConfigKey = "appKey" // The application key with which all secrets are encrypted KEY_OWNER_PUBLIC_KEY ConfigKey = "appOwnerPublicKey" // The application owner public key, to create records KEY_PRIVATE_KEY ConfigKey = "privateKey" // The client's private key KEY_PUBLIC_KEY ConfigKey = "publicKey" // The client's public key KEY_HOSTNAME ConfigKey = "hostname" // base hostname for the Secrets Manager service )
func GetConfigKey ¶
func GetConfigKeys ¶
func GetConfigKeys() []ConfigKey
type Context ¶
type Context struct { TransmissionKey TransmissionKey ClientId []byte ClientKey []byte }
func NewContext ¶
func NewContext(transmissionKey TransmissionKey, clientId []byte, clientKey []byte) *Context
type CopyableMap ¶
type CopyableMap map[string]interface{}
func (CopyableMap) DeepCopy ¶
func (m CopyableMap) DeepCopy() map[string]interface{}
DeepCopy will create a deep copy of this map. The depth of this copy is all inclusive. Both maps and slices will be considered when making the copy.
type CopyableSlice ¶
type CopyableSlice []interface{}
func (CopyableSlice) DeepCopy ¶
func (s CopyableSlice) DeepCopy() []interface{}
DeepCopy will create a deep copy of this slice. The depth of this copy is all inclusive. Both maps and slices will be considered when making the copy.
type CreateFolderPayload ¶ added in v1.6.0
type CreateFolderPayload struct { ClientVersion string `json:"clientVersion"` ClientId string `json:"clientId"` FolderUid string `json:"folderUid"` Data string `json:"data"` ParentUid string `json:"parentUid"` }
func (*CreateFolderPayload) CreateFolderPayloadFromJson ¶ added in v1.6.0
func (p *CreateFolderPayload) CreateFolderPayloadFromJson(jsonData string)
func (*CreateFolderPayload) CreateFolderPayloadToJson ¶ added in v1.6.0
func (p *CreateFolderPayload) CreateFolderPayloadToJson() (string, error)
type CreateOptions ¶ added in v1.6.0
type CreatePayload ¶
type CreatePayload struct { ClientVersion string `json:"clientVersion"` ClientId string `json:"clientId"` RecordUid string `json:"recordUid"` RecordKey string `json:"recordKey"` FolderUid string `json:"folderUid"` FolderKey string `json:"folderKey"` Data string `json:"data"` SubFolderUid string `json:"subFolderUid,omitempty"` }
func (*CreatePayload) CreatePayloadFromJson ¶
func (p *CreatePayload) CreatePayloadFromJson(jsonData string)
func (*CreatePayload) CreatePayloadToJson ¶
func (p *CreatePayload) CreatePayloadToJson() (string, error)
type DatabaseType ¶ added in v1.5.2
type DatabaseType struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []string `json:"value,omitempty"` }
func NewDatabaseType ¶ added in v1.5.2
func NewDatabaseType(value string) *DatabaseType
type Date ¶
type Date struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []int64 `json:"value,omitempty"` }
type DeleteFolderPayload ¶ added in v1.6.0
type DeleteFolderPayload struct { ClientVersion string `json:"clientVersion"` ClientId string `json:"clientId"` FolderUids []string `json:"folderUids"` ForceDeletion bool `json:"forceDeletion"` }
func (*DeleteFolderPayload) DeleteFolderPayloadFromJson ¶ added in v1.6.0
func (p *DeleteFolderPayload) DeleteFolderPayloadFromJson(jsonData string)
func (*DeleteFolderPayload) DeleteFolderPayloadToJson ¶ added in v1.6.0
func (p *DeleteFolderPayload) DeleteFolderPayloadToJson() (string, error)
type DeleteFolderResponse ¶ added in v1.6.0
type DeleteFoldersResponse ¶ added in v1.6.0
type DeleteFoldersResponse struct {
Folders []DeleteFolderResponse `json:"folders"`
}
func DeleteFoldersResponseFromJson ¶ added in v1.6.0
func DeleteFoldersResponseFromJson(jsonData string) (*DeleteFoldersResponse, error)
type DeletePayload ¶
type DeletePayload struct { ClientVersion string `json:"clientVersion"` ClientId string `json:"clientId"` RecordUids []string `json:"recordUids"` }
func (*DeletePayload) DeletePayloadFromJson ¶
func (p *DeletePayload) DeletePayloadFromJson(jsonData string)
func (*DeletePayload) DeletePayloadToJson ¶
func (p *DeletePayload) DeletePayloadToJson() (string, error)
type DeleteSecretResponse ¶
type DeleteSecretsResponse ¶
type DeleteSecretsResponse struct {
Records []DeleteSecretResponse `json:"records"`
}
func DeleteSecretsResponseFromJson ¶
func DeleteSecretsResponseFromJson(jsonData string) (*DeleteSecretsResponse, error)
type DirectoryType ¶ added in v1.5.2
type DirectoryType struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []string `json:"value,omitempty"` }
func NewDirectoryType ¶ added in v1.5.2
func NewDirectoryType(value string) *DirectoryType
type Dropdown ¶ added in v1.6.4
type Dropdown struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []string `json:"value,omitempty"` }
func NewDropdown ¶ added in v1.6.4
type ECDSASignature ¶
ECDSASignature needed for compatibility with openssl (python > hazmat > openssl > ec > _ecdsa_sig_sign) which uses ASN.1/DER SEQUENCE format NB! MaxLen for ASN.1, depends on the encoding. P1363 only needs 64 bytes. And an OpePGP encoding only needs 66 bytes. ECDSASignature using ASN.1/DER needs up to 72 bytes. DER requires a minimum number of bytes. If ASN.1/BER is used, then the signature can be hundreds of bytes.
type Email ¶
type Email struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
type EncryptedPayload ¶
func NewEncryptedPayload ¶
func NewEncryptedPayload(encryptedPayload []byte, signature []byte) *EncryptedPayload
type ExpirationDate ¶
type ExpirationDate struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []int64 `json:"value,omitempty"` }
func NewExpirationDate ¶
func NewExpirationDate(value int64) *ExpirationDate
type FieldSectionFlag ¶
type FieldSectionFlag byte
const ( FieldSectionFields FieldSectionFlag = 1 << iota FieldSectionCustom FieldSectionBoth = FieldSectionFields | FieldSectionCustom )
type FieldTokenFlag ¶
type FieldTokenFlag byte
const ( FieldTokenType FieldTokenFlag = 1 << iota FieldTokenLabel FieldTokenBoth = FieldTokenType | FieldTokenLabel )
type FileRef ¶
type FileRef struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []string `json:"value,omitempty"` }
"file" - obsolete and removed legacy field - "fldt_file": { key: 'file_or_photo', default: "File or Photo" },
func NewFileRef ¶
type FileUploadPayload ¶
type FileUploadPayload struct { ClientVersion string `json:"clientVersion"` ClientId string `json:"clientId"` FileRecordUid string `json:"fileRecordUid"` FileRecordKey string `json:"fileRecordKey"` FileRecordData string `json:"fileRecordData"` OwnerRecordUid string `json:"ownerRecordUid"` OwnerRecordData string `json:"ownerRecordData"` LinkKey string `json:"linkKey"` FileSize int `json:"fileSize"` }
func FileUploadPayloadFromJson ¶
func FileUploadPayloadFromJson(jsonData string) *FileUploadPayload
func (*FileUploadPayload) FileUploadPayloadToJson ¶
func (p *FileUploadPayload) FileUploadPayloadToJson() (string, error)
type GetPayload ¶
type GetPayload struct { ClientVersion string `json:"clientVersion"` ClientId string `json:"clientId"` PublicKey string `json:"publicKey,omitempty"` RequestedRecords []string `json:"requestedRecords"` RequestedFolders []string `json:"requestedFolders"` }
func (*GetPayload) GetPayloadFromJson ¶
func (p *GetPayload) GetPayloadFromJson(jsonData string)
func (*GetPayload) GetPayloadToJson ¶
func (p *GetPayload) GetPayloadToJson() (string, error)
type HOTP ¶
type HOTP struct { Secret string // Secret key (required) Digits int // OTP digit count (default: 6) Counter int64 // Counter value (default: 0) }
HOTP represents HMAC-Based OTP - https://datatracker.ietf.org/doc/html/rfc4226
type Hosts ¶
type Hosts struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []Host `json:"value,omitempty"` }
type IKeyValueStorage ¶
type IKeyValueStorage interface { ReadStorage() map[string]interface{} SaveStorage(updatedConfig map[string]interface{}) Get(key ConfigKey) string Set(key ConfigKey, value interface{}) map[string]interface{} Delete(key ConfigKey) map[string]interface{} DeleteAll() map[string]interface{} Contains(key ConfigKey) bool IsEmpty() bool }
type IsSsidHidden ¶ added in v1.6.4
type IsSsidHidden struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []bool `json:"value,omitempty"` }
func NewIsSsidHidden ¶ added in v1.6.4
func NewIsSsidHidden(value bool) *IsSsidHidden
type KeeperFile ¶
type KeeperFile struct { FileKey string FileData []byte Uid string Type string Title string Name string LastModified int Size int F map[string]interface{} RecordKeyBytes []byte // contains filtered or unexported fields }
func NewKeeperFileFromJson ¶
func NewKeeperFileFromJson(fileDict map[string]interface{}, recordKeyBytes []byte) *KeeperFile
func (*KeeperFile) DecryptFileKey ¶
func (f *KeeperFile) DecryptFileKey() []byte
func (*KeeperFile) DeepCopy ¶
func (f *KeeperFile) DeepCopy() *KeeperFile
func (*KeeperFile) GetFileData ¶
func (f *KeeperFile) GetFileData() []byte
func (*KeeperFile) GetMeta ¶
func (f *KeeperFile) GetMeta() map[string]interface{}
func (*KeeperFile) GetUrl ¶
func (f *KeeperFile) GetUrl() string
func (*KeeperFile) ToString ¶
func (f *KeeperFile) ToString() string
type KeeperFileData ¶
type KeeperFileUpload ¶
func GetFileForUpload ¶
func GetFileForUpload(filePath, fileName, fileTitle, mimeType string) (*KeeperFileUpload, error)
type KeeperFolder ¶ added in v1.6.0
func NewKeeperFolder ¶ added in v1.6.0
func NewKeeperFolder(folderMap map[string]interface{}, folderKey []byte) *KeeperFolder
type KeeperRecordData ¶
type KeeperRecordData struct { Type string `json:"type,omitempty"` Title string `json:"title,omitempty"` Notes string `json:"notes,omitempty"` Fields []KeeperRecordField `json:"fields,omitempty"` Custom []KeeperRecordField `json:"custom,omitempty"` }
type KeeperRecordField ¶
type KeyPairs ¶
type KeyPairs struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []KeyPair `json:"value,omitempty"` }
func NewKeyPairs ¶
type KsmHttpResponse ¶
func NewKsmHttpResponse ¶
func NewKsmHttpResponse(statusCode int, data []byte, httpResponse *http.Response) *KsmHttpResponse
type LicenseNumber ¶
type LicenseNumber struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
func NewLicenseNumber ¶
func NewLicenseNumber(value string) *LicenseNumber
type Login ¶
type Login struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
type Multiline ¶
type Multiline struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
func NewMultiline ¶
type Names ¶
type Names struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []Name `json:"value,omitempty"` }
type NotationSection ¶
type NotationSection struct { Section string // section name - ex. prefix IsPresent bool // presence flag StartPos int // section start position in URI EndPos int // section end position in URI Text *ParserTuple // <unescaped, raw> text Parameter *ParserTuple // <field type>|<field label>|<file name> Index1 *ParserTuple // numeric index [N] or [] Index2 *ParserTuple // property index - ex. field/name[0][middle] }
func NewNotationSection ¶
func NewNotationSection(section string) *NotationSection
func ParseNotation ¶
func ParseNotation(notation string) ([]*NotationSection, error)
func ParseNotationInLegacyMode ¶
func ParseNotationInLegacyMode(notation string) ([]*NotationSection, error)
func ParseSection ¶
func ParseSection(notation string, section string, pos int) (*NotationSection, error)
type OneTimeCode ¶
type OneTimeCode struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
func NewOneTimeCode ¶
func NewOneTimeCode(value string) *OneTimeCode
type OneTimePassword ¶ added in v1.6.4
type OneTimePassword struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
func NewOneTimePassword ¶ added in v1.6.4
func NewOneTimePassword(value string) *OneTimePassword
type PamHostname ¶ added in v1.5.2
type PamHostname struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []Host `json:"value,omitempty"` }
func NewPamHostname ¶ added in v1.5.2
func NewPamHostname(value Host) *PamHostname
type PamRbiConnection ¶ added in v1.6.4
type PamRbiConnection struct { Protocol string `json:"protocol,omitempty"` UserRecords []string `json:"userRecords,omitempty"` AllowUrlManipulation bool `json:"allowUrlManipulation,omitempty"` AllowedUrlPatterns string `json:"allowedUrlPatterns,omitempty"` AllowedResourceUrlPatterns string `json:"allowedResourceUrlPatterns,omitempty"` HttpCredentialsUid string `json:"httpCredentialsUid,omitempty"` AutofillConfiguration string `json:"autofillConfiguration,omitempty"` }
type PamRemoteBrowserSetting ¶ added in v1.6.4
type PamRemoteBrowserSetting struct {
Connection PamRbiConnection `json:"connection,omitempty"`
}
type PamRemoteBrowserSettings ¶ added in v1.6.4
type PamRemoteBrowserSettings struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []PamRemoteBrowserSetting `json:"value,omitempty"` }
func NewPamRemoteBrowserSettings ¶ added in v1.6.4
func NewPamRemoteBrowserSettings(value PamRemoteBrowserSetting) *PamRemoteBrowserSettings
type PamResource ¶ added in v1.5.2
type PamResource struct { ControllerUid string `json:"controllerUid,omitempty"` FolderUid string `json:"folderUid,omitempty"` ResourceRef []string `json:"resourceRef,omitempty"` AllowedSettings AllowedSettings `json:"allowedSettings,omitempty"` }
type PamResources ¶ added in v1.5.2
type PamResources struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []PamResource `json:"value,omitempty"` }
func NewPamResources ¶ added in v1.5.2
func NewPamResources(value PamResource) *PamResources
type PamSetting ¶ added in v1.6.4
type PamSetting struct { PortForward []PamSettingsPortForward `json:"portForward,omitempty"` Connection []PamSettingsConnection `json:"connection,omitempty"` }
type PamSettings ¶ added in v1.6.4
type PamSettings struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []PamSetting `json:"value,omitempty"` }
func NewPamSettings ¶ added in v1.6.4
func NewPamSettings(value PamSetting) *PamSettings
type PamSettingsConnection ¶ added in v1.6.4
type PamSettingsConnection struct { Protocol string `json:"protocol,omitempty"` UserRecords []string `json:"userRecords,omitempty"` Security string `json:"security,omitempty"` IgnoreCert bool `json:"ignoreCert,omitempty"` ResizeMethod string `json:"resizeMethod,omitempty"` ColorScheme string `json:"colorScheme,omitempty"` }
type PamSettingsPortForward ¶ added in v1.6.4
type ParserTuple ¶
type ParserTuple struct { Text string // unescaped text RawText string // raw text incl. delimiter(s), escape characters etc. }
func ParseSubsection ¶
type Passkey ¶ added in v1.5.2
type Passkey struct { PrivateKey PasskeyPrivateKey `json:"privateKey,omitempty"` CredentialId string `json:"credentialId,omitempty"` SignCount int64 `json:"signCount,omitempty"` UserId string `json:"userId,omitempty"` RelyingParty string `json:"relyingParty,omitempty"` Username string `json:"username,omitempty"` CreatedDate int64 `json:"createdDate,omitempty"` }
type PasskeyPrivateKey ¶ added in v1.6.0
type Passkeys ¶ added in v1.5.2
type Passkeys struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []Passkey `json:"value,omitempty"` }
func NewPasskeys ¶ added in v1.5.2
type Password ¶
type Password struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` EnforceGeneration bool `json:"enforceGeneration,omitempty"` Complexity *PasswordComplexity `json:"complexity,omitempty"` Value []string `json:"value,omitempty"` }
func NewPassword ¶
type PasswordComplexity ¶
type PasswordOptions ¶
type PasswordOptions struct { MinLength string UppercaseLength string LowercaseLength string DigitsLength string SpecialCharactersLength string SpecialCharacterSet string }
PasswordOptions provides complexity settings for GeneratePasswordWithOptions Positive values specify minimum length, zero or negative - exact length Generated password must have at least MinLength characters - exact values may be converted to min values Empty strings or missing values will be substituted with a reasonable defaults ex. passing nil will generate password with length = DefaultPasswordLength using all charsets
type PaymentCard ¶
type PaymentCards ¶
type PaymentCards struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []PaymentCard `json:"value,omitempty"` }
func NewPaymentCards ¶
func NewPaymentCards(value PaymentCard) *PaymentCards
type Phones ¶
type Phones struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []Phone `json:"value,omitempty"` }
type PinCode ¶
type PinCode struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
func NewPinCode ¶
type PrivateKey ¶
type PrivateKey ecdsa.PrivateKey
func DerBase64PrivateKeyToPrivateKey ¶
func DerBase64PrivateKeyToPrivateKey(privateKeyDerBase64 string) (*PrivateKey, error)
func GenerateKeys ¶
func GenerateKeys(curve elliptic.Curve) (PrivateKey, error)
func GenerateNewEccKey ¶
func GenerateNewEccKey() (PrivateKey, error)
func GenerateP256Keys ¶
func GenerateP256Keys() (PrivateKey, error)
func GeneratePrivateKeyEcc ¶
func GeneratePrivateKeyEcc() (PrivateKey, error)
func LoadDerPrivateKeyDer ¶
func LoadDerPrivateKeyDer(data []byte) (*PrivateKey, error)
func (*PrivateKey) Equals ¶
func (priv *PrivateKey) Equals(k *PrivateKey) bool
Equals compares two private keys with constant time (to resist timing attacks)
func (*PrivateKey) GetPublicKey ¶
func (priv *PrivateKey) GetPublicKey() *PublicKey
GetPublicKey returns the associated PublicKey for this privatekey, If the key is missing then one is generated.
func (*PrivateKey) Hex ¶
func (priv *PrivateKey) Hex() string
Hex returns private key bytes as a hex string
func (*PrivateKey) SetBytes ¶
func (priv *PrivateKey) SetBytes(d []byte) *PrivateKey
SetBytes reconstructs the private key from D bytes
func (*PrivateKey) Sign ¶
func (priv *PrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)
Sign signs digest with priv, reading randomness from rand.
The opts argument is not currently used but, in keeping with the crypto.Signer interface, should be the hash function used to digest the message.
type PublicKey ¶
type QueryOptions ¶ added in v1.6.0
type RbiUrl ¶ added in v1.6.4
type RbiUrl struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []string `json:"value,omitempty"` }
type Record ¶
type Record struct { RecordKeyBytes []byte Uid string Files []*KeeperFile Revision int64 IsEditable bool RawJson string RecordDict map[string]interface{} // contains filtered or unexported fields }
func FindSecretByTitle ¶
func FindSecretsByTitle ¶
func NewRecord ¶
NewRecord returns a new empty record of the same type as template object but with new UID and RecordKeyBytes generates and uses new random UID if newRecordUid is empty returns error if template record is not found
func NewRecordClone ¶
func NewRecordClone(templateRecordUid string, records []*Record, newRecordUid string) (*Record, error)
NewRecordClone returns a deep copy of the template object with new UID and RecordKeyBytes generates and uses new random UID if newRecordUid is empty returns error if template record is not found
func NewRecordFromJson ¶
func NewRecordFromRecordData ¶
func NewRecordFromRecordData(recordData *RecordCreate, folder *Folder) *Record
func NewRecordFromRecordDataWithUid ¶
func NewRecordFromRecordDataWithUid(recordUid string, recordData *RecordCreate, folder *Folder) *Record
func (*Record) AddCustomField ¶
AddCustomField adds new custom field to the record The new field must satisfy the IsFieldClass function
func (*Record) DownloadFileByTitle ¶
func (*Record) FieldExists ¶
func (*Record) FindFile ¶
func (r *Record) FindFile(name string) *KeeperFile
FindFile finds the first file with matching file UID, name or title
func (*Record) FindFileByFilename ¶
func (r *Record) FindFileByFilename(filename string) *KeeperFile
FindFileByName finds the first file with matching filename
func (*Record) FindFileByTitle ¶
func (r *Record) FindFileByTitle(title string) *KeeperFile
FindFileByTitle finds the first file with matching title
func (*Record) FindFiles ¶
func (r *Record) FindFiles(name string) []*KeeperFile
FindFiles finds all files with matching file UID, name or title
func (*Record) GetCustomFieldValue ¶
func (*Record) GetCustomFieldValueByLabel ¶
GetCustomFieldValueByLabel returns string value of the *first* field from custom[] that matches fieldLabel
func (*Record) GetCustomFieldValueByType ¶
GetCustomFieldValueByType returns string value of the *first* field from custom[] that matches fieldType
func (*Record) GetCustomFieldValues ¶
func (*Record) GetCustomFieldsByLabel ¶
func (*Record) GetCustomFieldsByType ¶
func (*Record) GetFieldValueByLabel ¶
GetFieldValueByLabel returns string value of the *first* field from fields[] that matches fieldLabel
func (*Record) GetFieldValueByType ¶
GetFieldValueByType returns string value of the *first* field from fields[] that matches fieldType
func (*Record) GetFieldValuesByType ¶
func (*Record) GetFieldsByLabel ¶
func (*Record) GetFieldsByMask ¶
func (r *Record) GetFieldsByMask(fieldToken string, fieldTokenFlag FieldTokenFlag, fieldType FieldSectionFlag) []map[string]interface{}
GetFieldsByMask returns all fields from the corresponding field section (fields, custom or both) where fieldToken matches the FieldTokenFlag (type, label or both)
func (*Record) GetFieldsBySection ¶
func (r *Record) GetFieldsBySection(fieldSectionType FieldSectionFlag) []interface{}
func (*Record) GetFieldsByType ¶
func (*Record) GetStandardFieldValue ¶
func (*Record) InnerFolderUid ¶ added in v1.6.1
func (*Record) InsertField ¶
func (*Record) SetCustomFieldValue ¶
func (*Record) SetCustomFieldValueSingle ¶
func (*Record) SetFieldValueSingle ¶
func (*Record) SetPassword ¶
func (*Record) SetStandardFieldValue ¶
func (*Record) UpdateField ¶
type RecordCreate ¶
type RecordCreate struct { RecordType string `json:"type,omitempty"` Title string `json:"title,omitempty"` Notes string `json:"notes,omitempty"` Fields []interface{} `json:"fields,omitempty"` Custom []interface{} `json:"custom,omitempty"` }
func NewRecordCreate ¶
func NewRecordCreate(recordType, title string) *RecordCreate
func NewRecordCreateFromJson ¶
func NewRecordCreateFromJson(recordJson string) *RecordCreate
func NewRecordCreateFromJsonDecoder ¶
func NewRecordCreateFromJsonDecoder(recordJson string, disallowUnknownFields bool) (*RecordCreate, error)
func (RecordCreate) GetFieldByType ¶
func (r RecordCreate) GetFieldByType(field interface{}) interface{}
GetFieldByType returns first found field of the same type as field param The search goes first through fields[] then custom[] Note: Method returns a pointer so any value modifications are reflected directly in the record
func (RecordCreate) GetFieldsByType ¶
func (r RecordCreate) GetFieldsByType(field interface{}) []interface{}
GetFieldsByType returns all fields of the same type as field param The search goes first through fields[] then custom[] Note: Method returns pointers so any value modifications are reflected directly in the record
func (RecordCreate) ToDict ¶
func (r RecordCreate) ToDict() map[string]interface{}
func (RecordCreate) ToJson ¶
func (r RecordCreate) ToJson() string
type RecordField ¶
func NewRecordField ¶
func NewRecordField(fieldType, label string, required bool, value interface{}) *RecordField
type RecordRef ¶ added in v1.5.2
type RecordRef struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []string `json:"value,omitempty"` }
func NewRecordRef ¶ added in v1.5.2
type Schedules ¶ added in v1.5.2
type Schedules struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []Schedule `json:"value,omitempty"` }
func NewSchedules ¶ added in v1.5.2
type Scripts ¶ added in v1.5.2
type Scripts struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []Script `json:"value,omitempty"` }
func NewScripts ¶ added in v1.5.2
type Secret ¶
type Secret struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
type SecretsManager ¶
type SecretsManager struct { Token string Hostname string VerifySslCerts bool Config IKeyValueStorage // contains filtered or unexported fields }
func NewSecretsManager ¶
func NewSecretsManager(options *ClientOptions, arg ...interface{}) *SecretsManager
NewSecretsManager returns new *SecretsManager initialized with the options provided. If the configuration file cannot be initialized or parsed returns nil
func (*SecretsManager) CompleteTransaction ¶ added in v1.5.2
func (c *SecretsManager) CompleteTransaction(recordUid string, rollback bool) (err error)
func (*SecretsManager) CreateFolder ¶ added in v1.6.0
func (c *SecretsManager) CreateFolder(createOptions CreateOptions, folderName string, folders []*KeeperFolder) (folderUid string, err error)
CreateFolder creates new folder using the provided options.
folders == nil will force downloading all folders metadata with every request. Folders metadata could be retrieved from GetFolders() and cached and reused as long as it is not modified externally or internally
createOptions.FolderUid is required and must be a parent shared folder
createOptions.SubFolderUid could be many levels deep under its parent. If SubFolderUid is empty - new folder is created under parent FolderUid
func (*SecretsManager) CreateSecret ¶
func (c *SecretsManager) CreateSecret(record *Record) (recordUid string, err error)
CreateSecret creates new record from a cloned record found by NewRecord and the new record will be placed into the same shared folder as the original
func (*SecretsManager) CreateSecretWithRecordData ¶
func (c *SecretsManager) CreateSecretWithRecordData(recUid, folderUid string, recordData *RecordCreate) (recordUid string, err error)
CreateSecretWithRecordData creates new record using recordUID, folderUID and record data provided Note: if param recUid is empty - new auto generated record UID will be used
func (*SecretsManager) CreateSecretWithRecordDataAndOptions ¶ added in v1.6.0
func (c *SecretsManager) CreateSecretWithRecordDataAndOptions(createOptions *CreateOptions, recordData *RecordCreate, folders []*KeeperFolder) (recordUid string, err error)
CreateSecretWithRecordDataAndOptions creates new record using CreateOptions and record data provided
func (*SecretsManager) CreateSecretWithRecordDataUidAndOptions ¶ added in v1.6.3
func (c *SecretsManager) CreateSecretWithRecordDataUidAndOptions(recUid string, createOptions *CreateOptions, recordData *RecordCreate, folders []*KeeperFolder) (recordUid string, err error)
CreateSecretWithRecordDataUidAndOptions creates new record using the UID, CreateOptions and record data provided
func (*SecretsManager) DefaultKeeperServerPublicKeyId ¶
func (c *SecretsManager) DefaultKeeperServerPublicKeyId() string
func (*SecretsManager) DeleteFolder ¶ added in v1.6.0
func (c *SecretsManager) DeleteFolder(folderUids []string, forceDeletion bool) (statuses map[string]string, err error)
DeleteFolder removes the selected folders. Use forceDeletion flag to remove non-empty folders Note! When using forceDeletion avoid sending parent with its children folder UIDs. Depending on the delete order you may get an error ex. if parent force-deleted child first. There's no guarantee that list will always be processed in FIFO order. Note! Any folders UIDs missing from the vault or not shared to the KSM Application will not result in error.
func (*SecretsManager) DeleteSecrets ¶
func (c *SecretsManager) DeleteSecrets(recordUids []string) (statuses map[string]string, err error)
func (*SecretsManager) FindNotation ¶
func (c *SecretsManager) FindNotation(records []*Record, notation string) (fieldValue []interface{}, err error)
func (*SecretsManager) GenerateTransmissionKey ¶
func (c *SecretsManager) GenerateTransmissionKey(keyId string) *TransmissionKey
func (*SecretsManager) GetFolders ¶ added in v1.6.0
func (c *SecretsManager) GetFolders() ([]*KeeperFolder, error)
func (*SecretsManager) GetNotation ¶
func (c *SecretsManager) GetNotation(notation string) (fieldValue []interface{}, err error)
func (*SecretsManager) GetNotationResults ¶
func (c *SecretsManager) GetNotationResults(notation string) ([]string, error)
GetNotationResults returns a string list with all values specified by the notation or throws an error. Use TryGetNotationResults to just log errors and continue returning an empty string list on error.
func (*SecretsManager) GetSecretByTitle ¶
func (c *SecretsManager) GetSecretByTitle(recordTitle string) (record *Record, err error)
func (*SecretsManager) GetSecrets ¶
func (c *SecretsManager) GetSecrets(uids []string) (records []*Record, err error)
GetSecrets retrieves all records associated with the given application optionally filtered by uids
func (*SecretsManager) GetSecretsByTitle ¶
func (c *SecretsManager) GetSecretsByTitle(recordTitle string) (records []*Record, err error)
func (*SecretsManager) GetSecretsFullResponse ¶
func (c *SecretsManager) GetSecretsFullResponse(uids []string) (response *SecretsManagerResponse, err error)
func (*SecretsManager) GetSecretsFullResponseWithOptions ¶ added in v1.6.0
func (c *SecretsManager) GetSecretsFullResponseWithOptions(queryOptions QueryOptions) (response *SecretsManagerResponse, err error)
func (*SecretsManager) GetSecretsWithOptions ¶ added in v1.6.0
func (c *SecretsManager) GetSecretsWithOptions(queryOptions QueryOptions) (records []*Record, err error)
GetSecretsWithOptions retrieves all records associated with the given application optionally filtered by query options
func (*SecretsManager) HandleHttpError ¶
func (*SecretsManager) LoadSecretKey ¶
func (c *SecretsManager) LoadSecretKey() string
Returns client_id from the environment variable, config file, or in the code
func (*SecretsManager) NotationPrefix ¶
func (c *SecretsManager) NotationPrefix() string
func (*SecretsManager) PostFunction ¶
func (c *SecretsManager) PostFunction( url string, transmissionKey *TransmissionKey, encryptedPayloadAndSignature *EncryptedPayload, verifySslCerts bool) (*KsmHttpResponse, error)
func (*SecretsManager) PostQuery ¶
func (c *SecretsManager) PostQuery(path string, payload interface{}) (body []byte, err error)
func (*SecretsManager) PrepareContext ¶
func (c *SecretsManager) PrepareContext() *Context
func (*SecretsManager) Save ¶
func (c *SecretsManager) Save(record *Record) (err error)
func (*SecretsManager) SaveBeginTransaction ¶ added in v1.5.2
func (c *SecretsManager) SaveBeginTransaction(record *Record, transactionType UpdateTransactionType) (err error)
SaveBeginTransaction requires corresponding call to CompleteTransaction to either commit or rollback
func (*SecretsManager) SetCache ¶
func (c *SecretsManager) SetCache(cache ICache)
func (*SecretsManager) TryGetNotationResults ¶
func (c *SecretsManager) TryGetNotationResults(notation string) []string
TryGetNotationResults returns a string list with all values specified by the notation or empty list on error. It simply logs any errors and continue returning an empty string list on error.
func (*SecretsManager) UpdateFolder ¶ added in v1.6.0
func (c *SecretsManager) UpdateFolder(folderUid, folderName string, folders []*KeeperFolder) (err error)
UpdateFolder changes the folder metadata - currently folder name only folders == nil will force downloading all folders metadata with every request
func (*SecretsManager) UploadFile ¶
func (c *SecretsManager) UploadFile(record *Record, file *KeeperFileUpload) (uid string, err error)
func (*SecretsManager) UploadFilePath ¶
func (c *SecretsManager) UploadFilePath(record *Record, filePath string) (uid string, err error)
type SecretsManagerResponse ¶
type SecretsManagerResponse struct { AppData AppData Folders []*Folder Records []*Record ExpiresOn int64 Warnings string JustBound bool }
Server response contained details about the application and the records that were requested to be returned
func (SecretsManagerResponse) ExpiresOnStr ¶
func (r SecretsManagerResponse) ExpiresOnStr(dateFormat string) string
ExpiresOnStr retrieves string formatted expiration date if dateFormat is empty default format is used: "%Y-%m-%d %H:%M:%S"
type SecureNote ¶
type SecureNote struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
func NewSecureNote ¶
func NewSecureNote(value string) *SecureNote
type SecurityQuestion ¶
type SecurityQuestions ¶
type SecurityQuestions struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []SecurityQuestion `json:"value,omitempty"` }
func NewSecurityQuestions ¶
func NewSecurityQuestions(value SecurityQuestion) *SecurityQuestions
type TOTP ¶
type TOTP struct { Secret string // Secret key (required) Digits int // OTP digit count (default: 6) Algorithm string // OTP Algorithm ("SHA1" or "SHA256" or "SHA512") (default: SHA1) Period int64 // Period for which OTP is valid (seconds) (default: 30) == X in RFC6238 UnixTime int64 // (Optional) Unix Timestamp (default: Current unix timestamp) }
TOTP represents Time-based OTP - https://datatracker.ietf.org/doc/html/rfc6238
type Text ¶
type Text struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
type TotpCode ¶
type TotpCode struct { Code string // TOTP Code TimeLeft int // Time left in seconds (time before expiration) Period int // Period in seconds }
TotpCode provides detailed info about the generated TOTP code
func GetTotpCode ¶
Generates TOTP code from the URL and returns OTP as string, seconds remaining and any error encountered.
type TrafficEncryptionSeed ¶ added in v1.6.4
type TrafficEncryptionSeed struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []string `json:"value,omitempty"` }
func NewTrafficEncryptionSeed ¶ added in v1.6.4
func NewTrafficEncryptionSeed(value string) *TrafficEncryptionSeed
type TransmissionKey ¶
func NewTransmissionKey ¶
func NewTransmissionKey(publicKeyId string, key []byte, encryptedKey []byte) *TransmissionKey
type UpdateFolderPayload ¶ added in v1.6.0
type UpdateFolderPayload struct { ClientVersion string `json:"clientVersion"` ClientId string `json:"clientId"` FolderUid string `json:"folderUid"` Data string `json:"data"` }
func (*UpdateFolderPayload) UpdateFolderPayloadFromJson ¶ added in v1.6.0
func (p *UpdateFolderPayload) UpdateFolderPayloadFromJson(jsonData string)
func (*UpdateFolderPayload) UpdateFolderPayloadToJson ¶ added in v1.6.0
func (p *UpdateFolderPayload) UpdateFolderPayloadToJson() (string, error)
type UpdatePayload ¶
type UpdatePayload struct { ClientVersion string `json:"clientVersion"` ClientId string `json:"clientId"` RecordUid string `json:"recordUid"` Revision int64 `json:"revision"` Data string `json:"data"` TransactionType UpdateTransactionType `json:"transactionType,omitempty"` }
func (*UpdatePayload) UpdatePayloadFromJson ¶
func (p *UpdatePayload) UpdatePayloadFromJson(jsonData string)
func (*UpdatePayload) UpdatePayloadToJson ¶
func (p *UpdatePayload) UpdatePayloadToJson() (string, error)
type UpdateTransactionType ¶ added in v1.5.2
type UpdateTransactionType string
const ( TransactionTypeNone UpdateTransactionType = "" TransactionTypeGeneral UpdateTransactionType = "general" TransactionTypeRotation UpdateTransactionType = "rotation" )
type Url ¶
type Url struct { KeeperRecordField Required bool `json:"required,omitempty"` PrivacyScreen bool `json:"privacyScreen,omitempty"` Value []string `json:"value,omitempty"` }
type WifiEncryption ¶ added in v1.6.4
type WifiEncryption struct { KeeperRecordField Required bool `json:"required,omitempty"` Value []string `json:"value,omitempty"` }
func NewWifiEncryption ¶ added in v1.6.4
func NewWifiEncryption(value string) *WifiEncryption