2020-07-06 13:35:20 +00:00
|
|
|
package eventstore
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2020-07-08 11:56:37 +00:00
|
|
|
"github.com/caos/zitadel/internal/api/authz"
|
2020-07-06 13:35:20 +00:00
|
|
|
pol_model "github.com/caos/zitadel/internal/policy/model"
|
|
|
|
pol_event "github.com/caos/zitadel/internal/policy/repository/eventsourcing"
|
|
|
|
)
|
|
|
|
|
|
|
|
type PolicyRepo struct {
|
|
|
|
PolicyEvents *pol_event.PolicyEventstore
|
|
|
|
}
|
|
|
|
|
|
|
|
func (repo *PolicyRepo) GetMyPasswordComplexityPolicy(ctx context.Context) (*pol_model.PasswordComplexityPolicy, error) {
|
2020-07-08 11:56:37 +00:00
|
|
|
ctxData := authz.GetCtxData(ctx)
|
2020-07-06 13:35:20 +00:00
|
|
|
return repo.PolicyEvents.GetPasswordComplexityPolicy(ctx, ctxData.OrgID)
|
|
|
|
}
|