Skip to content

Commit

Permalink
fixed alerts fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed May 19, 2020
1 parent 996a739 commit fd44d7e
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ import {
IKibanaResponse,
} from 'kibana/server';
import { schema } from '@kbn/config-schema';
import { EncryptedSavedObjectsPluginSetup } from '../../../../../../../plugins/encrypted_saved_objects/server';
import { EncryptedSavedObjectsPluginStart } from '../../../../../../../plugins/encrypted_saved_objects/server';
import { SpacesPluginSetup } from '../../../../../../../plugins/spaces/server';

interface FixtureSetupDeps {
spaces?: SpacesPluginSetup;
encryptedSavedObjects: EncryptedSavedObjectsPluginSetup;
}
interface FixtureStartDeps {
encryptedSavedObjects: EncryptedSavedObjectsPluginStart;
}

export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps> {
public setup(core: CoreSetup, { spaces, encryptedSavedObjects }: FixtureSetupDeps) {
export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps, FixtureStartDeps> {
public setup(core: CoreSetup<FixtureStartDeps>, { spaces }: FixtureSetupDeps) {
core.http.createRouter().post(
{
path: '/api/check_aad',
Expand All @@ -41,12 +43,10 @@ export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps> {
): Promise<IKibanaResponse<any>> {
try {
let namespace: string | undefined;
const encryptedSavedObjectsWithAlert = encryptedSavedObjects.startWithHiddenTypes([
'alert',
]);
if (spaces && req.body.spaceId) {
namespace = spaces.spacesService.spaceIdToNamespace(req.body.spaceId);
}
const [, { encryptedSavedObjects }] = await core.getStartServices();
await encryptedSavedObjects
.getClient(['alert'])
.getDecryptedAsInternalUser(req.body.type, req.body.id, {
Expand Down

0 comments on commit fd44d7e

Please sign in to comment.