mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
fa9f581d56
* chore: move to new org * logging * fix: org rename caos -> zitadel Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
30 lines
1.3 KiB
Go
30 lines
1.3 KiB
Go
package admin
|
|
|
|
import (
|
|
obj_grpc "github.com/zitadel/zitadel/internal/api/grpc/object"
|
|
"github.com/zitadel/zitadel/internal/domain"
|
|
"github.com/zitadel/zitadel/internal/query"
|
|
admin_pb "github.com/zitadel/zitadel/pkg/grpc/admin"
|
|
settings_pb "github.com/zitadel/zitadel/pkg/grpc/settings"
|
|
"google.golang.org/protobuf/types/known/durationpb"
|
|
)
|
|
|
|
func OIDCSettingsToPb(config *query.OIDCSettings) *settings_pb.OIDCSettings {
|
|
return &settings_pb.OIDCSettings{
|
|
Details: obj_grpc.ToViewDetailsPb(config.Sequence, config.CreationDate, config.ChangeDate, config.AggregateID),
|
|
AccessTokenLifetime: durationpb.New(config.AccessTokenLifetime),
|
|
IdTokenLifetime: durationpb.New(config.IdTokenLifetime),
|
|
RefreshTokenIdleExpiration: durationpb.New(config.RefreshTokenIdleExpiration),
|
|
RefreshTokenExpiration: durationpb.New(config.RefreshTokenExpiration),
|
|
}
|
|
}
|
|
|
|
func UpdateOIDCConfigToConfig(req *admin_pb.UpdateOIDCSettingsRequest) *domain.OIDCSettings {
|
|
return &domain.OIDCSettings{
|
|
AccessTokenLifetime: req.AccessTokenLifetime.AsDuration(),
|
|
IdTokenLifetime: req.IdTokenLifetime.AsDuration(),
|
|
RefreshTokenIdleExpiration: req.RefreshTokenIdleExpiration.AsDuration(),
|
|
RefreshTokenExpiration: req.RefreshTokenExpiration.AsDuration(),
|
|
}
|
|
}
|