Skip to content
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

Merged
merged 214 commits into from
Oct 20, 2021
Merged

fix(queries): password age policy #2418

merged 214 commits into from
Oct 20, 2021

Conversation

adlerhurst
Copy link
Member

merge after #2417

@adlerhurst adlerhurst changed the title fix(queries): password age plicy fix(queries): password age policy Oct 19, 2021
@adlerhurst adlerhurst marked this pull request as ready for review October 20, 2021 12:08
"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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be named PasswordAgePolicyByOrgID

Comment on lines 71 to 72
// case *proj_pb.ProjectQuery_ProjectResourceOwnerQuery:
// return query.NewProjectResourceOwnerSearchQuery(q.ProjectResourceOwnerQuery.ResourceOwner)
Copy link
Member

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 (
Copy link
Member

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")
Copy link
Member

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)

Copy link
Member Author

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")
Copy link
Member

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

Copy link
Member Author

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
@hifabienne hifabienne enabled auto-merge (squash) October 20, 2021 12:49
@hifabienne hifabienne merged commit 9571dc5 into main Oct 20, 2021
@hifabienne hifabienne deleted the pw-age-plicy branch October 20, 2021 13:02
@github-actions
Copy link

🎉 This PR is included in version 1.47.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants