feat: Add authentication configuration with JWT secret and reorganize environment variables with categorized sections

- Add AuthConfig struct with JWTSecret field to config package
- Add Auth field to Config struct with JSON tag for authentication settings
- Add JWT_SECRET to Auth config with default value "change-me-in-production"
- Replace MONGODB_URI with DATABASE_URL using PostgreSQL connection string in .env.example
- Add categorized sections in .env.example: Database/Server/Authentication/
This commit is contained in:
nutcas3
2026-04-23 02:58:01 +03:00
parent bda6c5931c
commit 546c9cd69f
2 changed files with 19 additions and 2 deletions
@@ -13,6 +13,7 @@ type Config struct {
Payment PaymentConfig `json:"payment"`
ChargingEngine ChargingEngineConfig `json:"charging_engine"`
InfluxDB InfluxDBConfig `json:"influxdb"`
Auth AuthConfig `json:"auth"`
}
type ChargingEngineConfig struct {
@@ -69,6 +70,10 @@ type ES2Config struct {
FunctionalityRequesterID string `json:"functionality_requester_id"`
}
type AuthConfig struct {
JWTSecret string `json:"jwt_secret"`
}
func LoadConfig() *Config {
return &Config{
Server: ServerConfig{
@@ -117,5 +122,8 @@ func LoadConfig() *Config {
Org: "telecom",
Bucket: "telecom",
},
Auth: AuthConfig{
JWTSecret: "change-me-in-production",
},
}
}