-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathindex.js
48 lines (42 loc) · 1.41 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* @author Robin Duda
*
* Kibana 6 LDAP authentication plugin for multi-user mode.
*
* Requires all routes to carry a valid JWT token as a cookie
* or be redirected to a login page. A filter and proxy is
* added to the Kibana Hapi server to ensure query permissions
* on indices and to hijack queries for stored dashboards/queries/graphs
* so that the request may be processed in a context-aware manner.
*/
const Filter = require('./src/api/filter');
const API = require('./src/api/api');
const Config = require('./src/config').load('authentication');
const Logger = require('./src/logger');
require('./src/authentication/auth');
module.exports = function (kibana) {
return new kibana.Plugin({
name: 'kibana-mithril',
require: [],
uiExports: {
app: {
title: 'Mithril',
description: 'Mithril authentication plugin.',
main: 'plugins/kibana-mithril/script/app',
euiIconType: 'securityApp',
icon: 'plugins/kibana-mithril/img/icon.svg'
}
},
config(Joi) {
return Joi.object({
enabled: Joi.boolean().default(true),
}).default()
},
init: async function(server, options) {
Logger.writer(server);
Filter.proxy();
await API.register(server);
Logger.started();
}
});
};