Skip to content

Commit

Permalink
Create status_page plugin for New Platform
Browse files Browse the repository at this point in the history
This is required to register the /status route as an anonymous
route in NP. Without this commit, a functional test was failing.
Note, the security plugin now depends on the status_page plugin
because plugin load order matters when checking anonymous routes.
  • Loading branch information
jportner committed Nov 5, 2019
1 parent 947cd0c commit b80b0e3
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/plugins/status_page/kibana.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "status_page",
"version": "kibana",
"server": false,
"ui": true
}
24 changes: 24 additions & 0 deletions src/plugins/status_page/public/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { PluginInitializer } from 'kibana/public';
import { StatusPagePlugin, StatusPagePluginSetup, StatusPagePluginStart } from './plugin';

export const plugin: PluginInitializer<StatusPagePluginSetup, StatusPagePluginStart> = () =>
new StatusPagePlugin();
34 changes: 34 additions & 0 deletions src/plugins/status_page/public/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { Plugin, CoreSetup } from 'kibana/public';

export class StatusPagePlugin implements Plugin<StatusPagePluginSetup, StatusPagePluginStart> {
public setup(core: CoreSetup) {
core.http.anonymousPaths.register('/status');
return {};
}

public start() {}

public stop() {}
}

export type StatusPagePluginSetup = ReturnType<StatusPagePlugin['setup']>;
export type StatusPagePluginStart = ReturnType<StatusPagePlugin['start']>;
5 changes: 4 additions & 1 deletion x-pack/plugins/security/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"kibanaVersion": "kibana",
"configPath": ["xpack", "security"],
"server": true,
"ui": true
"ui": true,
"requiredPlugins": [
"status_page"
]
}

0 comments on commit b80b0e3

Please sign in to comment.