Skip to content

Commit

Permalink
revert console changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Dec 26, 2024
1 parent c919fba commit 435bcc5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ export const registerAutocompleteEntitiesRoute = (deps: RouteDependencies) => {
deps.router.get(
{
path: '/api/console/autocomplete_entities',
security: {
authz: {
enabled: false,
reason: 'Relies on es client for authorization',
},
},
options: {
tags: ['access:console'],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,19 @@ import { EsConfigApiResponse } from '../../../../../common/types/api_responses';
import { RouteDependencies } from '../../..';

export const registerEsConfigRoute = ({ router, services }: RouteDependencies): void => {
router.get(
{
path: '/api/console/es_config',
security: {
authz: {
enabled: false,
reason: 'Low effort request for config content',
},
},
validate: false,
},
async (ctx, req, res) => {
const cloudUrl = services.esLegacyConfigService.getCloudUrl();
if (cloudUrl) {
const body: EsConfigApiResponse = { host: cloudUrl };

return res.ok({ body });
}
const {
hosts: [host],
} = await services.esLegacyConfigService.readConfig();

const body: EsConfigApiResponse = { host };
router.get({ path: '/api/console/es_config', validate: false }, async (ctx, req, res) => {
const cloudUrl = services.esLegacyConfigService.getCloudUrl();
if (cloudUrl) {
const body: EsConfigApiResponse = { host: cloudUrl };

return res.ok({ body });
}
);
const {
hosts: [host],
} = await services.esLegacyConfigService.readConfig();

const body: EsConfigApiResponse = { host };

return res.ok({ body });
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ export const registerProxyRoute = (deps: RouteDependencies) => {
parse: false,
},
},
security: {
authz: {
enabled: false,
reason: 'Relies on es for authorization',
},
},
validate: routeValidationConfig,
},
createHandler(deps)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,5 @@ export const registerSpecDefinitionsRoute = ({ router, services }: RouteDependen
});
};

router.get(
{
path: '/api/console/api_server',
security: {
authz: {
enabled: false,
reason: 'Low effort request for config info',
},
},
validate: false,
},
handler
);
router.get({ path: '/api/console/api_server', validate: false }, handler);
};

0 comments on commit 435bcc5

Please sign in to comment.