Skip to content

Commit

Permalink
[Obs AI Assistant] Add security configs to API
Browse files Browse the repository at this point in the history
  • Loading branch information
viduni94 committed Nov 22, 2024
1 parent ad61b9d commit 0b4f2bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,11 @@ module.exports = {
}

if (
callee.type === 'MemberExpression' &&
callee.object &&
callee.object.name === 'router' &&
routeMethods.includes(callee.property.name)
(callee.type === 'MemberExpression' &&
callee.object &&
callee.object.name === 'router' &&
routeMethods.includes(callee.property.name)) ||
(callee.type === 'Identifier' && callee.name === 'createObservabilityServerRoute')
) {
if (process.env.MIGRATE_ENABLED_AUTHZ === 'false') {
maybeReportDisabledSecurityConfig(node, context, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class ObservabilityPlugin implements Plugin<ObservabilityPluginSetup> {
all: {
app: [observabilityFeatureId],
catalogue: [observabilityFeatureId],
api: ['rac'],
api: ['rac', 'observability'],
savedObject: {
all: [],
read: [],
Expand All @@ -164,7 +164,7 @@ export class ObservabilityPlugin implements Plugin<ObservabilityPluginSetup> {
read: {
app: [observabilityFeatureId],
catalogue: [observabilityFeatureId],
api: ['rac'],
api: ['rac', 'observability'],
savedObject: {
all: [],
read: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { createObservabilityServerRoute } from '../create_observability_server_r
const getObservabilityAlertDetailsContextRoute = createObservabilityServerRoute({
endpoint: 'GET /internal/observability/assistant/alert_details_contextual_insights',
options: {
tags: [],
tags: ['access:observability'],
access: 'internal',
},
params: t.type({
Expand Down

0 comments on commit 0b4f2bb

Please sign in to comment.