Skip to content

Commit 3ff594c

Browse files
Merge branch '8.x' into backport/8.x/pr-197482
2 parents f5142ee + 7a4bb76 commit 3ff594c

22 files changed

Lines changed: 65 additions & 31 deletions

File tree

packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const sharedOas = {
151151
tags: ['versioned'],
152152
},
153153
},
154-
'/foo/{id}/{path*}': {
154+
'/foo/{id}/{path}': {
155155
get: {
156156
description: 'route description',
157157
operationId: 'get-foo-id-path',

packages/kbn-router-to-openapispec/src/generate_oas.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ describe('generateOpenApiDocument', () => {
314314
}
315315
);
316316
// router paths
317-
expect(result.paths['/1-1/{id}/{path*}']!.get!.tags).toEqual(['1', '2']);
318-
expect(result.paths['/1-2/{id}/{path*}']!.get!.tags).toEqual(['1']);
319-
expect(result.paths['/2-1/{id}/{path*}']!.get!.tags).toEqual([]);
317+
expect(result.paths['/1-1/{id}/{path}']!.get!.tags).toEqual(['1', '2']);
318+
expect(result.paths['/1-2/{id}/{path}']!.get!.tags).toEqual(['1']);
319+
expect(result.paths['/2-1/{id}/{path}']!.get!.tags).toEqual([]);
320320
// versioned router paths
321321
expect(result.paths['/v1-1']!.get!.tags).toEqual(['v1']);
322322
expect(result.paths['/v1-2']!.get!.tags).toEqual(['v2', 'v3']);
@@ -392,17 +392,17 @@ describe('generateOpenApiDocument', () => {
392392
);
393393

394394
// router paths
395-
expect(result.paths['/1-1/{id}/{path*}']!.get).toMatchObject({
395+
expect(result.paths['/1-1/{id}/{path}']!.get).toMatchObject({
396396
'x-state': 'Technical Preview',
397397
});
398-
expect(result.paths['/1-2/{id}/{path*}']!.get).toMatchObject({
398+
expect(result.paths['/1-2/{id}/{path}']!.get).toMatchObject({
399399
'x-state': 'Beta',
400400
});
401401

402-
expect(result.paths['/1-3/{id}/{path*}']!.get).not.toMatchObject({
402+
expect(result.paths['/1-3/{id}/{path}']!.get).not.toMatchObject({
403403
'x-state': expect.any(String),
404404
});
405-
expect(result.paths['/2-1/{id}/{path*}']!.get).not.toMatchObject({
405+
expect(result.paths['/2-1/{id}/{path}']!.get).not.toMatchObject({
406406
'x-state': expect.any(String),
407407
});
408408

packages/kbn-router-to-openapispec/src/util.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ import {
1717
getPathParameters,
1818
createOpIdGenerator,
1919
GetOpId,
20+
assignToPaths,
21+
extractTags,
2022
} from './util';
21-
import { assignToPaths, extractTags } from './util';
2223

2324
describe('extractTags', () => {
2425
test.each([
@@ -115,9 +116,11 @@ describe('assignToPaths', () => {
115116
const paths = {};
116117
assignToPaths(paths, '/foo', {});
117118
assignToPaths(paths, '/bar/{id?}', {});
119+
assignToPaths(paths, '/bar/file/{path*}', {});
118120
expect(paths).toEqual({
119121
'/foo': {},
120122
'/bar/{id}': {},
123+
'/bar/file/{path}': {},
121124
});
122125
});
123126
});
@@ -320,7 +323,7 @@ describe('createOpIdGenerator', () => {
320323
{
321324
input: {
322325
method: 'get',
323-
path: '/api/my/resource/{path*}',
326+
path: '/api/my/resource/{path}',
324327
},
325328
output: 'get-my-resource-path',
326329
},

packages/kbn-router-to-openapispec/src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const assignToPaths = (
132132
path: string,
133133
pathObject: OpenAPIV3.PathItemObject
134134
): void => {
135-
const pathName = path.replace('?', '');
135+
const pathName = path.replace(/[\?\*]/, '');
136136
paths[pathName] = { ...paths[pathName], ...pathObject };
137137
};
138138

x-pack/plugins/embeddable_enhanced/public/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ export class EmbeddableEnhancedPlugin
148148
);
149149
const api: DynamicActionStorageApi = {
150150
dynamicActionsState$,
151-
setDynamicActions: (newState) => {
152-
dynamicActionsState$.next(newState);
151+
setDynamicActions: (enhancements) => {
152+
dynamicActionsState$.next(getDynamicActionsState(enhancements));
153153
},
154154
};
155155
const storage = new DynamicActionStorage(uuid, getTitle, api);

x-pack/plugins/kubernetes_security/server/routes/aggregate.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ export const registerAggregateRoute = (router: IRouter, logger: Logger) => {
3838
.addVersion(
3939
{
4040
version: '1',
41+
security: {
42+
authz: {
43+
requiredPrivileges: ['securitySolution'],
44+
},
45+
},
4146
validate: {
4247
request: {
4348
query: schema.object({

x-pack/plugins/kubernetes_security/server/routes/count.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ export const registerCountRoute = (router: IRouter, logger: Logger) => {
2828
.addVersion(
2929
{
3030
version: '1',
31+
security: {
32+
authz: {
33+
requiredPrivileges: ['securitySolution'],
34+
},
35+
},
3136
validate: {
3237
request: {
3338
query: schema.object({

x-pack/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ export const registerMultiTermsAggregateRoute = (router: IRouter, logger: Logger
3535
.addVersion(
3636
{
3737
version: '1',
38+
security: {
39+
authz: {
40+
requiredPrivileges: ['securitySolution'],
41+
},
42+
},
3843
validate: {
3944
request: {
4045
query: schema.object({

x-pack/plugins/observability_solution/observability_ai_assistant/server/config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { schema, type TypeOf } from '@kbn/config-schema';
99

1010
export const config = schema.object({
1111
enabled: schema.boolean({ defaultValue: true }),
12-
modelId: schema.maybe(schema.string()), // TODO: Remove
1312
scope: schema.maybe(schema.oneOf([schema.literal('observability'), schema.literal('search')])),
1413
enableKnowledgeBase: schema.boolean({ defaultValue: true }),
1514
});

0 commit comments

Comments
 (0)