v2: fixed oauth errors, oauth clients native control added
This commit is contained in:
@@ -13,7 +13,7 @@ type Conf struct {
|
||||
Postgres Postgres
|
||||
Redis Redis
|
||||
Client Client
|
||||
JWT JWT
|
||||
Tokens Tokens
|
||||
}
|
||||
|
||||
type Server struct {
|
||||
@@ -39,9 +39,12 @@ type Client struct {
|
||||
Scopes []string `env:"CLIENT_SCOPES" envSeparator:"," envDefault:"profile:read,profile:edit,profile:consent:read,profile:consent:delete,auth:register"`
|
||||
}
|
||||
|
||||
type JWT struct {
|
||||
Secret string `env:"JWT_SECRET,required"`
|
||||
TTL time.Duration `env:"JWT_TTL" envDefault:"24h"`
|
||||
// Tokens holds the TTLs for opaque access/refresh tokens.
|
||||
// NOTE: tokens issued by this service are opaque (random), not JWTs —
|
||||
// this used to be a "JWT" config section with an unused JWT_SECRET var.
|
||||
type Tokens struct {
|
||||
AccessTTL time.Duration `env:"ACCESS_TOKEN_TTL" envDefault:"24h"`
|
||||
RefreshTTL time.Duration `env:"REFRESH_TOKEN_TTL" envDefault:"168h"`
|
||||
}
|
||||
|
||||
func New() (*Conf, error) {
|
||||
|
||||
Reference in New Issue
Block a user