Skip to content

Semantic routers with a classifier can never be accepted #12

Open

Description

@shreemaan-abhishek

Problem

semantic.classifier requires provider_key_id (a typesafe ProviderKey). The gateway also accepts the name form semantic.classifier.provider_key (filesource/desugar.rs#L138-L151). The CRD generator strips provider_key_id at every depth (crd.go#L36) and adds nothing in its place, so the apiserver prunes every spelling of the field.

Reproduce

  • CRD pruning leaves {"classifier": {"type": "jev"}, ...}.
  • aisix validate rejects it: schema validation failed at `/semantic/classifier`: "provider_key_id" is a required property.
  • The same Model with classifier.provider_key injected is Applied, so the CRD is the only blocker.

The provider_key_ref description ("semantic models leave it unset", crd.go#L78) is wrong for classifier routers.

Scores

Reproducibility Likelihood Severity Existing mitigations Detectability Test coverage Fix cost vs benefit
10 4 3 1 8 1 8

Scores are out of 10. Higher is worse for likelihood and severity. Higher is better for mitigations, detectability, test coverage and cost vs benefit (10 = cheap fix, high value).

Fix

Tests to add

A schema test that the field exists, a render test that it resolves, and a real-binary test that a classifier Model is Applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions