[http] Add log for route path access (#152621)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Christiane (Tina) Heiligers 2023-03-06 15:12:33 -07:00 committed by GitHub
parent be430bc107
commit cf1fbc7c8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -516,6 +516,7 @@ export class HttpServer {
}
private configureRoute(route: RouterRoute) {
const optionsLogger = this.log.get('options');
this.log.debug(`registering route handler for [${route.path}]`);
// Hapi does not allow payload validation to be specified for 'head' or 'get' requests
const validate = isSafeMethod(route.method) ? undefined : { payload: true };
@ -526,6 +527,12 @@ export class HttpServer {
xsrfRequired: route.options.xsrfRequired ?? !isSafeMethod(route.method),
access: route.options.access ?? (route.path.startsWith('/internal') ? 'internal' : 'public'),
};
// Log HTTP API target consumer.
optionsLogger.debug(
`access [${kibanaRouteOptions.access}] [${route.method.toUpperCase()}] for path [${
route.path
}]`
);
this.server!.route({
handler: route.handler,