Python CSC Electronic Office
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Max Erenberg d82b5a763b use ldap3 instead of python-ldap 2 years ago
ceo add base classes for users and groups 2 years ago
ceo_common use ldap3 instead of python-ldap 2 years ago
ceod use ldap3 instead of python-ldap 2 years ago
tests use ldap3 instead of python-ldap 2 years ago
.gitignore add MailService and MailmanService 2 years ago
README.md add PATCH /api/members/:username endpoint 2 years ago
clear_cache.sh move all tests to top-level folder 2 years ago
dev-requirements.txt move all tests to top-level folder 2 years ago
requirements.txt use ldap3 instead of python-ldap 2 years ago
setup.cfg add tests for Group class 2 years ago

README.md

pyceo

work in progress

Development

First, make sure that you have installed the syscom dev environment. This will setup all of the services needed for ceo to work. You should clone this repo in one of the dev environment containers.

Next, install and activate a virtualenv:

python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
pip install -r dev-requirements.txt

Running the application

ceod is essentially a distributed application, with instances on different hosts offering different services. For example, the ceod instance on mail offers a service to subscribe people to mailing lists, and the ceod instance on phosphoric-acid offers a service to create new members. Therefore, you will need to run ceod on multiple hosts. Currently, those are phosphoric-acid, mail and caffeine (in the dev environment, caffeine is replaced by coffee).

To run ceod on a single host:

export FLASK_APP=ceod.api
export FLASK_ENV=development
flask run -h 0.0.0.0 -p 9987

Sometimes changes you make in the source code don't show up while Flask is running. Stop the flask app (Ctrl-C), run clear_cache.sh, then restart the app.

Interacting with the application

The client part of ceo hasn't been written yet, so we'll use curl to interact with ceod for now.

ceod uses SPNEGO for authentication, and TLS for confidentiality and integrity. In development mode, TLS can be disabled. First, make sure that your version of curl has been compiled with SPNEGO support:

curl -V

Your should see 'SPNEGO' in the 'Features' section.

Here's an example of using curl with SPNEGO:

# Get a Kerberos TGT first
kinit
curl --negotiate -u : --service-name ceod -X POST http://mail:9987/api/mailman/csc-general/ctdalek