Skip to content

Only enforce model rules when the request carries a model - #163

Merged
J3rome merged 4 commits into
Flared:mainfrom
trotrem:fix/model-rules-only-when-model-present
Aug 27, 2026
Merged

Only enforce model rules when the request carries a model#163
J3rome merged 4 commits into
Flared:mainfrom
trotrem:fix/model-rules-only-when-model-present

Conversation

@trotrem

@trotrem trotrem commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Requests that carry no model were denied whenever capability.models was configured, because an absent model was matched against the pattern list and failed. This blocked legitimate endpoints that have no model, notably GET /v1/models, which returned 403.

Model patterns are now checked only when the request actually carries a model. A model that is present must still match.

image

Requests without a model were denied whenever a provider or grant
configured `capability.models`, because an absent model was matched
against the pattern list and failed. This blocked legitimate requests to
endpoints that carry no model at all, such as `GET /v1/models`.

Model patterns are now evaluated only when the request actually carries a
model: an absent model no longer fails a restriction, while a model that
is present must still match. Provider and user-agent matching are
unchanged, so a missing user agent still fails a non-empty pattern list.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment thread src/matching.rs Outdated
Comment thread src/matching.rs Outdated
Comment thread src/matching.rs Outdated
Comment thread src/matching.rs Outdated
Comment thread src/http_handlers/proxy.rs Outdated
Jean-Christophe Buteau added 2 commits August 26, 2026 14:31
@J3rome
J3rome merged commit b33d371 into Flared:main Aug 27, 2026
2 checks passed
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