Skip to content

Add cooldown package pattern overrides - #407

Merged
andrew merged 3 commits into
mainfrom
feat/cooldown-package-patterns
Oct 4, 2026
Merged

andrew merged 3 commits into
mainfrom
feat/cooldown-package-patterns

Conversation

@andrew

@andrew andrew commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Add cooldown.package_patterns so operators can set cooldown durations for package families, such as exempting an npm scope with pkg:npm/@example/*. Exact package overrides take precedence over patterns, followed by ecosystem overrides and the global default.

Keep pattern matching in the proxy and apply duration selection at the existing cooldown enforcement points, including NuGet metadata and downloads. Support * and ? wildcards that do not cross / separators. Reject character classes and backslash escapes before normalizing @ to %40, so normalization cannot change which packages a pattern matches. Validate durations, reject conflicting aliases at startup, and document the order used when multiple patterns match. A cooldown exemption still respects the version denylist.

Expose the library's full Evaluate decision, including the effective duration, eligibility time and reason, and use it for IsAllowed. This provides the policy result needed by the pending-cooldown report in #338. Publication-time persistence and consistent enforcement on cached downloads remain follow-up work there.

This wrapper is a step toward the general version filter in #127. Namespace blocking in #128 needs recursive matching and rejection before upstream access; cooldown patterns use non-recursive wildcards. Filtering support for additional ecosystems is tracked separately in #132.

Replaces #243, building on its policy wrapper and addressing the normalized-pattern collision finding.

Copilot AI balanced review requested due to automatic review settings October 4, 2026 17:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@andrew
andrew merged commit 866e559 into main Oct 4, 2026
9 checks passed
@andrew
andrew deleted the feat/cooldown-package-patterns branch October 4, 2026 19:48
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