Skip to content

feat(secrets): Implement strict secret path validation#109

Merged
allisson merged 1 commit intomainfrom
secret-path-validation
Mar 6, 2026
Merged

feat(secrets): Implement strict secret path validation#109
allisson merged 1 commit intomainfrom
secret-path-validation

Conversation

@allisson
Copy link
Owner

@allisson allisson commented Mar 6, 2026

Introduce a new validation mechanism for secret paths to ensure consistency, security, and predictability across the storage engine. All secret paths now undergo character set, length, and format checks before processing.

Key changes:

  • Added 'validateSecretPath' in 'internal/secrets/usecase/validator.go' with rules for alphanumeric characters, hyphens, underscores, and slashes.
  • Enforced path constraints: 1-255 characters, no leading/trailing slashes, and no consecutive symbols (//, --, __).
  • Introduced 'ErrInvalidSecretPath' mapped to 'StatusUnprocessableEntity' (422) to align with the project's validation error standards.
  • Updated OpenAPI specification and product documentation to reflect the new naming requirements.
  • Adjusted existing tests and added a comprehensive test suite for path validation.

Why: To prevent path-based injection vulnerabilities, ensure storage predictability, and maintain a clean, standardized secret namespace.

Ref: Add Secret Path Validation track

Introduce a new validation mechanism for secret paths to ensure consistency,
security, and predictability across the storage engine. All secret paths
now undergo character set, length, and format checks before processing.

Key changes:
- Added 'validateSecretPath' in 'internal/secrets/usecase/validator.go' with
  rules for alphanumeric characters, hyphens, underscores, and slashes.
- Enforced path constraints: 1-255 characters, no leading/trailing slashes,
  and no consecutive symbols (//, --, __).
- Introduced 'ErrInvalidSecretPath' mapped to 'StatusUnprocessableEntity' (422)
  to align with the project's validation error standards.
- Updated OpenAPI specification and product documentation to reflect the new
  naming requirements.
- Adjusted existing tests and added a comprehensive test suite for path validation.

Why: To prevent path-based injection vulnerabilities, ensure storage
predictability, and maintain a clean, standardized secret namespace.

Ref: Add Secret Path Validation track
@allisson allisson merged commit 093f398 into main Mar 6, 2026
3 checks passed
@allisson allisson deleted the secret-path-validation branch March 6, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant