backend-server-v2/docs/secutity architecture.md

3.1 KiB

                      ┌─────────────────────────────┐
                      │           Browser           │
                      │  HTML + HTMX + UI Kit       │
                      └──────────────┬──────────────┘
                                     │
                             HTTPS (TLS)
                                     │
                      ┌──────────────▼──────────────┐
                      │        GoFiber App          │
                      ├─────────────────────────────┤
                      │  CORS Middleware            │
                      │  Session Middleware         │
                      │  CSRF (optional)            │
                      │  Rate Limiter (Auth)        │
                      └──────────────┬──────────────┘
                                     │
                 ┌───────────────────▼───────────────────┐
                 │        Auth & Authorization            │
                 │  - RequireAuth                        │
                 │  - RequireAdmin                       │
                 │  - Role validation                    │
                 └───────────────────┬───────────────────┘
                                     │
                 ┌───────────────────▼───────────────────┐
                 │        Business Layer (Services)      │
                 └───────────────────┬───────────────────┘
                                     │
                 ┌───────────────────▼───────────────────┐
                 │        Repository Layer (GORM)        │
                 └───────────────────┬───────────────────┘
                                     │
                 ┌───────────────────▼───────────────────┐
                 │              Database                 │
                 │ - Users (bcrypt passwords)            │
                 │ - Token hashes (SHA-256)              │
                 │ - AuditLog                            │
                 └───────────────────────────────────────┘