Files
2026-06-17 19:04:39 +02:00

67 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OIDC Showcase – Flask + Zitadel RBAC
Proof-of-Concept-Webapplikation zur Demonstration von feingranularem, dynamischem
Role-Based Access Control (RBAC) und Multi-Tenancy mit **Zitadel** als externem
Identity Provider (IdP) über OIDC.
**Ziel:** Authentifizierung vollständig an Zitadel delegieren. Autorisierung,
Projektzuweisung und Datentrennung lokal über SQLite verwalten.
---
## Technologie-Stack
| Komponente | Technologie |
|---|---|
| Backend | Python Flask 2.x |
| OIDC-Client | Authlib |
| Datenbank | SQLite via SQLAlchemy |
| IdP | Zitadel (https://id.vmlx.de) |
| Produktion | Docker / gunicorn |
## Rollen
| Rolle | Zugriff |
|---|---|
| `Admin` | Vollzugriff auf alle Clients, Projekte und Nutzer |
| `Mitarbeiter` | Nur zugewiesene Projekte (N:M-Tabelle lokal) |
| `Kunde` | Nur zugewiesene Projekte des eigenen Clients |
---
## Lokale Entwicklung
```bash
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # Zitadel-Credentials eintragen (siehe ZITADEL-SETUP.md)
flask seed-db # Schema initialisieren + Testdaten einspielen
flask run # App startet auf http://localhost:5000
```
## Docker / Produktion
```bash
docker compose up --build
# App erreichbar auf http://localhost:8000
```
Ein Basis-Image-Update löst durch `pull_policy: always` automatisch einen Rebuild aus.
---
## Zitadel einrichten
Anleitung zum Anlegen von Testnutzern, Rollen und OIDC-Credentials:
→ **[ZITADEL-SETUP.md](ZITADEL-SETUP.md)**
## Dokumentation generieren
```bash
pip install sphinx
sphinx-apidoc -o docs/source/ app/
cd docs && make html
# Doku unter docs/_build/html/index.html
```