feat(server): Add per-usecase expiration policy configuration#418
Merged
feat(server): Add per-usecase expiration policy configuration#418
Conversation
Introduces a central configuration block for use case properties. For now, this covers expiration policy constraints: operators can restrict which policies (manual, TTL, TTI) are permitted for a given use case, and cap the maximum duration for time-based policies. Writes that violate the configured constraints are rejected with a 400. Unconfigured use cases continue to accept any policy. Co-Authored-By: Claude <noreply@anthropic.com>
…orcement Consolidates coverage into a single test with three configured use cases (attachments, debug-files, avatars), each permitting only one expiration policy. Verifies valid requests, duration cap violations, disallowed policies, and pass-through for unconfigured use cases. Also refactors UseCases to a tuple struct with a public field so tests can construct it directly without a dedicated constructor.
matt-codecov
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a central configuration block for use case properties. For now, this covers expiration policy constraints: operators can restrict which policies (manual, TTL, TTI) are permitted for a given use case, and cap the maximum duration for time-based policies.
Writes that violate the configured constraints are rejected with 400. Unconfigured use cases continue to accept any policy, so this is fully opt-in with no impact on existing deployments.
This is the foundation for a richer use case configuration block — rate limits and killswitches may move here over time, and a per-use-case default expiration policy is planned as a follow-up.
See also https://github.com/getsentry/ops/pull/19947
Ref FS-322