[9.5] [Inference] Make feature settings reading work for users without inference privileges (#290457) - #290624
Conversation
…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
There was a problem hiding this comment.
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 | ||
| ) => { |
There was a problem hiding this comment.
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):
| ) => { |
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>
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
Test Failures
History
|
Backport
This will backport the following commits from
mainto9.5:Questions ?
Please refer to the Backport tool documentation