2020-07-08 11:56:37 +00:00
|
|
|
package management
|
2020-06-17 05:25:04 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
iam_model "github.com/caos/zitadel/internal/iam/model"
|
2020-07-08 11:56:37 +00:00
|
|
|
"github.com/caos/zitadel/pkg/grpc/management"
|
2020-06-17 05:25:04 +00:00
|
|
|
)
|
|
|
|
|
2020-08-26 07:56:23 +00:00
|
|
|
func iamFromModel(iam *iam_model.IAM) *management.Iam {
|
2020-07-08 11:56:37 +00:00
|
|
|
return &management.Iam{
|
2020-08-26 07:56:23 +00:00
|
|
|
IamProjectId: iam.IAMProjectID,
|
2020-06-17 05:25:04 +00:00
|
|
|
GlobalOrgId: iam.GlobalOrgID,
|
2020-09-24 09:38:28 +00:00
|
|
|
SetUpDone: iamSetupStepFromModel(iam.SetUpDone),
|
|
|
|
SetUpStarted: iamSetupStepFromModel(iam.SetUpStarted),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func iamSetupStepFromModel(step iam_model.Step) management.IamSetupStep {
|
|
|
|
switch step {
|
|
|
|
case iam_model.Step1:
|
|
|
|
return management.IamSetupStep_iam_setup_step_1
|
|
|
|
//TODO: label policy
|
|
|
|
// case iam_model.Step2:
|
|
|
|
// return management.IamSetupStep_iam_setup_step_2
|
|
|
|
default:
|
|
|
|
return management.IamSetupStep_iam_setup_step_UNDEFINED
|
2020-06-17 05:25:04 +00:00
|
|
|
}
|
|
|
|
}
|