Meinewaldki Citizen Rest Service
Installation for Kubernetes
You need to have helm and kubectl installed.
Your kubeconfig should be set to the correct cluster (meinewaldki).
kubectl config current-context
Navigate to the configuration directory:
cd config
Keycloak
For keycloak you need to run the following command:
helm install test-keycloak keycloak --namespace citizen-scientist-app
The configurations are in the keycloak/values.yaml file.
Base configuration your endpoint will be https://meinewaldki.anhalt.ai/dev-auth.
To uninstall keycloak run the following command:
helm uninstall test-keycloak --namespace citizen-scientist-app
Settings
Log into keycloak with the following credentials:
Username: admin-dev
Password: PLS_CHG_ME
Add a new realm for guest users.
In the new realm create a new client with the ClientID MeineWaldKIApp.
Enable OAuth 2.0 Device Authorization Grant.
After creating the client change the following settings:
Origin: * (should be more restrictive in production, but did not check if this works with a more restrictive setting)
Valid Redirect URIs: * (should be more restrictive in production, but did not check if this works with a more restrictive setting)
Add the role guest to the client roles.
Go to Realm Settings. Set SSO Session Idle very high and SSO Session also very high (Sessions).
Set Access Token Lifespan to a very high value (Tokens).
Remove the first name and last name from the required user attributes (User profile).
Installation Rest Service
I will add the automatic deployment through CI/CD later.
The deployment helm is mostly written but the Docker image is not yet in a registry.
Run locally
After Installing keycloak and creating your realms and changing the admin password and or admin user you can run the service locally.
Add the following environment variables to your .env file:
KEYCLOAK_SERVER_URL=https://meinewaldki.anhalt.ai/dev-auth/ (if not changed)
ADMIN_USERNAME=admin_dev (if not changed)
ADMIN_PASSWORD=PLS_CHG_ME (if not changed)
ADMIN_REALM_NAME=master (if not changed)
GUEST_USER_REALM_NAME=YourRealm (I set it to guest-users)
Mark the src directory as source root in your IDE.
Run the main.py file with the working directory set to the root directory of the project.
Endpoints
I did not setup an endpoint for cookies. This should make it easier to test the endpoints.
http://127.0.0.1:5001/citizen-api/guest-user/create -> Create a new guest user http://127.0.0.1:5001/citizen-api/guest-user/check -> Check if Token is valid (Post request) http://127.0.0.1:5001/citizen-api/docs -> Swagger UI (Easy to test the endpoints)
Metadata
Release files for basic-python-project 0.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| basic_python_project-0.0.0.tar.gz | 13.7 kB | Without provenance | Details for basic_python_project-0.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| basic_python_project-0.0.0-py3-none-any.whl | Python 3 | none | any | Details for basic_python_project-0.0.0-py3-none-any.whl |
Total release size: 33.8 kB
Release files / basic_python_project-0.0.0.tar.gz
| Download URL | basic_python_project-0.0.0.tar.gz |
|---|---|
| Size | 13.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
91e7815efb582359ab5e63eb6fa2b0b534d9b5773f40608f1544dcde23a461d8
|
|
BLAKE2b-256 checksum How to use checksums |
50e8b06d497b9092f57645f2e2e4df8dbb802cc868e658bed446d370a5481501
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / basic_python_project-0.0.0-py3-none-any.whl
| Download URL | basic_python_project-0.0.0-py3-none-any.whl |
|---|---|
| Size | 20.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6c695ae16609d038506f91dd670734e680322a639250b55fd85a929c7eb8ce1e
|
|
BLAKE2b-256 checksum How to use checksums |
458e27173b5c91fd97037912887e87e33f67c8af83d41f64770478f946233b7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for basic-python-project 0.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.