New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(queries): login policy projection #2401
Conversation
bulk iterates as long as new events
…st statement if it has previous sequence 0
no savepoint if noop stmt, tests for stmt handler
if err != nil { | ||
return nil, err | ||
} | ||
return &mgmt_pb.GetLoginPolicyResponse{Policy: policy_grpc.ModelLoginPolicyToPb(policy), IsDefault: policy.Default}, nil | ||
//TODO: why do we provice IsDefault twice? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is default should only be shown once. I think this happend on last api refactoring, because of the sub protos.
I think we should deprecate it in the api. So we can remove it in the future
Sequence: policy.Sequence, | ||
CreationDate: timestamp_pb.New(policy.CreationDate), | ||
ChangeDate: timestamp_pb.New(policy.ChangeDate), | ||
ResourceOwner: policy.OrgID, //TODO: should resource owner always be the org from ctx? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean with this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have no idea. deleted the comment
ForceMFA bool | ||
HidePasswordReset bool | ||
PasswordlessType PasswordlessType | ||
SecondFactors []SecondFactorType | ||
MultiFactors []MultiFactorType | ||
SecondFactors []domain.SecondFactorType | ||
MultiFactors []domain.MultiFactorType | ||
Default bool | ||
|
||
CreationDate time.Time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do we need this view model? wouldn't it make sense to use the domain model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's needed in the AuthRequest
-struct. I would not remove it now as not all objects in AuthRequest
are changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense
internal/query/policy_login.go
Outdated
) | ||
if err != nil { | ||
if errs.Is(err, sql.ErrNoRows) { | ||
return nil, errors.ThrowNotFound(err, "QUERY-yPqIZ", "errors.login_policy.not_found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message is wrong. should start with upper case
internal/query/policy_login.go
Outdated
) | ||
if err != nil { | ||
if errs.Is(err, sql.ErrNoRows) { | ||
return nil, errors.ThrowNotFound(err, "QUERY-yPqIZ", "errors.login_policy.not_found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error message
@@ -0,0 +1 @@ | |||
ALTER TABLE zitadel.projections.orgs RENAME COLUMN domain TO primary_domain; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this on this branch?
@@ -0,0 +1,13 @@ | |||
CREATE TABLE zitadel.projections.org_domains ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this on this branch?
@@ -0,0 +1,20 @@ | |||
CREATE TABLE zitadel.projections.login_policies ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename version
error messages, migrations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>
…adel into login-policy-projection
🎉 This PR is included in version 1.47.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
merge after #2383