2022-02-25 16:05:06 +01:00
|
|
|
package domain
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2022-04-27 01:01:45 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/eventstore/v1/models"
|
2022-02-25 16:05:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|