Ollama
e45af91e2e
feat: Add REST API implementation with API key authentication
Implement comprehensive REST API for OSPOS with the following:
Database:
- Migration for ospos_api_keys table
- Seeder for module permissions
Models:
- ApiKey model with key generation, validation, revocation
- SHA-256 hashing for secure key storage
- Support for key expiration
Filters:
- ApiAuth filter for X-API-Key header authentication
- CSRF exemption for API routes
Controllers:
- Api/BaseController with response helpers and field transformation
- Api/Customers (CRUD + batch delete, suggestions)
- Api/Suppliers (CRUD + batch delete, suggestions)
- Api/Items (CRUD + batch delete, quantities endpoint)
- Api/Inventory (adjustments with set/adjust modes, bulk support)
- ApiKeys (UI controller for key management)
Routes:
- /api/v1/* endpoints with apiauth filter
- /office/api-keys/* endpoints for key management UI
Tests:
- ApiKeyTest for model functionality
- ApiAuthTest for authentication filter
Features:
- camelCase JSON field names (API standard)
- Offset/limit pagination
- Soft delete support
- Permission-based authorization
- Key prefix for UI identification
- Last used timestamp tracking
Refs: #2463, #615, #3789, #3809, #1680, #876, #1959, #157
2026-03-06 14:35:27 +00:00
..
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-06 14:35:27 +00:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2025-05-02 19:37:06 +02:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2026-03-04 22:06:17 +01:00
2024-06-15 17:19:15 +02:00
2025-05-02 19:37:06 +02:00
2025-05-02 19:37:06 +02:00