Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CollectionSecretDelimiter is the separator between collection and secret name in GSM CollectionSecretDelimiter = "__" // Encoding constants for special characters DotReplacementString = "--dot--" // UnderscorePrefix/Suffix for encoding consecutive underscores // __ → --uu--, ___ → --uuu--, etc. UnderscorePrefix = "--" UnderscoreSuffix = "--" CollectionRegex = "^([a-z0-9_-]*[a-z0-9])?$" GroupRegex = `^[a-z0-9]+([a-z0-9_-]*[a-z0-9]+)?(/[a-z0-9]+([a-z0-9_-]*[a-z0-9]+)?)*$` SecretNameRegex = "^[A-Za-z0-9_-]+$" // MaxCollectionLength is the maximum length of a collection name MaxCollectionLength = 50 // GcpMaxNameLength is the maximum length for a GSM secret name GcpMaxNameLength = 255 )
Variables ¶
This section is empty.
Functions ¶
func DenormalizeName ¶
DenormalizeName decodes field names back to their original form. This reverses the encoding done by NormalizeName. Decodes in reverse order of NormalizeName.
func NormalizeName ¶
NormalizeName replaces forbidden characters in names with safe replacements. This is used when migrating from Vault to GSM to handle special characters. Rules (applied in order):
- `__` (2+ consecutive underscores) → `--uu--`, `--uuu--`, etc.
- `.` → `--dot--` (dots not allowed in GSM secret names)
Examples:
- ".dockerconfigjson" → "--dot--dockerconfigjson"
- "mac_ai__base_dir" → "mac_ai--uu--base_dir"
- "some___field" → "some--uuu--field"
- "field.with__both" → "field--dot--with--uu--both"
func ValidateCollectionName ¶
ValidateCollectionName validates a GSM collection name
func ValidateGroupName ¶
func ValidateSecretName ¶
ValidateSecretName validates a GSM secret name
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.