mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
ApiServer: Debug messages, don't spam with info, remove identity helper in ResponseGenerator
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
40779975d3
commit
0dca44efe8
@ -314,13 +314,6 @@ public interface ResponseGenerator {
|
|||||||
|
|
||||||
StorageNetworkIpRangeResponse createStorageNetworkIpRangeResponse(StorageNetworkIpRange result);
|
StorageNetworkIpRangeResponse createStorageNetworkIpRangeResponse(StorageNetworkIpRange result);
|
||||||
|
|
||||||
/**
|
|
||||||
* @param tableName TODO
|
|
||||||
* @param token
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Long getIdentiyId(String tableName, String token);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param resourceTag
|
* @param resourceTag
|
||||||
* @param keyValueOnly TODO
|
* @param keyValueOnly TODO
|
||||||
|
|||||||
@ -601,30 +601,29 @@ public class ApiServer implements HttpRequestHandler {
|
|||||||
|
|
||||||
// if api/secret key are passed to the parameters
|
// if api/secret key are passed to the parameters
|
||||||
if ((signature == null) || (apiKey == null)) {
|
if ((signature == null) || (apiKey == null)) {
|
||||||
if (s_logger.isDebugEnabled()) {
|
s_logger.debug("Expired session, missing signature, or missing apiKey -- ignoring request. Signature: " + signature + ", apiKey: " + apiKey);
|
||||||
s_logger.info("expired session, missing signature, or missing apiKey -- ignoring request...sig: " + signature + ", apiKey: " + apiKey);
|
|
||||||
}
|
|
||||||
return false; // no signature, bad request
|
return false; // no signature, bad request
|
||||||
}
|
}
|
||||||
|
|
||||||
Date expiresTS = null;
|
Date expiresTS = null;
|
||||||
|
// FIXME: Hard coded signature, why not have an enum
|
||||||
if ("3".equals(signatureVersion)) {
|
if ("3".equals(signatureVersion)) {
|
||||||
// New signature authentication. Check for expire parameter and its validity
|
// New signature authentication. Check for expire parameter and its validity
|
||||||
if (expires == null) {
|
if (expires == null) {
|
||||||
s_logger.info("missing Expires parameter -- ignoring request...sig: " + signature + ", apiKey: " + apiKey);
|
s_logger.debug("Missing Expires parameter -- ignoring request. Signature: " + signature + ", apiKey: " + apiKey);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
synchronized (_dateFormat) {
|
synchronized (_dateFormat) {
|
||||||
try {
|
try {
|
||||||
expiresTS = _dateFormat.parse(expires);
|
expiresTS = _dateFormat.parse(expires);
|
||||||
} catch (ParseException pe) {
|
} catch (ParseException pe) {
|
||||||
s_logger.info("Incorrect date format for Expires parameter", pe);
|
s_logger.debug("Incorrect date format for Expires parameter", pe);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Date now = new Date(System.currentTimeMillis());
|
Date now = new Date(System.currentTimeMillis());
|
||||||
if (expiresTS.before(now)) {
|
if (expiresTS.before(now)) {
|
||||||
s_logger.info("Request expired -- ignoring ...sig: " + signature + ", apiKey: " + apiKey);
|
s_logger.debug("Request expired -- ignoring ...sig: " + signature + ", apiKey: " + apiKey);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -635,7 +634,7 @@ public class ApiServer implements HttpRequestHandler {
|
|||||||
// verify there is a user with this api key
|
// verify there is a user with this api key
|
||||||
Pair<User, Account> userAcctPair = _accountMgr.findUserByApiKey(apiKey);
|
Pair<User, Account> userAcctPair = _accountMgr.findUserByApiKey(apiKey);
|
||||||
if (userAcctPair == null) {
|
if (userAcctPair == null) {
|
||||||
s_logger.info("apiKey does not map to a valid user -- ignoring request, apiKey: " + apiKey);
|
s_logger.debug("apiKey does not map to a valid user -- ignoring request, apiKey: " + apiKey);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user