Skip to content

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

Open
allisson wants to merge 1 commit intomainfrom
secret-path-validation
Open

feat(secrets): Implement strict secret path validation#109
allisson wants to merge 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
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