zitadel/internal/domain/oidc_settings.go
Fabi 7d6c933485
feat: OIDC setting (#3245)
* feat: add oidc config struct

* feat: oidc config command side

* feat: oidc configuration query side

* feat: add translations

* feat: add tests

* feat: add translations

* feat: rename oidc config to oidc settings

* feat: rename oidc config to oidc settings
2022-02-25 16:05:06 +01:00

38 lines
736 B
Go

package domain
import (
"time"
"github.com/caos/zitadel/internal/eventstore/v1/models"
)
type OIDCSettings struct {
models.ObjectRoot
State OIDCSettingsState
Default bool
AccessTokenLifetime time.Duration
IdTokenLifetime time.Duration
RefreshTokenIdleExpiration time.Duration
RefreshTokenExpiration time.Duration
}
type OIDCSettingsState int32
const (
OIDCSettingsStateUnspecified OIDCSettingsState = iota
OIDCSettingsStateActive
OIDCSettingsStateRemoved
oidcSettingsStateCount
)
func (c OIDCSettingsState) Valid() bool {
return c >= 0 && c < oidcSettingsStateCount
}
func (s OIDCSettingsState) Exists() bool {
return s != OIDCSettingsStateUnspecified && s != OIDCSettingsStateRemoved
}