Skip to content

Commit 7a6a112

Browse files
committed
Update microservice.php
1 parent 514a785 commit 7a6a112

File tree

1 file changed

+50
-3
lines changed

1 file changed

+50
-3
lines changed

config/microservice.php

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,60 @@
11
<?php
22

33
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+
414
'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',
840
],
941

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+
1051
'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+
*/
1158
'url' => env('API_GATEWAY_URL', 'http://gateway.local'),
1259
],
1360
];

0 commit comments

Comments
 (0)