package custommetadata

import "github.com/hashicorp/vault/sdk/helper/custommetadata"

Index

Functions

func Parse

func Parse(raw map[string]interface{}, filterNils bool) (map[string]string, error)

Parse is used to effectively convert the TypeMap (map[string]interface{}) into a TypeKVPairs (map[string]string) which is how custom_metadata is stored. Defining custom_metadata as a TypeKVPairs will convert nulls into empty strings. A null, however, is essential for a PATCH operation in that it signals the handler to remove the field. The filterNils flag should only be used during a patch operation.

func Validate

func Validate(cm map[string]string) error

Validate will perform input validation for custom metadata. CustomMetadata should be arbitrary user-provided key-value pairs meant to provide supplemental information about a resource. If the key count exceeds maxKeys, the validation will be short-circuited to prevent unnecessary (and potentially costly) validation to be run. If the key count falls at or below maxKeys, multiple checks will be made per key and value. These checks include:

Source Files

custom_metadata.go

Version
v0.18.0 (latest)
Published
Jun 5, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
1 month ago

Tools for package owners.