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

""

Required

bool

No

false

Value

[]bool

Yes

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

Value

[]string

Yes

Schedule

Field Values

Name
Type
Required
Default
Description

Type

string

No

""

Schedule type (e.g. "weekly")

Cron

string

No

""

Cron expression

Time

string

No

""

Time of day (replaces deprecated UtcTime)

Tz

string

No

""

IANA timezone (e.g. "America/Chicago")

Weekday

string

No

""

Day of week for weekly schedules

IntervalCount

int

No

0

Repeat interval count

Schedules

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

Value

[]Schedule

Yes

DirectoryType

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

Value

[]string

Yes

DatabaseType

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

Value

[]string

Yes

PamHostname

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]Host

Yes

Value uses the same Host struct as Hosts. See Host.

AllowedSettings

Field Values

Name
Type
Required
Default

Connections

bool

No

false

PortForwards

bool

No

false

Rotation

bool

No

false

SessionRecording

bool

No

false

TypescriptRecording

bool

No

false

PamResource

Field Values

Name
Type
Required
Default

ControllerUid

string

No

""

FolderUid

string

No

""

ResourceRef

[]string

No

nil

AllowedSettings

AllowedSettings

No

PamResources

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

Value

[]PamResource

Yes

Script

Field Values

Name
Type
Required
Default
Description

FileRef

string

No

""

UID of the attached script file

Command

string

No

""

Shell command to execute

RecordRef

[]string

No

nil

UIDs of records passed as script context

Scripts

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

PrivacyScreen

bool

No

false

Value

[]Script

Yes

PamSettingsPortForward

Field Values

Name
Type
Required
Default

ReusePort

bool

No

false

Port

string

No

""

PamSettingsConnection

Field Values

Name
Type
Required
Default

Protocol

string

No

""

UserRecords

[]string

No

nil

Security

string

No

""

IgnoreCert

bool

No

false

ResizeMethod

string

No

""

ColorScheme

string

No

""

PamSetting

Field Values

Name
Type
Required
Default

PortForward

[]PamSettingsPortForward

No

nil

Connection

[]PamSettingsConnection

No

nil

PamSettings

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

Value

[]PamSetting

Yes

PamRbiConnection

Field Values

Name
Type
Required
Default

Protocol

string

No

""

UserRecords

[]string

No

nil

AllowUrlManipulation

bool

No

false

AllowedUrlPatterns

string

No

""

AllowedResourceUrlPatterns

string

No

""

HttpCredentialsUid

string

No

""

AutofillConfiguration

string

No

""

PamRemoteBrowserSetting

Field Values

Name
Type
Required
Default

Connection

PamRbiConnection

No

PamRemoteBrowserSettings

Field Values

Name
Type
Required
Default

Label

string

No

""

Required

bool

No

false

Value

[]PamRemoteBrowserSetting

Yes

KeeperFileData

Field Values

Name
Type
Description

Title

string

Display title for the file attachment

Name

string

Original filename

Type

string

MIME type

Size

int64

File size in bytes

LastModified

int64

Last modified timestamp (Unix milliseconds)

KeeperFileData is populated by the server when a file is uploaded. All fields use omitempty — the SDK does not enforce any field as required.

Field Access Best Practices

Improved in v1.7.0: The SDK now gracefully handles broken or missing field data instead of failing

Safe Field Access Pattern

When accessing record fields, always check for:

  1. Field existence - The field may not be present in the record

  2. Value existence - The field may exist but have no value

  3. Type assertions - The value may not be in the expected format

Recommended pattern:

Using GetFieldValueByType (simpler):

Handling Broken Fields

If a record contains fields with broken encryption:

  • Valid fields are still accessible

  • Broken fields are silently skipped

  • No errors are thrown for individual field failures

Example:

Common Field Access Patterns

Example 1: Retrieve All Fields from a Login Record

Example 2: Access Complex Fields (Phone, Address)

Example 3: Check if Field Exists Before Accessing

Last updated