mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-29 10:47:53 -04:00
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
29 lines
1.3 KiB
PHP
29 lines
1.3 KiB
PHP
<?php
|
|
|
|
return [
|
|
'module_api_keys' => 'API Keys',
|
|
'module_desc_api_keys' => 'Manage API access keys for integrations.',
|
|
'api_keys' => 'API Keys',
|
|
'api_key' => 'API Key',
|
|
'generate_key' => 'Generate API Key',
|
|
'regenerate_key' => 'Regenerate',
|
|
'revoke_key' => 'Revoke',
|
|
'key_name' => 'Key Name',
|
|
'key_prefix' => 'Key Prefix',
|
|
'last_used' => 'Last Used',
|
|
'created' => 'Created',
|
|
'expires' => 'Expires',
|
|
'never' => 'Never',
|
|
'disabled' => 'Disabled',
|
|
'key_generated' => 'API key generated successfully',
|
|
'key_generation_failed' => 'Failed to generate API key',
|
|
'key_revoked' => 'API key revoked successfully',
|
|
'key_revoke_failed' => 'Failed to revoke API key',
|
|
'key_regenerated' => 'API key regenerated successfully',
|
|
'key_regeneration_failed' => 'Failed to regenerate API key',
|
|
'copy_warning' => 'Copy this key now! It will not be shown again.',
|
|
'no_keys' => 'No API keys have been generated yet.',
|
|
'confirm_revoke' => 'Are you sure you want to revoke this API key? This action cannot be undone.',
|
|
'confirm_regenerate' => 'Are you sure you want to regenerate this API key? The old key will immediately stop working.',
|
|
'key_description' => 'API keys allow external applications to access your OSPOS data. Keep your keys secure and never share them publicly.',
|
|
]; |