Merge "Rename the package to monasca-kibana-plugin"

This commit is contained in:
Jenkins 2017-02-13 11:51:23 +00:00 committed by Gerrit Code Review
commit 85eaa51a10
20 changed files with 55 additions and 52 deletions

View File

@ -1,7 +1,16 @@
FTS-Keystone
Monasca Kibana plugin
=====
Keystone authentication support for Kibana 4.4.x
Keystone authentication support and multi-tenancy for Kibana 4.6.x
Build
-----
```
npm install
npm run package
```
Installation
-----
@ -10,24 +19,18 @@ Requires a working version of Kibana. The kibana configuration file (/opt/kibana
where keystone_port should be the keystone admin port (default: 35357) not the keystone member port (default: 5000):
```
fts-keystone.port: ${keystone_port}
fts-keystone.url: http://${keystone_host}
fts-keystone.enabled: True
fts-keystone.defaultTimeField: '@timestamp'
monasca-kibana-plugin.port: ${keystone_port}
monasca-kibana-plugin.url: http://${keystone_host}
monasca-kibana-plugin.enabled: True
monasca-kibana-plugin.defaultTimeField: '@timestamp'
```
To install the fts-keystone plugin, first the latest release should be downloaded:
Then install using the Kibana plugin manager tool:
```
$ (cd /tmp; wget https://github.com/FujitsuEnablingSoftwareTechnologyGmbH/fts-keystone/releases/download/v0.0.1/fts-keystone-0.0.1.tar.gz; cd -)
```
Then installed using the Kibana plugin manager tool:
```
$ /opt/kibana/bin/kibana plugin --install fts-keystone --url file:///tmp/fts-keystone-0.0.1.tar.gz
Installing fts-keystone
Attempting to transfer from file:///tmp/fts-keystone-0.0.1.tar.gz
$ /opt/kibana/bin/kibana plugin --install monasca-kibana-plugin --url file:///tmp/monasca-kibana-plugin-0.0.1.tar.gz
Installing monasca-kibana-plugin
Attempting to transfer from file:///tmp/monasca-kibana-plugin-0.0.1.tar.gz
Transferring 7567007 bytes....................
Transfer complete
Extracting plugin archive
@ -36,7 +39,7 @@ Optimizing and caching browser bundles...
Plugin installation complete
$ /opt/kibana/bin/kibana plugin --list
fts-keystone
monasca-kibana-plugin
```
Now start/restart your Kibana server by running:

View File

@ -1,8 +1,8 @@
{
"name": "fts-keystone",
"name": "monasca-kibana-plugin",
"version": "0.0.5",
"description": "Keystone authentication & multitenancy support for Kibana 4.5.x",
"author": "Fujitsu Enabling Software Technology GmbH",
"description": "Keystone authentication & multitenancy support for Kibana 4.6.x",
"author": "OpenStack",
"license": "Apache-2.0",
"keywords": [
"kibana",
@ -29,7 +29,7 @@
},
"repository": {
"type": "git",
"url": "http://github.com/FujitsuEnablingSoftwareTechnologyGmbH/fts-keystone.git"
"url": "https://github.com/openstack/monasca-kibana-plugin.git"
},
"devDependencies": {
"babel-eslint": "^4.1.8",

View File

@ -16,7 +16,7 @@ const sinon = require('sinon');
const chai = require('chai');
const proxyRequire = require('proxyquire');
describe('fts-keystone', () => {
describe('monasca-kibana-plugin', () => {
describe('binding', () => {
it('should expose tokens & users', () => {

View File

@ -16,7 +16,7 @@
const chai = require('chai');
const sinon = require('sinon');
describe('plugins/fts-keystone', () => {
describe('plugins/monasca-kibana-plugin', () => {
const indexName = '.kibana-testdefaultindex';
let server;
let userObj;
@ -26,7 +26,7 @@ describe('plugins/fts-keystone', () => {
beforeEach(function () {
configGet = sinon.stub();
configGet.withArgs('pkg.version').returns('4.4.0');
configGet.withArgs('fts-keystone.defaultTimeField').returns('@timestamp');
configGet.withArgs('monasca-kibana-plugin.defaultTimeField').returns('@timestamp');
server = {
log : sinon.stub(),

View File

@ -16,7 +16,7 @@ const sinon = require('sinon');
const chai = require('chai');
const proxyRequire = require('proxyquire');
describe('plugins/fts-keystone', ()=> {
describe('plugins/monasca-kibana-plugin', ()=> {
describe('healthcheck', ()=> {
const keystoneUrl = 'http://localhost'; // mocking http
@ -38,7 +38,7 @@ describe('plugins/fts-keystone', ()=> {
beforeEach(function () {
plugin = {
name : 'fts-keystone',
name : 'monasca-kibana-plugin',
status: {
red : sinon.stub(),
green : sinon.stub(),
@ -47,8 +47,8 @@ describe('plugins/fts-keystone', ()=> {
};
configGet = sinon.stub();
configGet.withArgs('fts-keystone.url').returns(keystoneUrl);
configGet.withArgs('fts-keystone.port').returns(keystonePort);
configGet.withArgs('monasca-kibana-plugin.url').returns(keystoneUrl);
configGet.withArgs('monasca-kibana-plugin.port').returns(keystonePort);
server = {
log : sinon.stub(),

View File

@ -19,7 +19,7 @@ const retrieveToken = require('../mt/auth/token');
const CONSTANTS = require('../const');
const RELOAD_SYMBOL = require('../mt/auth/reload');
describe('plugins/fts-keystone', ()=> {
describe('plugins/monasca-kibana-plugin', ()=> {
describe('mt', ()=> {
describe('auth', () => {
describe('token', ()=> {
@ -28,7 +28,7 @@ describe('plugins/fts-keystone', ()=> {
beforeEach(()=> {
let configGet = sinon.stub();
configGet.withArgs('fts-keystone.cookie.name').returns('keystone');
configGet.withArgs('monasca-kibana-plugin.cookie.name').returns('keystone');
server = {
log: sinon.stub(),
config: function () {

View File

@ -16,7 +16,7 @@ const sinon = require('sinon');
const chai = require('chai');
const proxyRequire = require('proxyquire');
describe('plugins/fts-keystone', () => {
describe('plugins/monasca-kibana-plugin', () => {
describe('mt', () => {
describe('routing', () => {
describe('createProxy', () => {

View File

@ -16,7 +16,7 @@ const sinon = require('sinon');
const chai = require('chai');
const proxyRequire = require('proxyquire');
describe('plugins/fts-keystone', () => {
describe('plugins/monasca-kibana-plugin', () => {
describe('mt', () => {
describe('routing', () => {
describe('reRoute', () => {

View File

@ -16,7 +16,7 @@ const sinon = require('sinon');
const chai = require('chai');
const proxyRequire = require('proxyquire');
describe('plugins/fts-keystone', ()=> {
describe('plugins/monasca-kibana-plugin', ()=> {
describe('mt', ()=> {
describe('routing', () => {

View File

@ -15,7 +15,7 @@
const chai = require('chai');
const util = require('../util');
describe('plugins/fts-keystone', ()=> {
describe('plugins/monasca-kibana-plugin', ()=> {
describe('util', ()=> {
const CHECK_STR = 'test.str';

View File

@ -18,7 +18,7 @@ const proxyRequire = require('proxyquire');
const CONSTANTS = require('../const');
describe('plugins/fts-keystone', ()=> {
describe('plugins/monasca-kibana-plugin', ()=> {
describe('mt', ()=> {
describe('verify', () => {

View File

@ -18,7 +18,7 @@ const chai = require('chai');
const CONSTANTS = require('../const');
const verifyIndexPattern = require('../mt/verify/_verify_index_pattern');
describe('plugins/fts-keystone', ()=> {
describe('plugins/monasca-kibana-plugin', ()=> {
describe('mt', ()=> {
describe('verify', () => {
describe('verify_index_pattern', () => {

View File

@ -18,7 +18,7 @@ import UsersApi from 'keystone-v3-client/lib/keystone/users';
module.exports = function binding(server) {
const config = server.config();
const keystoneCfg = {
url: `${config.get('fts-keystone.url')}:${config.get('fts-keystone.port')}`
url: `${config.get('monasca-kibana-plugin.url')}:${config.get('monasca-kibana-plugin.port')}`
};
return {

View File

@ -14,10 +14,10 @@
const NOW_TIME = (new Date().valueOf() / 1000);
export const SESSION_USER_KEY = `fts-keystone-user-${NOW_TIME}`;
export const SESSION_TOKEN_KEY = `fts-keystone-token-${NOW_TIME}`;
export const SESSION_PROJECTS_KEY = `fts-keystone-projects-${NOW_TIME}`;
export const SESSION_TOKEN_CHANGED = `fts-keystone-token-changed-${NOW_TIME}`;
export const SESSION_USER_KEY = `monasca-kibana-plugin-user-${NOW_TIME}`;
export const SESSION_TOKEN_KEY = `monasca-kibana-plugin-token-${NOW_TIME}`;
export const SESSION_PROJECTS_KEY = `monasca-kibana-plugin-projects-${NOW_TIME}`;
export const SESSION_TOKEN_CHANGED = `monasca-kibana-plugin-token-changed-${NOW_TIME}`;
export const TOKEN_CHANGED_VALUE = Symbol('token-changed');

View File

@ -19,8 +19,8 @@ import util from '../util';
module.exports = function healthcheck(plugin, server) {
const config = server.config();
const keystoneUrl = config.get('fts-keystone.url');
const keystonePort = config.get('fts-keystone.port');
const keystoneUrl = config.get('monasca-kibana-plugin.url');
const keystonePort = config.get('monasca-kibana-plugin.port');
const request = getRequest();
let timeoutId;

View File

@ -29,7 +29,7 @@ const SCHEMA = {
export default (server, opts) => {
Joi.assert(opts, SCHEMA, 'Invalid keystone auth options');
const tokensApi = server.plugins['fts-keystone'].tokens;
const tokensApi = server.plugins['monasca-kibana-plugin'].tokens;
const callbackOk = opts.tokenOk;
const callbackBad = opts.tokenBad;

View File

@ -46,7 +46,7 @@ module.exports = (server, request) => {
// this is a workaround for problem with 'default' session:
// when there is no session cookie present, then yar uses default session,
// as a result many clients use the same session - security risk!
const cookieName = server.config().get('fts-keystone.cookie.name');
const cookieName = server.config().get('monasca-kibana-plugin.cookie.name');
if (!request.state[cookieName]) {
request.yar.reset();
}

View File

@ -25,7 +25,7 @@ export default (server, indexName, userObj) => {
type : 'index-pattern',
body : {
title: pattern,
timeFieldName : server.config().get('fts-keystone.defaultTimeField')
timeFieldName : server.config().get('monasca-kibana-plugin.defaultTimeField')
},
id : pattern
})

View File

@ -19,7 +19,7 @@ import { SESSION_PROJECTS_KEY, SESSION_TOKEN_KEY } from '../../const';
export default (server, session, userObj) => {
const usersApi = server.plugins['fts-keystone'].users;
const usersApi = server.plugins['monasca-kibana-plugin'].users;
return new Promise((resolve) => {
return usersApi

View File

@ -23,15 +23,15 @@ export default (server) => {
register: yarCookie,
options : {
maxCookieSize: 4096,
name : config.get('fts-keystone.cookie.name'),
name : config.get('monasca-kibana-plugin.cookie.name'),
storeBlank : false,
cache : {
expiresIn: config.get('fts-keystone.cookie.expiresIn')
expiresIn: config.get('monasca-kibana-plugin.cookie.expiresIn')
},
cookieOptions: {
password : config.get('fts-keystone.cookie.password'),
isSecure : config.get('fts-keystone.cookie.isSecure'),
ignoreErrors: config.get('fts-keystone.cookie.ignoreErrors'),
password : config.get('monasca-kibana-plugin.cookie.password'),
isSecure : config.get('monasca-kibana-plugin.cookie.isSecure'),
ignoreErrors: config.get('monasca-kibana-plugin.cookie.ignoreErrors'),
clearInvalid: false
}
}