Skip to content

feat: enforce provider status and existence on publish and discover [#118] - #122

Open
kelvinprabhu wants to merge 26 commits into
developmentfrom
feat/118-enforce-provider-status-on-publish-and-discover
Open

kelvinprabhu wants to merge 26 commits into
developmentfrom
feat/118-enforce-provider-status-on-publish-and-discover

Conversation

@kelvinprabhu

@kelvinprabhu kelvinprabhu commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #118.

Adds a reusable providerstatus step plugin to the network adapter to prevent inactive or unregistered providers from publishing catalogs or appearing in discover results.

  • Publish: Only active registry providers can publish. Invalid providers are rejected with HTTP 400.
  • Discover: Filters results to active providers. Inactive or unknown providers are excluded without deleting their catalogs.
  • Fail closed: Registry failures or invalid/empty active-provider lists reject publishes (500) or return no discover results.
  • Action validation: Uses the URL path as the source of truth; mismatched body actions are rejected.
  • Registry integration: Adds RegistryStepProvider so step plugins can access the registry.

Configuration: The plugin is registered but not enabled in any config. Enabling it requires a separate Helm charts change.

Compatibility: No existing lines removed; existing configurations remain unchanged.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🛡️ Trivy security scan (CRITICAL,HIGH,MEDIUM,LOW)

View full run

Go dependencies

No findings at CRITICAL,HIGH,MEDIUM,LOW.

Container image

No findings at CRITICAL,HIGH,MEDIUM,LOW.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

📊 Test Coverage: ✅ Passed — 86% of changed lines covered, min 80%

@kelvinprabhu

Copy link
Copy Markdown
Collaborator Author

Rollout

  1. Merge this, build the plugin set.
  2. In the helmcharts repo, enable it in the network module only:
plugins:
  registrySteps:
    - id: providerstatus
steps:
  - validateSign
  - providerstatus
  - addRoute

The module path is / in multi-adapter and /_internal/network/ in single-adapter, so both modules need it.

Before step 2: the catalog crawler's retire publish (catalogcrawler/internal/sink) sends a body with no provider, which this gate would reject, and the sink retries a rejected publish indefinitely. Add provider.id to that body first.

@kelvinprabhu kelvinprabhu self-assigned this Nov 4, 2026
@kelvinprabhu kelvinprabhu added enhancement New feature or request adapter Adapter codebase (beckn-onix). Additive - use alongside a layer label labels Nov 4, 2026
@kelvinprabhu kelvinprabhu removed the enhancement New feature or request label Nov 4, 2026
@kelvinprabhu kelvinprabhu added the network Network layer - discovery, registry, protocol, catalog (Sanketika) label Nov 4, 2026
…#118]

The registry silently caps an unpaged search at 2,000 rows, so providers past the first 2,000 read as inactive. ActiveProviderIDs now asks for pages of 500 through a new searchPage helper and stops at totalCount, or at a short page when the answer carries no total. An empty page before the total fails the call. searchRecords is unchanged.
…e background [#118]

Requests no longer call the registry. The step loads the active list at startup and re-reads it every refreshInterval (default 10s); gated requests fail closed until a load succeeds and once the list is older than maxStaleness (default 60s). The plugin's cleanup function stops the refresher. On the quick-start stack discover with the step on went from p50 23.6ms to 3.0ms, and 20 concurrent discovers from 909 of 1,000 failing to all succeeding.
A registry that ignored offset, or reported a huge totalCount, could keep the paging loop running and growing until the refresh deadline. The listing now stops with an error past 100 pages of 500 rows; the previous list stays in use, so it fails closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adapter Adapter codebase (beckn-onix). Additive - use alongside a layer label network Network layer - discovery, registry, protocol, catalog (Sanketika)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inactive or unregistered providers can still publish catalogs and have them discovered

1 participant