mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(auth): implement master key authentication system with child key issuance
Add admin and master authentication layers with JWT support. Replace direct key creation with hierarchical master/child key system. Update database schema to support master accounts with configurable limits and epoch-based key revocation. Add health check endpoint with system status monitoring. BREAKING CHANGE: Removed direct POST /keys endpoint in favor of master-based key issuance through /v1/tokens. Database migration requires dropping old User table and creating Master table with new relationships.
This commit is contained in:
@@ -11,12 +11,17 @@ type Config struct {
|
||||
Postgres PostgresConfig
|
||||
Redis RedisConfig
|
||||
Log LogConfig
|
||||
Auth AuthConfig
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
Port string
|
||||
}
|
||||
|
||||
type AuthConfig struct {
|
||||
JWTSecret string
|
||||
}
|
||||
|
||||
type PostgresConfig struct {
|
||||
DSN string
|
||||
}
|
||||
@@ -51,6 +56,9 @@ func Load() (*Config, error) {
|
||||
FlushInterval: getEnvDuration("EZ_LOG_FLUSH_MS", 1000),
|
||||
QueueCapacity: getEnvInt("EZ_LOG_QUEUE", 10000),
|
||||
},
|
||||
Auth: AuthConfig{
|
||||
JWTSecret: getEnv("EZ_JWT_SECRET", "change_me_in_production"),
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user