A FastAPI application leveraged by pygeoapi
This diagram gives an overview of the basic architecture:
- Provide authentication and authorization for vanilla pygeoapi
- pygeoapi
- fastapi-opa
- An OpenID Connect provider (Keycloak, WSO2, etc)
- Open Policy Agent (OPA)
You can install fastgeoapi via pip from PyPI:
pip install fastgeoapi
After cloning the repository, you should use poetry
to create the virtual environment and install the dependencies:
poetry shell
poetry install
Once Keycloak and OPA have been started then you have to configure the required variables for the pygeoapi configuration:
export PYGEOAPI_CONFIG=example-config.yml
export PYGEOAPI_OPENAPI=example-openapi.yml
Finally, you can start fastgeoapi in development mode:
uvicorn app.main:app --port 5000 --loop asyncio --reload
Please see the Command-line Reference for details.
Please have a look at the docker-compose.yml
file under scripts/iam
to start the stack with Keycloak and Open Policy Agent locally. There is a README.md
file that explains how to use it.
The file scripts/iam/keycloak/realm-export.json
can be used to import an already configured realm into Keycloak.
The files under scripts/postman
can be used to setup Postman with a configuration that is ready to perform the requests for the whole stack.
Contributions are very welcome. To learn more, see the Contributor Guide.
Distributed under the terms of the MIT license, fastgeoapi is free and open-source software.
If you encounter any problems, please file an issue along with a detailed description.
This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.