|
1 | 1 | <?php
|
2 | 2 |
|
3 | 3 | return [
|
| 4 | + /** |
| 5 | + * -------------------------------------------------------------------------- |
| 6 | + * Authentication Configuration |
| 7 | + * -------------------------------------------------------------------------- |
| 8 | + * |
| 9 | + * Defines settings related to JWT-based authentication, including the |
| 10 | + * public key for token verification, the signing algorithm, and the |
| 11 | + * HTTP header expected to carry the token. |
| 12 | + */ |
| 13 | + |
4 | 14 | 'auth' => [
|
5 |
| - 'jwt_public_key' => env('JWT_PUBLIC_KEY_PATH'), // o URL |
6 |
| - 'jwt_algorithm' => 'RS256', |
7 |
| - 'header' => 'Authorization', // o 'X-Access-Token' |
| 15 | + |
| 16 | + /** |
| 17 | + * JWT Public Key: |
| 18 | + * Path or URL to the RSA public key used to verify incoming JWT tokens. |
| 19 | + * Can be a local file path or a remote URL, typically stored securely in the environment file. |
| 20 | + */ |
| 21 | + 'jwt_public_key' => env('JWT_PUBLIC_KEY_PATH'), |
| 22 | + |
| 23 | + /** |
| 24 | + * JWT Algorithm: |
| 25 | + * The cryptographic algorithm used for verifying JWT signatures. |
| 26 | + * Supported algorithms (based on firebase/php-jwt): |
| 27 | + * - HS256, HS384, HS512 (HMAC using SHA-256/384/512) |
| 28 | + * - RS256, RS384, RS512 (RSA using SHA-256/384/512) |
| 29 | + * - ES256, ES384, ES512 (ECDSA using SHA-256/384/512) |
| 30 | + * - EdDSA (Ed25519 signature) |
| 31 | + */ |
| 32 | + 'jwt_algorithm' => env('JWT_ALGORITHM', 'RS256'), |
| 33 | + |
| 34 | + /** |
| 35 | + * Authorization Header: |
| 36 | + * The HTTP header from which to extract the JWT token. |
| 37 | + * Common values are 'Authorization' or 'X-Access-Token'. |
| 38 | + */ |
| 39 | + 'header' => 'Authorization', |
8 | 40 | ],
|
9 | 41 |
|
| 42 | + /** |
| 43 | + * -------------------------------------------------------------------------- |
| 44 | + * API Gateway Configuration |
| 45 | + * -------------------------------------------------------------------------- |
| 46 | + * |
| 47 | + * Specifies the base URL of the API Gateway service through which all |
| 48 | + * microservice communication may be routed. |
| 49 | + */ |
| 50 | + |
10 | 51 | 'api_gateway' => [
|
| 52 | + |
| 53 | + /** |
| 54 | + * API Gateway URL: |
| 55 | + * Base URL of the API Gateway. Can be customized via environment |
| 56 | + * variable for flexibility across different environments. |
| 57 | + */ |
11 | 58 | 'url' => env('API_GATEWAY_URL', 'http://gateway.local'),
|
12 | 59 | ],
|
13 | 60 | ];
|
0 commit comments