For the complete documentation index, see llms.txt. This page is also available as Markdown.

Record Field Classes

Description of each accessible field type Class in the Keeper Secrets Manager Go SDK

Go SDK v1.7.0 - Requires Go 1.16+. This page covers all standard and PAM field types. For a complete list of field type strings registered in the SDK, see the getKeeperRecordField switch in record_data.go.

Record fields in the Keeper Secrets Manager Go SDK are represented as strongly-typed Go structs. Each field type extends the base KeeperRecordField type.

Accessing Record Fields

Use the GetFieldsByType function to access record fields.

Using GetFieldsByType:

GetFieldsByType(fieldType string) []map[string]interface{}

Returns all standard fields matching the given type as a slice of raw maps. Fields are not automatically deserialized. Access values via map key and type assertion, or unmarshal into a typed struct (see Example 2).

// Get login field from record
if loginFields := record.GetFieldsByType("login"); len(loginFields) > 0 {
  loginField := loginFields[0]
  // loginField is map[string]interface{} — access values via key
  if values, ok := loginField["value"].([]interface{}); ok && len(values) > 0 {
    loginValue := values[0].(string)
    fmt.Printf("Login: %s\n", loginValue)
  }
}

Using GetFieldValueByType (recommended for simplicity):

import ksm "github.com/keeper-security/secrets-manager-go/core"

// Get login value directly
login := record.GetFieldValueByType("login")
fmt.Printf("Login: %s\n", login)

// Get password value
password := record.GetFieldValueByType("password")
fmt.Printf("Password: %s\n", password)

GetFieldValueByType returns a string value for simple fields. For complex fields (Phone, Address, etc.), use GetFieldsByType with JSON unmarshaling as shown in Example 2 below.

Field Type Classes Reference

KeeperRecordField

All Record Fields extend the KeeperRecordField class, and contain a Label and Type fields

Field Values

Name
Type
Required
Default

Label

string

No

""

Type

string

Yes

""

Login

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

PasswordComplexity

Field Values

Name
Type
Required
Default
Description

Length

int

No

0

Total password length

Caps

int

No

0

Minimum uppercase letters

Lowercase

int

No

0

Minimum lowercase letters

Digits

int

No

0

Minimum digits

Special

int

No

0

Minimum special characters

Password

Field Values

Name

Type

Required

Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

EnforceGeneration

bool

No

false

Value

[]string

Yes

Url

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

FileRef

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

Value

[]string

Yes

OneTimeCode

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

OneTimePassword

JSON field type string: "otp" (distinct from OneTimeCode which uses "oneTimeCode").

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

Name

Field Values

Name
Type
Required
Default

First

string

No

""

Middle

string

No

""

Last

string

No

""

Names

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]Name

Yes

BirthDate

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]int64

Yes

Date

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]int64

Yes

ExpirationDate

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]int64

Yes

Text

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

SecurityQuestion

Field Values

Name
Type
Required
Default

Question

string

No

""

Answer

string

No

""

SecurityQuestions

Field Values

Name

Type

Required

Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]SecurityQuestion

Yes

Multiline

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

Email

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

CardRef

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

AddressRef

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

PinCode

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

Phone

Field Values

Name
Type
Required
Default

Region

string

No

""

Number

string

No

""

Ext

string

No

""

Type

string

No

""

Phones

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]Phone

Yes

Secret

Field Values

Name

Type

Required

Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

SecureNote

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

AccountNumber

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

PaymentCard

Field Values

Name

Type

Required

Default

CardNumber

string

No

""

CardExpirationDate

string

No

""

CardSecurityCode

string

No

""

PaymentCards

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]PaymentCard

Yes

BankAccount

Field Values

Name
Type
Required
Default

AccountType

string

No

""

RoutingNumber

string

No

""

AccountNumber

string

No

""

OtherType

string

No

""

BankAccounts

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]BankAccount

Yes

KeyPair

Name
Type
Required
Default

PublicKey

string

No

""

PrivateKey

string

No

""

KeyPairs

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]KeyPair

Yes

Host

Field Values

Name
Type
Required
Default

Hostname

string

No

""

Port

string

No

""

Hosts

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]Host

Yes

Address

Field Values

Name
Type
Required
Default

Street1

string

No

""

Street2

string

No

""

City

string

No

""

State

string

No

""

Country

string

No

""

Zip

string

No

""

Addresses

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]Address

Yes

LicenseNumber

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]string

Yes

RecordRef

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

Value

[]string

Yes

Checkbox

Field Values

Name
Type
Required
Default

Label

string

No

""