Skip to content

[9.5] [Inference] Make feature settings reading work for users without inference privileges (#290457) - #290624

Merged
sphilipse merged 6 commits into
elastic:9.5from
sphilipse:backport/9.5/pr-290457
Sep 15, 2026
Merged

sphilipse merged 6 commits into
elastic:9.5from
sphilipse:backport/9.5/pr-290457

Conversation

@sphilipse

Copy link
Copy Markdown
Member

Backport

This will backport the following commits from main to 9.5:

Questions ?

Please refer to the Backport tool documentation

…rence privileges (elastic#290457)

Without the searchInferenceEndpoints.read privilege, users using an LLM
feature were presented with the full list of LLMs instead of only the
list of LLMs allowed for that feature. Fixing that by using the internal
user to read the settings.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/docs/extend/kibana/contributing/workflow/how-we-use-github#release-notes)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 0fa2625)

# Conflicts:
#	x-pack/platform/plugins/shared/search_inference_endpoints/server/plugin.ts
@sphilipse sphilipse added the backport This PR is a backport of another PR label Sep 11, 2026
@sphilipse
sphilipse enabled auto-merge (squash) September 11, 2026 15:45
@kibanamachine
kibanamachine requested review from saikatsarkar056 and removed request for kibanamachine September 11, 2026 15:45

@github-actions github-actions Bot 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.

Reviewed this backport. The authz-bypass logic (getUnsafeInternalClient scoped to the request namespace) is sound and preserves space isolation, but the cherry-pick introduced a duplicate block-scoped declaration that will break the build. See the inline comment.

Generated by Claude Reviewer for #290624 · claude · opus · 102.3 AIC · ⌖ 49.1 AIC · ⊞ 5.5K

getForFeature: async (
featureId: string,
request: KibanaRequest
) => {

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.

This backport introduces a duplicate const getConnectorById declaration. The identical const getConnectorById = (id: string) => plugins.inference.getConnectorById(id, request); already exists a few lines below (right after uiSettingsClient), so this scope now declares getConnectorById twice, which is a "Cannot redeclare block-scoped variable" compile error. The cherry-pick added this line without removing/reconciling the pre-existing one that was already on the 9.5 base. Remove this newly added line (the later declaration already covers all uses):

Suggested change
) => {

kibanamachine and others added 5 commits September 11, 2026 15:57
The cherry-pick introduced a redundant `const getConnectorById` line
immediately after `soClient`, duplicating the identical declaration
that already exists after `uiSettingsClient` in the same block scope.
Remove the extra declaration to resolve the TS2451 redeclaration error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kibanamachine

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

Test Failures

  • [job] [logs] Jest Tests #12 / ActionMenuContent renders alerts dropdown
  • [job] [logs] FTR Configs #92 / integrations For each artifact list under management When on the Event Filters entries list should be able to add a new Event Filters entry
  • [job] [logs] Scout Lane #28 - stateful-classic / default / local-stateful-classic - Event Annotation listing page - delete flow - select all and delete removes every group and surfaces the empty state
  • [job] [logs] Scout Lane #28 - stateful-classic / default / local-stateful-classic - Event Annotation listing page - renders the toolbar and saved annotation groups

History

@sphilipse
sphilipse merged commit 3d52176 into elastic:9.5 Sep 15, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants