Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Amsterdam/authz_admin

Repository files navigation

Datapunt OAuth2 Services

image

image

The latest published documentation for this project can be found here.

Publish the documentation somewhere (ReadTheDocs?) and insert a link in the sentence above.

Conventions

  • The project top-level directory is also the source root.
  • We use PyTest for tests.
  • PyTest can be integrated with SetupTools (see https://docs.pytest.org/en/latest/goodpractices.html). We don’t do this.
  • Common commands for builds, distributing, packaging, documentation etcetera are in Makefile and docs/Makefile.
  • RST-files and -docstrings are indented with 4 spaces.
  • Globals must be immutable.
  • Docstrings are formatted like this:

    """This is a one-line docstring."""
    """One line description, terminated with a period.
    
    More info, with a trailing empty line.
    
    """

Getting Started

# Clone the repository:
git clone git@github.com:Amsterdam/authz_admin.git
cd authz_admin

# Create and activate a virtual environment, for example with:
python3.6 -m venv --copies --prompt authz_admin .venv
source ./.venv/bin/activate

pip install -e .[docs,test,dev]

# Start a database server (required for all sub-services):
docker-compose up -d database

# To test the service:
source env.sh && make test

# To start the service:
source env.sh && make run

# To start a documentation server:
make -C docs server

After starting the server, the API can be accessed through http://localhost:8000/authz_admin/\. The Swagger UI front-end is available at http://localhost:8000/authz_admin/swagger-ui/index.html\.

Starting the service

The service can be started in at least 2 ways:

  1. Directly, like this:

    PYTHONPATH=${PROJECT_HOME:-.}/src python -m authz_admin.main
  2. Through setuptools console script. This is functionally identical to the previous method, and only provided as a shortcut:

    authz_admin

Database Schema Management

We use alembic <http://alembic.zzzcomputing.com/en/latest/index.html> for database schema management. The configuration can be found in the alembic subdirectory.

About Scopes

write about the semantics of scopes in our implementation.