server: first pass at implementing RBAC

Design document can be found on the wiki:

  https://github.com/killbill/killbill/wiki/Role-Based-Access-Control-(RBAC)

This first patch separates Multi-Tenancy from RBAC: moving forward, the Shiro filter
(and shiro.ini) will only be used for pure RBAC, regardless of Multi-Tenancy (we still
use internally various cryptography bits from Shiro for multi-tenancy authentication).

The main change in the server tests is that Multi-Tenancy is now enabled (the suite runs in its
own tenant). Since all calls go through the authentication flow, tests are a bit slower: between 300ms
to 500ms per call, resulting in a suite running a few minutes longer. On the upside, this found a
few bugs around Multi-Tenancy handling.

Among changes:

* fix a bug in DefaultAccountUserApi where the tenant_record_id wasn't populated on creation
* fix a bug in invoice and payment where the tenantId would be lost
* introduce X-Killbill-ApiKey and X-Killbill-ApiSecret headers for Multi-Tenancy authentication
* turn Multi-Tenancy on by default
* enable TestTenantFilter (no dependency on shiro.ini anymore)
* server tests timeouts have been increased (to work around slowness when priming Shiro)
* .idea: add misc. words to the dictionary

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Update README.md
server: disabled RBAC in the default shiro.ini

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Merge branch 'rbac' of github.com:killbill/killbill into rbac
overdue: update to latest API version

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
util: first pass at RBAC proper

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
jaxrs: add endpoint to retrieve RBAC permissions

This commit also enforces RBAC in the server tests. All calls are now made as
an admin user (who has all permissions).

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
.idea: update codeStyleSettings.xml

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
security: add persistent sessions support

Store sessions in a table for the multi-nodes scenario.

This patch also enables EhCache caching for Shiro and
refactors the Shiro Guice setup.

The shiro.ini file is only used for users and roles now,
the main section is now handled in the Guice module.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
tenant: make number of hash iterations configurable

This is mainly to speed up server tests (the whole suite was taking about 50 minutes).

This also lowers the default to 200,000 down from 500,000.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
server: move shiro.ini with other resources

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
util: add KillBillJndiLdapRealm

Alternative to the shiro.ini file (users and roles are stored in LDAP).

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
util: add dummy shiro.ini to cleanup logs

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
util: add missing copyright header in shiro.ini

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
osgi-bundles: remove analytics from default bundles

This gets rid of a cyclic dependency in the release process.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pom.xml: update to killbill-oss-parent 0.3.11

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Merge remote-tracking branch 'origin/master' into rbac
server: remove Shiro listener class

The wiring is done via Guice, this listener class is not needed anymore.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
security: fix Shiro wiring

Disable AOP when RBAC is disabled.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
server: setup default credentials for RBAC

Username: admin
Password: password

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>