Skip to content

feat(server): Add per-usecase expiration policy configuration#418

Merged
jan-auer merged 3 commits intomainfrom
feat/usecase-expiration-policy-config
Apr 2, 2026
Merged

feat(server): Add per-usecase expiration policy configuration#418
jan-auer merged 3 commits intomainfrom
feat/usecase-expiration-policy-config

Conversation

@jan-auer
Copy link
Copy Markdown
Member

@jan-auer jan-auer commented Apr 1, 2026

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

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>
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 1, 2026

jan-auer added 2 commits April 1, 2026 15:42
…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.
@jan-auer jan-auer changed the title feat(server): Add per-use-case expiration policy configuration feat(server): Add per-usecase expiration policy configuration Apr 1, 2026
@jan-auer jan-auer marked this pull request as ready for review April 1, 2026 13:57
@jan-auer jan-auer requested a review from a team as a code owner April 1, 2026 13:57
@jan-auer jan-auer merged commit 3823400 into main Apr 2, 2026
21 checks passed
@jan-auer jan-auer deleted the feat/usecase-expiration-policy-config branch April 2, 2026 07:16
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.

2 participants