-
Notifications
You must be signed in to change notification settings - Fork 439
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): password age policy #2418
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
"github.com/caos/zitadel/internal/api/authz" | ||
"github.com/caos/zitadel/internal/api/grpc/object" | ||
policy_grpc "github.com/caos/zitadel/internal/api/grpc/policy" | ||
mgmt_pb "github.com/caos/zitadel/pkg/grpc/management" | ||
) | ||
|
||
func (s *Server) GetPasswordAgePolicy(ctx context.Context, req *mgmt_pb.GetPasswordAgePolicyRequest) (*mgmt_pb.GetPasswordAgePolicyResponse, error) { | ||
policy, err := s.org.GetPasswordAgePolicy(ctx) | ||
policy, err := s.query.MyPasswordAgePolicy(ctx, authz.GetCtxData(ctx).OrgID) |
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.
Should be named PasswordAgePolicyByOrgID
// case *proj_pb.ProjectQuery_ProjectResourceOwnerQuery: | ||
// return query.NewProjectResourceOwnerSearchQuery(q.ProjectResourceOwnerQuery.ResourceOwner) |
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.
Dont remove this
return scan(row) | ||
} | ||
|
||
var ( |
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.
vars to the top
policyEvent = e.PasswordAgePolicyAddedEvent | ||
isDefault = true | ||
default: | ||
logging.LogWithFields("PROJE-stxcL", "seq", event.Sequence(), "expectedTypes", []eventstore.EventType{org.PasswordAgePolicyAddedEventType, iam.PasswordAgePolicyAddedEventType}).Error("was not an event") |
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.
strange error message "was not an event" but I think we have this everywhere (copy past problem)
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.
fixed everywhere
case *iam.PasswordAgePolicyChangedEvent: | ||
policyEvent = e.PasswordAgePolicyChangedEvent | ||
default: | ||
logging.LogWithFields("PROJE-EZ53p", "seq", event.Sequence(), "expectedTypes", []eventstore.EventType{org.PasswordAgePolicyChangedEventType, iam.PasswordAgePolicyChangedEventType}).Error("was not an event") |
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.
same here with the error message also in the following functions
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.
fixed everywhere
correct log message
🎉 This PR is included in version 1.47.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
merge after #2417