mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
# Backport This will backport the following commits from `main` to `8.12`: - [[Fleet] make deprecated paths public (#175038)](https://github.com/elastic/kibana/pull/175038) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Bardi","email":"90178898+juliaElastic@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-01-18T14:35:56Z","message":"[Fleet] make deprecated paths public (#175038)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/175031\r\n\r\nMade deprecated APIs public instead of internal, to fix the accidental\r\nbreaking change for customers who called these APIs before (internal\r\nAPIs don't have a default version resolution yet, so require a version\r\nheader)\r\n\r\nOne caveat of this change is if someone already changed their deprecated\r\nAPI call to use 'elastic-api-version: 1' in 8.11, as it would have to be\r\nchanged again to use the public version or remove the header. Though I\r\ndon't think we have many usages like that, since the version usage is\r\nnot very well documented and we only got one support question about it.","sha":"e31118abf9d3e312951f9184066242690c6a2ef5","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.12.1","v8.13.0"],"title":"[Fleet] make deprecated paths public","number":175038,"url":"https://github.com/elastic/kibana/pull/175038","mergeCommit":{"message":"[Fleet] make deprecated paths public (#175038)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/175031\r\n\r\nMade deprecated APIs public instead of internal, to fix the accidental\r\nbreaking change for customers who called these APIs before (internal\r\nAPIs don't have a default version resolution yet, so require a version\r\nheader)\r\n\r\nOne caveat of this change is if someone already changed their deprecated\r\nAPI call to use 'elastic-api-version: 1' in 8.11, as it would have to be\r\nchanged again to use the public version or remove the header. Though I\r\ndon't think we have many usages like that, since the version usage is\r\nnot very well documented and we only got one support question about it.","sha":"e31118abf9d3e312951f9184066242690c6a2ef5"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/175038","number":175038,"mergeCommit":{"message":"[Fleet] make deprecated paths public (#175038)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/175031\r\n\r\nMade deprecated APIs public instead of internal, to fix the accidental\r\nbreaking change for customers who called these APIs before (internal\r\nAPIs don't have a default version resolution yet, so require a version\r\nheader)\r\n\r\nOne caveat of this change is if someone already changed their deprecated\r\nAPI call to use 'elastic-api-version: 1' in 8.11, as it would have to be\r\nchanged again to use the public version or remove the header. Though I\r\ndon't think we have many usages like that, since the version usage is\r\nnot very well documented and we only got one support question about it.","sha":"e31118abf9d3e312951f9184066242690c6a2ef5"}}]}] BACKPORT--> --------- Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com> Co-authored-by: Julia Bardi <julia.bardi@elastic.co>
This commit is contained in:
parent
4ec94ee708
commit
519fbb8011
9 changed files with 17 additions and 42 deletions
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import type { FleetAuthz } from '../../../common';
|
||||
import { API_VERSIONS, INTERNAL_API_ACCESS } from '../../../common/constants';
|
||||
import { API_VERSIONS } from '../../../common/constants';
|
||||
|
||||
import { getRouteRequiredAuthz, type FleetAuthzRouter } from '../../services/security';
|
||||
|
||||
|
@ -351,7 +351,6 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
|
|||
);
|
||||
router.versioned
|
||||
.get({
|
||||
access: INTERNAL_API_ACCESS,
|
||||
path: AGENT_API_ROUTES.STATUS_PATTERN_DEPRECATED,
|
||||
fleetAuthz: {
|
||||
fleet: { all: true },
|
||||
|
@ -359,7 +358,7 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
|
|||
})
|
||||
.addVersion(
|
||||
{
|
||||
version: API_VERSIONS.internal.v1,
|
||||
version: API_VERSIONS.public.v1,
|
||||
validate: { request: GetAgentStatusRequestSchema },
|
||||
},
|
||||
getAgentStatusForAgentPolicyHandler
|
||||
|
|
|
@ -11,7 +11,7 @@ import type { TypeOf } from '@kbn/config-schema';
|
|||
import type { FleetAuthzRouter } from '../../services/security';
|
||||
|
||||
import { APP_API_ROUTES } from '../../constants';
|
||||
import { API_VERSIONS, INTERNAL_API_ACCESS } from '../../../common/constants';
|
||||
import { API_VERSIONS } from '../../../common/constants';
|
||||
|
||||
import { appContextService } from '../../services';
|
||||
import type { CheckPermissionsResponse, GenerateServiceTokenResponse } from '../../../common/types';
|
||||
|
@ -141,11 +141,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
|
|||
fleetAuthz: {
|
||||
fleet: { all: true },
|
||||
},
|
||||
access: INTERNAL_API_ACCESS,
|
||||
})
|
||||
.addVersion(
|
||||
{
|
||||
version: API_VERSIONS.internal.v1,
|
||||
version: API_VERSIONS.public.v1,
|
||||
validate: {},
|
||||
},
|
||||
generateServiceTokenHandler
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import type { FleetAuthzRouter } from '../../services/security';
|
||||
|
||||
import { ENROLLMENT_API_KEY_ROUTES } from '../../constants';
|
||||
import { API_VERSIONS, INTERNAL_API_ACCESS } from '../../../common/constants';
|
||||
import { API_VERSIONS } from '../../../common/constants';
|
||||
|
||||
import {
|
||||
GetEnrollmentAPIKeysRequestSchema,
|
||||
|
@ -91,11 +91,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
|
|||
fleetAuthz: {
|
||||
fleet: { readEnrollmentTokens: true },
|
||||
},
|
||||
access: INTERNAL_API_ACCESS,
|
||||
})
|
||||
.addVersion(
|
||||
{
|
||||
version: API_VERSIONS.internal.v1,
|
||||
version: API_VERSIONS.public.v1,
|
||||
validate: { request: GetOneEnrollmentAPIKeyRequestSchema },
|
||||
},
|
||||
getOneEnrollmentApiKeyHandler
|
||||
|
@ -107,11 +106,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
|
|||
fleetAuthz: {
|
||||
fleet: { all: true },
|
||||
},
|
||||
access: INTERNAL_API_ACCESS,
|
||||
})
|
||||
.addVersion(
|
||||
{
|
||||
version: API_VERSIONS.internal.v1,
|
||||
version: API_VERSIONS.public.v1,
|
||||
validate: { request: DeleteEnrollmentAPIKeyRequestSchema },
|
||||
},
|
||||
deleteEnrollmentApiKeyHandler
|
||||
|
@ -123,11 +121,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
|
|||
fleetAuthz: {
|
||||
fleet: { readEnrollmentTokens: true },
|
||||
},
|
||||
access: INTERNAL_API_ACCESS,
|
||||
})
|
||||
.addVersion(
|
||||
{
|
||||
version: API_VERSIONS.internal.v1,
|
||||
version: API_VERSIONS.public.v1,
|
||||
validate: { request: GetEnrollmentAPIKeysRequestSchema },
|
||||
},
|
||||
getEnrollmentApiKeysHandler
|
||||
|
@ -139,11 +136,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
|
|||
fleetAuthz: {
|
||||
fleet: { all: true },
|
||||
},
|
||||
access: INTERNAL_API_ACCESS,
|
||||
})
|
||||
.addVersion(
|
||||
{
|
||||
version: API_VERSIONS.internal.v1,
|
||||
version: API_VERSIONS.public.v1,
|
||||
validate: { request: PostEnrollmentAPIKeyRequestSchema },
|
||||
},
|
||||
postEnrollmentApiKeyHandler
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import type { IKibanaResponse } from '@kbn/core/server';
|
||||
|
||||
import { API_VERSIONS, INTERNAL_API_ACCESS } from '../../../common/constants';
|
||||
import { API_VERSIONS } from '../../../common/constants';
|
||||
|
||||
import type { FleetAuthz } from '../../../common';
|
||||
|
||||
|
@ -361,11 +361,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
|
|||
fleetAuthz: {
|
||||
integrations: { upgradePackages: true, writePackageSettings: true },
|
||||
},
|
||||
access: INTERNAL_API_ACCESS,
|
||||
})
|
||||
.addVersion(
|
||||
{
|
||||
version: API_VERSIONS.internal.v1,
|
||||
version: API_VERSIONS.public.v1,
|
||||
validate: { request: UpdatePackageRequestSchemaDeprecated },
|
||||
},
|
||||
async (context, request, response) => {
|
||||
|
@ -415,11 +414,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
|
|||
fleetAuthz: {
|
||||
integrations: { removePackages: true },
|
||||
},
|
||||
access: INTERNAL_API_ACCESS,
|
||||
})
|
||||
.addVersion(
|
||||
{
|
||||
version: API_VERSIONS.internal.v1,
|
||||
version: API_VERSIONS.public.v1,
|
||||
validate: { request: DeletePackageRequestSchemaDeprecated },
|
||||
},
|
||||
async (context, request, response) => {
|
||||
|
|
|
@ -13,6 +13,7 @@ describe('[Observability onboarding] Landing page', () => {
|
|||
describe('Entry point', () => {
|
||||
it('when clicking on the logs card the user is navigated to the observability onboarding page', () => {
|
||||
cy.getByTestSubj('guideButtonRedirect').click();
|
||||
cy.get('[data-filter-id="observability"]').click();
|
||||
cy.getByTestSubj('onboarding--observability--logs').click();
|
||||
|
||||
cy.url().should('include', '/app/observabilityOnboarding');
|
||||
|
|
|
@ -144,7 +144,7 @@ Cypress.Commands.add('deleteIntegration', (integrationName: string) => {
|
|||
},
|
||||
headers: {
|
||||
'kbn-xsrf': 'e2e_test',
|
||||
'Elastic-Api-Version': '1',
|
||||
'Elastic-Api-Version': '2023-10-31',
|
||||
},
|
||||
auth: { user: 'editor', pass: 'changeme' },
|
||||
});
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
import expect from '@kbn/expect';
|
||||
|
||||
import { INGEST_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server';
|
||||
import { API_VERSIONS } from '@kbn/fleet-plugin/common/constants';
|
||||
|
||||
import { AGENTS_INDEX } from '@kbn/fleet-plugin/common';
|
||||
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||
|
@ -232,11 +231,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('should work with deprecated api', async () => {
|
||||
await supertest
|
||||
.get(`/api/fleet/agent-status`)
|
||||
.set('kbn-xsrf', 'xxxx')
|
||||
.set('Elastic-Api-Version', `${API_VERSIONS.internal.v1}`)
|
||||
.expect(200);
|
||||
await supertest.get(`/api/fleet/agent-status`).set('kbn-xsrf', 'xxxx').expect(200);
|
||||
});
|
||||
|
||||
it('should work with adequate package privileges', async () => {
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
import expect from '@kbn/expect';
|
||||
|
||||
import { API_VERSIONS } from '@kbn/fleet-plugin/common/constants';
|
||||
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
|
||||
import { setupFleetAndAgents, getEsClientForAPIKey } from '../agents/services';
|
||||
import { skipIfNoDockerRegistry } from '../../helpers';
|
||||
|
@ -325,7 +324,6 @@ export default function (providerContext: FtrProviderContext) {
|
|||
const { body: apiResponse } = await supertest
|
||||
.post(`/api/fleet/enrollment-api-keys`)
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.set('Elastic-Api-Version', `${API_VERSIONS.internal.v1}`)
|
||||
.send({
|
||||
policy_id: 'policy1',
|
||||
})
|
||||
|
@ -334,20 +332,14 @@ export default function (providerContext: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('should get and delete with deprecated API', async () => {
|
||||
await supertest
|
||||
.get(`/api/fleet/enrollment-api-keys`)
|
||||
.set('Elastic-Api-Version', `${API_VERSIONS.internal.v1}`)
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.expect(200);
|
||||
await supertest.get(`/api/fleet/enrollment-api-keys`).set('kbn-xsrf', 'xxx').expect(200);
|
||||
await supertest
|
||||
.get(`/api/fleet/enrollment-api-keys/${ENROLLMENT_KEY_ID}`)
|
||||
.set('Elastic-Api-Version', `${API_VERSIONS.internal.v1}`)
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.expect(200);
|
||||
|
||||
await supertest
|
||||
.delete(`/api/fleet/enrollment-api-keys/${keyId}`)
|
||||
.set('Elastic-Api-Version', `${API_VERSIONS.internal.v1}`)
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.expect(200);
|
||||
});
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { API_VERSIONS } from '@kbn/fleet-plugin/common/constants';
|
||||
import { FtrProviderContext } from '../../api_integration/ftr_provider_context';
|
||||
|
||||
export default function (providerContext: FtrProviderContext) {
|
||||
|
@ -47,11 +46,7 @@ export default function (providerContext: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('should work with deprecated api', async () => {
|
||||
await supertest
|
||||
.post(`/api/fleet/service-tokens`)
|
||||
.set('kbn-xsrf', 'xxxx')
|
||||
.set('Elastic-Api-Version', `${API_VERSIONS.internal.v1}`)
|
||||
.expect(200);
|
||||
await supertest.post(`/api/fleet/service-tokens`).set('kbn-xsrf', 'xxxx').expect(200);
|
||||
});
|
||||
|
||||
it('should create a valid remote service account token', async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue