- Document Overview
- SECTION 1. Prerequisites
- SECTION 2. Setup Test Env
- SECTION 3. Using Command Line Interpreter (CLI)
Instructions to install py-fortress and do some basic testing.
Minimum hardware requirements:
- 1 Core
- 1 GB RAM
Prerequisites:
- LDAP server configured for Apache Fortress using README-LDAP-DOCKER
- python-ldap dependencies installed README-UPGRADE-PYTHON
Follow these steps to install py-fortress package and get it pointing to your LDAP server.
- Make a test folder:
mkdir test
cd test
- Prepare your terminal for execution of python3. From the main dir of the git repo:
python3 -m venv env
. env/bin/activate
export PYTHONPATH=$(pwd)
- Install py-fortress
pip install py-fortress
- Download and edit py-fortress-cfg.json config file to test folder:
cp ./env/conf/py-fortress-cfg.json.sample py-fortress-cfg.json
vi py-fortress-cfg.json
Where PATH equals one of the following:
a. current directory
b. user home directory
c. /etc/pyfortress
d. pointed to by: export PYFORTRESS_CONF=...
- Set the LDAP Port
...
"ldap": {
...
"uri": "ldap://localhost",
...
*use value obtained during LDAP setup*
- Update the connection parameters (pick one):
a. apacheds:
"dn": "uid=admin,ou=system",
b. openldap:
"dn": "dc=example,dc=com",
- Set the structure in DIT:
...
"dit": {
"suffix": "dc=example,dc=com",
"users": "People",
"roles": "Roles",
"perms": "Perms"
},
...
if in doubt use the defaults
-
Save and exit config file.
-
Run the bootstrap pgm that creates the LDAP node structure, i.e. the DIT
initldap
initldap is a python script, created during install of py-fortress package, that maps here: pyfortress.tests.test_dit_dao Locations for these nodes are set in the config file.
View the test data.
-
user search
$ cli user search --uid p
-
role search
$ cli role search --name p
-
perm search
$ cli perm search --obj_name p
-
More CLI commands
- README-CLI and README-CLI-AUTH for more operations to test.