2020-08-18 10:04:56 +02:00
|
|
|
package setup
|
2020-05-18 11:32:16 +02:00
|
|
|
|
2020-09-24 11:38:28 +02:00
|
|
|
import (
|
2021-01-06 10:47:55 +01:00
|
|
|
"github.com/caos/zitadel/internal/v2/command"
|
|
|
|
"github.com/caos/zitadel/internal/v2/domain"
|
2020-09-24 11:38:28 +02:00
|
|
|
)
|
|
|
|
|
2020-05-18 11:32:16 +02:00
|
|
|
type IAMSetUp struct {
|
2021-01-06 10:47:55 +01:00
|
|
|
Step1 *command.Step1
|
|
|
|
Step2 *command.Step2
|
|
|
|
Step3 *command.Step3
|
|
|
|
Step4 *command.Step4
|
|
|
|
Step5 *command.Step5
|
|
|
|
Step6 *command.Step6
|
|
|
|
Step7 *command.Step7
|
|
|
|
Step8 *command.Step8
|
|
|
|
Step9 *command.Step9
|
2020-09-24 11:38:28 +02:00
|
|
|
}
|
|
|
|
|
2021-01-06 10:47:55 +01:00
|
|
|
func (setup *IAMSetUp) Steps(currentDone domain.Step) ([]command.Step, error) {
|
|
|
|
steps := make([]command.Step, 0)
|
2020-09-24 11:38:28 +02:00
|
|
|
|
2021-01-06 10:47:55 +01:00
|
|
|
for _, step := range []command.Step{
|
2020-09-24 11:38:28 +02:00
|
|
|
setup.Step1,
|
2021-01-06 10:47:55 +01:00
|
|
|
setup.Step2,
|
|
|
|
setup.Step3,
|
|
|
|
setup.Step4,
|
|
|
|
setup.Step5,
|
|
|
|
setup.Step6,
|
|
|
|
setup.Step7,
|
|
|
|
setup.Step8,
|
|
|
|
setup.Step9,
|
2020-09-24 11:38:28 +02:00
|
|
|
} {
|
2021-01-06 10:47:55 +01:00
|
|
|
if step.Step() <= currentDone {
|
2020-09-24 11:38:28 +02:00
|
|
|
continue
|
|
|
|
}
|
|
|
|
steps = append(steps, step)
|
|
|
|
}
|
|
|
|
return steps, nil
|
2020-08-26 09:56:23 +02:00
|
|
|
}
|