Commit Graph

20 Commits

Author SHA1 Message Date
Agent Zero 6ed0752536 fix: health check worker uses zcard instead of llen for arq sorted set queue 2026-07-19 02:25:42 +02:00
Agent Zero ad41771b10 feat: implement sliding session - extend TTL on each authenticated request 2026-07-18 18:48:21 +02:00
Agent Zero 467f73113c test: 102 comprehensive RBAC tests + fix: filter soft-deleted groups in permission resolver 2026-07-16 01:58:22 +02:00
Agent Zero beaca24480 feat: phase 3 - field-level permissions with plugin field definitions, service-layer filtering, 20 core field definitions 2026-07-15 23:02:30 +02:00
Agent Zero 08fd3ab72c feat: phase 2 - migrate all route guards to require_permission (75 guards, 21 files) 2026-07-15 22:35:50 +02:00
Agent Zero b490a62322 feat: granular RBAC system with user groups, deny-list, permission registry, system-admin, self-mod prevention 2026-07-15 21:59:45 +02:00
Agent Zero b0e987f790 feat: notification preferences system with plugin registry
- Add NotificationType and NotificationPreference models
- Add get_notification_types() to BasePlugin for plugin registration
- Add sync_notification_types() to PluginRegistry
- Update create_notification() to check user preferences (returns Notification|None)
- Add API endpoints: GET /types, GET /preferences, PATCH /preferences/{type_key}
- Add NotificationPreferenceUpdate schema
- Mail plugin registers 10 notification types with metadata
- Add Alembic migration 0017 for new tables + seed data
- Frontend: SettingsNotifications page with toggle switches
- Frontend: Settings tab, route, hooks for notification preferences
- i18n: notification settings keys (de/en)
2026-07-15 21:00:32 +02:00
Leopoldadmin fe2882689b C1: Add seeds.py — EUR currency, 19% and 7% tax rates, idempotent 2026-07-04 01:30:06 +00:00
Leopoldadmin 9009135c74 B3: CSRF middleware — add X-CSRF-Token validation via Redis session lookup 2026-07-04 01:23:41 +00:00
Leopoldadmin 02d5195c1c feat(core): add SoftDeleteMixin to db base, TenantMixin inherits from it 2026-07-04 00:31:44 +00:00
leocrm-bot 69e91fd5d0 T10: Monitoring, Performance, Documentation & Environment Config — 38 tests, ruff clean, docs OK
- Extended health endpoint: DB+Redis+Storage+Worker checks with degraded status
- Prometheus metrics endpoint: admin-only, text/plain format
- Metrics: http_requests_total, db_pool_connections, arq_jobs_total
- Structured JSON logging (structlog): timestamp, level, method, path, status, duration_ms, tenant_id
- Performance: page_size max 100 enforced (422), streaming CSV export (StreamingResponse)
- Scripts: seed_perf_data.py, check_indexes.py
- Docs: admin-guide.md (Deploy, Backup, Restore, Env-Vars, Troubleshooting), api-overview.md
- README updated: prod setup, API section, env profiles, admin-guide link
- .env.example: added SECRET_KEY, STORAGE_PATH, SMTP_* vars
- 38 new tests, full regression 564/564 pass (0 failures)
- Ruff: all checks passed
2026-07-01 23:15:35 +02:00
leocrm-bot a2452cc04b chore: fix all ruff lint errors + format — 0 errors, 306 tests pass 2026-06-29 17:43:56 +02:00
leocrm-bot 851e7999ba T09: KI-Copilot API + Hybrid Workflow Engine + LLM client + event-triggered workflows
- KI-Copilot: NL query → proposed actions, execute with RBAC, history, audit logging
- LLM client: mock mode (no API key) + OpenAI-compatible mode (AI_MODEL/AI_API_KEY)
- Action mapper: NL intent → API calls (create/update/delete/search company/contact)
- Workflow engine: step types (action/approval/notification/condition), JSONB steps
- Workflow lifecycle: pending → in_progress → completed/rejected/cancelled
- Event-triggered workflows: event bus → auto-start instances
- Code-engine workflows: onboarding on user.created event
- Approval timeout: auto-reject after configured hours
- 5 new tenant-scoped tables with RLS: ai_conversations, ai_messages, workflows, workflow_instances, workflow_step_history
- Migration 0004: all tables + RLS policies + tenant_id + indexes
- 238 tests pass (30 AC + 105 coverage + 103 existing), 84.12% T09 module coverage
- MissingGreenlet fix: safe accessor helpers for async ORM attribute access
2026-06-29 08:02:15 +02:00
leocrm-bot 3ab4925783 T01: core infrastructure + auth + multi-tenant + RLS
- 10 models: tenants, users, user_tenants, roles, sessions, audit_log, deletion_log, notifications, password_reset_tokens, api_tokens
- Session-based auth (Redis + PostgreSQL audit trail)
- Multi-tenant with ORM-level filtering + PostgreSQL RLS (set_config)
- RBAC with roles/permissions + field-level permissions
- CSRF protection via Origin header validation
- Auth rate limiting (Redis counters with TTL)
- CORS with explicit origins (no wildcard)
- Health endpoint (no auth required)
- Notification service + audit log middleware
- 29 tests, 26 ACs, all passing
- Coverage: 62% (infrastructure modules pending coverage in later tasks)
2026-06-29 08:02:14 +02:00
Agent Zero b5f7a220fe chore(quality): apply ruff autofixes and formatting (223 fixes, regression-free: 118/118 tests pass) 2026-06-29 08:01:45 +02:00
Leopoldadmin b44b1f3fe3 Upload app/core/security.py 2026-06-29 08:01:45 +02:00
Leopoldadmin f73c340757 Upload app/core/deps.py 2026-06-29 08:01:45 +02:00
Leopoldadmin 58885740b7 Upload app/core/db.py 2026-06-29 08:01:45 +02:00
Leopoldadmin 49631b50b8 Upload app/core/config.py 2026-06-29 08:01:45 +02:00
Leopoldadmin 8a574252af Upload app/core/__init__.py 2026-06-29 08:01:45 +02:00