Skip to content

feat: add idempotency key validation and normalization#1

Open
Devcyprian wants to merge 2 commits into
developfrom
feat/idempotency-key-validation
Open

feat: add idempotency key validation and normalization#1
Devcyprian wants to merge 2 commits into
developfrom
feat/idempotency-key-validation

Conversation

@Devcyprian

Copy link
Copy Markdown
Owner

Closes Synapse-bridgez#217

Add strict idempotency key validation and normalization in middleware to enforce allowed characters, trim whitespace, and reject invalid values.

- Add validation for key length (min 1, max 255 characters)
- Allow only alphanumeric, hyphens, underscores, and dots
- Reject keys with control characters or whitespace
- Trim whitespace from key values
- Return 400 with clear error message on invalid keys
- Add comprehensive unit tests for valid/invalid patterns

Closes Synapse-bridgez#217
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