Skip to content

fix(discovery-server): expose icto and psiid of applications - #858

Merged
ron96g merged 9 commits into
mainfrom
fix/discovery-server-application-external-ids
Nov 17, 2026
Merged

ron96g merged 9 commits into
mainfrom
fix/discovery-server-application-external-ids

Conversation

@stefan-ctrl

@stefan-ctrl stefan-ctrl commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Problem

The discovery API never returned icto/psiid, even though the Application CRD stores them in spec.externalIds. The ?icto= and ?psiid= filters were accepted but ignored.

GET /eventtypes listed event types from every environment. The route is unguarded (public), so no access prefix was set and the list was not restricted.

Fix

  • Return icto/psiid on applications, and icto on ApplicationRef (API/event subscriptions, event exposures).
  • Filter GET /applications by exact icto/psiid match; pagination links keep the filters.
  • apid is still not supported (no CRD stores it).
  • Restrict GET /eventtypes to the caller's environment (<env>-- namespace prefix), still across all teams. A missing environment returns 500.
GET /application/v2/applications?icto=icto-12345

Validation

make test and make lint pass in discovery-server. New unit and controller tests cover the mapping and filters. Snapshots only gain the icto/psiid lines. A new controller test checks that GET /eventtypes returns other teams' event types but excludes other environments, including a look-alike prefix (poc-other).

Copilot AI balanced review requested due to automatic review settings November 11, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 insufficient remaining quota. Try requesting a review at a lower effort level.

@stefan-ctrl
stefan-ctrl marked this pull request as draft November 11, 2026 15:28
@stefan-ctrl stefan-ctrl added bug Something isn't working discovery-server go Pull requests that update go code documentation Improvements or additions to documentation labels Nov 11, 2026
@lukas016
lukas016 requested a balanced review from Copilot November 12, 2026 08:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The mapping can return zone-valid ICTO values such as icto-42 that violate the published response schema’s five-digit constraint, causing schema validation failures for clients.

1 open issue

Review effort: Balanced

@stefan-ctrl
stefan-ctrl marked this pull request as ready for review November 13, 2026 12:07
… responses

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@stefan-ctrl
stefan-ctrl requested a balanced review from Copilot November 13, 2026 12:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 insufficient remaining quota. Try requesting a review at a lower effort level.

ron96g and others added 2 commits November 16, 2026 10:59
Rule 13 only recognised controller-runtime scoping (label selectors, ScopedClient, commented InNamespace), so every common-server store read in REST servers was a candidate that could only be silenced with an audit ignore. Describe how store reads are environment-scoped (environment-derived Get keys, same-environment references, EnforcePrefix/namespace-bound List options, pass-through helpers), add sourced allowed examples and an unscoped store List violation, and drop the six audit ignores this replaces.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e store

GET /applications loaded and mapped every application in scope, then dropped non-matching ones in memory. Translate the icto/psiid query filters into exact-match store filters on spec.externalIds instead, so non-matching applications never leave the store. Add specs against a real in-memory store, because the suite's mock ignores ListOpts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ron96g
ron96g requested review from julius-malcovsky, lukas016 and ron96g and a balanced review from Copilot November 16, 2026 10:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the application-identifier and environment-scoped discovery changes.

No open issues 🎉

1 file not reviewed
  • discovery-server/internal/api/server.gen.go: Generated file

Review effort: Balanced

@ron96g ron96g self-assigned this Nov 16, 2026
@ron96g
ron96g merged commit 1237c46 into main Nov 17, 2026
19 checks passed
@ron96g
ron96g deleted the fix/discovery-server-application-external-ids branch November 17, 2026 14:20
dtit-semantic-release Bot pushed a commit that referenced this pull request Nov 18, 2026
## [0.48.3](v0.48.2...v0.48.3) (2026-11-18)

### Bug Fixes

* **api,event,gateway:** preserve encoded upstream paths in gateway routes ([#837](#837)) ([551f3be](551f3be))
* **discovery-server:** expose icto and psiid of applications ([#858](#858)) ([1237c46](1237c46))
* **rover,event:** additional publishers get a client ([#872](#872)) ([af3d8e2](af3d8e2))

### Performance Improvements

* **rover-server:** stop resolving secrets when listing rovers ([#870](#870)) ([50a5f62](50a5f62))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working discovery-server documentation Improvements or additions to documentation go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants