backend-plugin-api: export healthCheckConfig fn
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
@@ -26,6 +26,11 @@ export interface HttpRouterServiceAuthPolicy {
|
||||
allow: 'unauthenticated' | 'user-cookie';
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export interface HttpRouterHealthCheckConfig {
|
||||
handler: () => Promise<any>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows plugins to register HTTP routes.
|
||||
*
|
||||
@@ -40,6 +45,8 @@ export interface HttpRouterService {
|
||||
*/
|
||||
use(handler: Handler): void;
|
||||
|
||||
healthCheckConfig(healthCheckOptions: HttpRouterHealthCheckConfig): void;
|
||||
|
||||
/**
|
||||
* Adds an auth policy to the router. This is used to allow unauthenticated or
|
||||
* cookie based access to parts of a plugin's API.
|
||||
|
||||
@@ -35,6 +35,7 @@ export type { DiscoveryService } from './DiscoveryService';
|
||||
export type {
|
||||
HttpRouterService,
|
||||
HttpRouterServiceAuthPolicy,
|
||||
HttpRouterHealthCheckConfig,
|
||||
} from './HttpRouterService';
|
||||
export type { HttpAuthService } from './HttpAuthService';
|
||||
export type {
|
||||
|
||||
@@ -348,6 +348,7 @@ export namespace mockServices {
|
||||
export const factory = httpRouterServiceFactory;
|
||||
export const mock = simpleMock(coreServices.httpRouter, () => ({
|
||||
use: jest.fn(),
|
||||
healthCheckConfig: jest.fn(),
|
||||
addAuthPolicy: jest.fn(),
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user