Code Monkey home page Code Monkey logo

py-fortress-sample's Introduction

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.

py-fortress-sample's People

Contributors

shawnmckinney avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.