Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF 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.
This document describes Apache Fortress multitenacy.
From Wikipedia:
Commentators regard multitenancy as an important feature of cloud computing.
https://en.wikipedia.org/wiki/Multitenancy
More here:
ou=acme123, dc=example, dc=com.
ou=People, ou=acme123, dc=example, dc=com ou=Roles, ou=acme123, dc=example, dc=com ou=Perms, ou=acme123, dc=example, dc=com ou=Groups, ou=acme123, dc=example, dc=com ...
The tenant id is passed during object instantiation.
AdminMgr adminMgr = AdminMgrFactory.createInstance( "acme123" );
The lifecycle of that particular object will be on behalf of that tenant id.
... <addcontainer> <container name="acme123" description="ACME 123 tenant context"/> </addcontainer> ...
dn: ou=acme123, dc=example,dc=com ou: acme123 objectClass: organizationalUnit description: ACME 123 tenant context
... <addcontainer> <container name="People" description="Fortress People"/> <container name="Policies" description="Fortress Policies"/> <container name="RBAC" description="Fortress RBAC Policies"/> <container name="Roles" parent="RBAC" description="Fortress Roles"/> <container name="Permissions" parent="RBAC" description="Fortress Permissions"/> <container name="Constraints" parent="RBAC" description="Fortress Separation of Duty Constraints"/> <container name="ARBAC" description="Fortress Administrative RBAC Policies"/> <container name="OS-U" parent="ARBAC" description="Fortress User Organizational Units"/> <container name="OS-P" parent="ARBAC" description="Fortress Perm Organizational Units"/> <container name="AdminRoles" parent="ARBAC" description="Fortress AdminRoles"/> <container name="AdminPerms" parent="ARBAC" description="Fortress Admin Permissions"/> </addcontainer> ...
mvn install -Dload.file=./ldap/setup/MyLoadFile.xml -Dtenant=acme123
Passing the tenant system property scopes all subsequent load operations to that particular tenant's container inside the DIT.
Pass the tenant id as system property when running the tests:
mvn test -Dtest=FortressJUnitTest -Dtenant=acme123
Passing tenant system properties scopes all subsequent test operations to that particular tenant.
Other tools like Fortress console and CLI may be run pointing to a tenant's data.
mvn -Pconsole test -Dtenant=acme123
mvn -Pcli test -Dtenant=acme123