Skip to content

shawnmckinney/py-fortress-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-fortress-sample README

This installs py-fortress and runs a simple test program of how the RBAC API works._


Prerequisites

Minimum hardware requirements:

  • 1 Core
  • 1 GB RAM

Minimum software requirements:


Clone py-fortress-sample, prepare for usage

  1. Clone py-fortress-sample

    git clone https://github.com/shawnmckinney/py-fortress-sample.git
    
  2. Change folder into the project:

    cd py-fortress-sample
    

    you should now be here: py-fortress-sample

  3. Prepare the config:

From the project root folder, copy sample cfg file:

cp py-fortress-cfg.json.sample py-fortress-cfg.json

sample cfg file is here: py-fortress-cfg.json.sample

  1. Now edit config file:
vi py-fortress-cfg.json
  1. Set the LDAP URI
...
"ldap": {
...
"uri": "ldap://localhost",
...
  • use value obtained during LDAP setup
  • if in doubt use the defaults
  1. Save and exit

Setup Python Runtime and Install py-fortress

  1. Prepare your terminal for execution of python3. From the main dir of the git repo:
python3 -m venv env
. env/bin/activate

from the py-fortress-sample folder

  1. Install py-fortress:
pip3 install py-fortress
  1. Change folder to where the sample program is:
cd sample/ldap

you're now here: py-fortress-sample/sample/ldap

  1. Prepare the Directory Information Tree:

You can think of this command as creating tables in a new database instance.

initldap

initldap is a python script, created during install of py-fortress package, that maps here: pyfortress.test.test_dit_dao

  1. Examine the output, should finish almost instaneously (< 1 sec).

    initldap
    Initialize py-fortress ldap...
    INFO ldap host: localhost, port:389
    test_bootstrap
    test_bootstrap success
    .
    ----------------------------------------------------------------------
    Ran 1 test in 0.004s
    
  2. Run the test program:

    python3 test_samples.py 
    
  3. View the output:

    ----------------------------------------------------------------------
    Ran 28 tests in 0.024s
    OK
    
  4. Study the APIs in test_samples.py module.

Releases

No releases published

Packages

No packages published

Languages