-
Notifications
You must be signed in to change notification settings - Fork 303
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
HPCC-16332 Send error message if root authorization fails #10998
Conversation
https://track.hpccsystems.com/browse/HPCC-16332 |
@RussWhitehead please review. |
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.
A couple very minor comments
if (user->getAuthenticateStatus() == AS_PASSWORD_EXPIRED || user->getAuthenticateStatus() == AS_PASSWORD_VALID_BUT_EXPIRED) | ||
ctx->AuditMessage(AUDIT_TYPE_ACCESS_FAILURE, "Authentication", "ESP password is expired"); | ||
desc = "ESP password is expired"; |
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 able to call ctx->setRespMsg() and no need for "desc" pointer
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.
The "desc" is also used by the AuditMessage().
} | ||
else | ||
{ | ||
resp.setf("<LoginResponse><Error>"); |
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 setf() ?
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 should change it to set().
else | ||
resp.appendf("\"Error\": \"%s\"", errMsg); | ||
resp.append(" }"); | ||
resp.append(" }"); |
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.
Would it make sense to combine some of these appends ?
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 shows the JSON layers better to keep those appends.
@RussWhitehead please review again. |
Looks good |
If a user logins to ECLWatch with valid credential without SMC Root access, the existing ECLWatch is redirected to the login window as if a bad password is entered. In this fix, the redirect is replaced by sending an error message. Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
Automated Smoketest: ✅ Unit tests result:
Regression test result:
HPCC Stop: OK
|
If a user logins to ECLWatch with valid credential without SMC
Root access, the existing ECLWatch is redirected to the login
window as if a bad password is entered. In this fix, the
redirect is replaced by sending an error message.
Signed-off-by: wangkx kevin.wang@lexisnexis.com
Type of change:
Checklist:
Testing: