-
Notifications
You must be signed in to change notification settings - Fork 272
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 console EPP password form, minor adjustments #2445
Conversation
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.
Reviewed 8 of 9 files at r1, all commit messages.
Reviewable status: 8 of 9 files reviewed, 3 unresolved discussions (waiting on @ptkach)
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 62 at r1 (raw file):
private final GmailClient gmailClient; private final Optional<PasswordChangeRequest> eppPasswordChangeRequest;
What happens if we don't use an Optional, and the user doesn't pass in the correct input? I'm hoping it'd be a nice enough error; ideally we don't need an Optional because this is not a GET action.
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 86 at r1 (raw file):
var errorMsg = "Missing param(s): %s"; try { checkArgument(!Strings.isNullOrEmpty(eppRequestBody.registrarId()), errorMsg, "registrarId");
I think this should be a lot easier after my other PR. After that, we can just let the IllegalArgumentException fall through
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 146 at r1 (raw file):
@AutoValue public abstract static class PasswordChangeRequest {
Can we use a record instead of an AutoValue?
49439ea
to
770f58c
Compare
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.
Reviewable status: 7 of 9 files reviewed, 3 unresolved discussions (waiting on @gbrodman)
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 62 at r1 (raw file):
Previously, gbrodman wrote…
What happens if we don't use an Optional, and the user doesn't pass in the correct input? I'm hoping it'd be a nice enough error; ideally we don't need an Optional because this is not a GET action.
The last time I checked it throws internal error in the runtime, which doesn't translate well into a response status or message, that's why we used the same approach with optional for contacts and registrar.
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 86 at r1 (raw file):
Previously, gbrodman wrote…
I think this should be a lot easier after my other PR. After that, we can just let the IllegalArgumentException fall through
Done
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 146 at r1 (raw file):
Previously, gbrodman wrote…
Can we use a record instead of an AutoValue?
Done.
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.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ptkach)
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 62 at r1 (raw file):
Previously, ptkach (Pavlo Tkach) wrote…
The last time I checked it throws internal error in the runtime, which doesn't translate well into a response status or message, that's why we used the same approach with optional for contacts and registrar.
oh that's lame, but oh well not our problem here
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 73 at r2 (raw file):
} private boolean confirmParamsAvailable() {
don't think this needs to return anything
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 75 at r2 (raw file):
private boolean confirmParamsAvailable() { if (!this.eppPasswordChangeRequest.isPresent()) { throw new BadRequestException("Epp Password update body is invalid");
we could just use checkArgument as well here rather than a separate exception
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 92 at r2 (raw file):
if (!this.confirmParamsAvailable()) return; var eppRequestBody = this.eppPasswordChangeRequest.get(); if (!eppRequestBody.newPassword().equals(eppRequestBody.newPasswordRepeat())) {
We can still just use checkArgument
here as well, since it'll also give 401
4aad7ee
to
a0aee06
Compare
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.
Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ptkach)
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.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ptkach)
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.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ptkach)
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 73 at r2 (raw file):
Previously, gbrodman wrote…
don't think this needs to return anything
Done.
core/src/main/java/google/registry/ui/server/console/ConsoleEppPasswordAction.java
line 75 at r2 (raw file):
Previously, gbrodman wrote…
we could just use checkArgument as well here rather than a separate exception
Done.
This change is