Skip to content

feat: add Namespace type with validation and hardcode metadata S3 prefix#239

Merged
alecthomas merged 1 commit intomainfrom
aat/namespace-type-and-validation
Mar 30, 2026
Merged

feat: add Namespace type with validation and hardcode metadata S3 prefix#239
alecthomas merged 1 commit intomainfrom
aat/namespace-type-and-validation

Conversation

@alecthomas
Copy link
Copy Markdown
Collaborator

Introduce cache.Namespace as a named string type with
TextUnmarshaler-based validation. Names must match
^[a-zA-Z0-9][a-zA-Z0-9_-]*$, preventing collisions with the
.metadata/ prefix used by the S3 metadata backend.

  • Replace string namespace parameters throughout the Cache interface
    and all implementations with the Namespace type
  • Remove configurable Prefix from metadatadb S3BackendConfig, hardcode
    .metadata as the prefix
  • Validate namespaces at API boundaries (HTTP handlers, strategy
    creation, CLI via Kong TextUnmarshaler)
  • Change Remote default namespace from "-" to "default"

Co-authored-by: Claude Code noreply@anthropic.com

Introduce cache.Namespace as a named string type with
TextUnmarshaler-based validation. Names must match
^[a-zA-Z0-9][a-zA-Z0-9_-]*$, preventing collisions with the
.metadata/ prefix used by the S3 metadata backend.

- Replace string namespace parameters throughout the Cache interface
  and all implementations with the Namespace type
- Remove configurable Prefix from metadatadb S3BackendConfig, hardcode
  .metadata as the prefix
- Validate namespaces at API boundaries (HTTP handlers, strategy
  creation, CLI via Kong TextUnmarshaler)
- Change Remote default namespace from "-" to "default"

Co-authored-by: Claude Code <noreply@anthropic.com>
@alecthomas alecthomas requested a review from a team as a code owner March 30, 2026 10:05
@alecthomas alecthomas requested review from js-murph and removed request for a team March 30, 2026 10:05
@alecthomas alecthomas enabled auto-merge (squash) March 30, 2026 10:05
@alecthomas alecthomas merged commit 4d2963e into main Mar 30, 2026
7 checks passed
@alecthomas alecthomas deleted the aat/namespace-type-and-validation branch March 30, 2026 10:07
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