-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix NPE during reset password #12585
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,7 +47,6 @@ | |||||||||||
| @APICommand(name = "login", description = "Logs a user into the CloudStack. A successful login attempt will generate a JSESSIONID cookie value that can be passed in subsequent Query command calls until the \"logout\" command has been issued or the session has expired.", requestHasSensitiveInfo = true, responseObject = LoginCmdResponse.class, entityType = {}) | ||||||||||||
| public class DefaultLoginAPIAuthenticatorCmd extends BaseCmd implements APIAuthenticator { | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ///////////////////////////////////////////////////// | ||||||||||||
| //////////////// API parameters ///////////////////// | ||||||||||||
| ///////////////////////////////////////////////////// | ||||||||||||
|
|
@@ -107,17 +106,13 @@ public String authenticate(String command, Map<String, Object[]> params, HttpSes | |||||||||||
| if (HTTPMethod.valueOf(req.getMethod()) != HTTPMethod.POST) { | ||||||||||||
| throw new ServerApiException(ApiErrorCode.METHOD_NOT_ALLOWED, "Please use HTTP POST to authenticate using this API"); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| // FIXME: ported from ApiServlet, refactor and cleanup | ||||||||||||
| final String[] username = (String[])params.get(ApiConstants.USERNAME); | ||||||||||||
| final String[] password = (String[])params.get(ApiConstants.PASSWORD); | ||||||||||||
| String[] domainIdArr = (String[])params.get(ApiConstants.DOMAIN_ID); | ||||||||||||
|
|
||||||||||||
| if (domainIdArr == null) { | ||||||||||||
| domainIdArr = (String[])params.get(ApiConstants.DOMAIN__ID); | ||||||||||||
| } | ||||||||||||
| final String[] domainName = (String[])params.get(ApiConstants.DOMAIN); | ||||||||||||
| final String[] domainIdArr = (String[])params.get(ApiConstants.DOMAIN_ID); | ||||||||||||
|
||||||||||||
| final String[] domainIdArr = (String[])params.get(ApiConstants.DOMAIN_ID); | |
| String[] domainIdArr = (String[])params.get(ApiConstants.DOMAIN_ID); | |
| if (domainIdArr == null || domainIdArr.length == 0) { | |
| domainIdArr = (String[])params.get(ApiConstants.DOMAIN__ID); | |
| } |
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.
getDomainIdFromParamsnow only checks ApiConstants.DOMAIN_ID (domainid) but this API command also declares/accepts ApiConstants.DOMAIN__ID (domainId). Removing the fallback breaks clients usingdomainId. Please handle both keys (or centralize key normalization) to keep compatibility.