Skip to content

Commit

Permalink
[Obs AI Assistant] Add route security to the API
Browse files Browse the repository at this point in the history
  • Loading branch information
viduni94 committed Nov 22, 2024
1 parent 5ee3017 commit feebf41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ import { createObservabilityServerRoute } from '../create_observability_server_r
const getObservabilityAlertDetailsContextRoute = createObservabilityServerRoute({
endpoint: 'GET /internal/observability/assistant/alert_details_contextual_insights',
options: {
tags: ['access:observability'],
access: 'internal',
},
security: {
authz: {
requiredPrivileges: ['observability'],
},
},
params: t.type({
query: alertDetailsContextRt,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/
import type { EndpointOf, ReturnOf, ServerRouteRepository } from '@kbn/server-route-repository';
import { KibanaRequest, Logger } from '@kbn/core/server';
import { KibanaRequest, Logger, RouteSecurity } from '@kbn/core/server';

import {
ObservabilityServerRouteRepository,
Expand All @@ -27,9 +27,10 @@ export interface ObservabilityRouteHandlerResources {

export interface ObservabilityRouteCreateOptions {
options: {
tags: string[];
tags?: string[];
access?: 'public' | 'internal';
};
security?: RouteSecurity;
}

export type AbstractObservabilityServerRouteRepository = ServerRouteRepository;
Expand Down

0 comments on commit feebf41

Please sign in to comment.