version 1.82, 2008/03/11 17:33:17
|
version 1.83, 2008/04/29 20:40:25
|
|
|
static const String _CONFIG_PARAM_ENABLEAUTHENTICATION = "enableAuthentication"; | static const String _CONFIG_PARAM_ENABLEAUTHENTICATION = "enableAuthentication"; |
| |
HTTPAuthenticatorDelegator::HTTPAuthenticatorDelegator( | HTTPAuthenticatorDelegator::HTTPAuthenticatorDelegator( |
Uint32 operationMessageQueueId, |
Uint32 cimOperationMessageQueueId, |
Uint32 exportMessageQueueId, |
Uint32 cimExportMessageQueueId, |
CIMRepository* repository) | CIMRepository* repository) |
: Base(PEGASUS_QUEUENAME_HTTPAUTHDELEGATOR, MessageQueue::getNextQueueId()), | : Base(PEGASUS_QUEUENAME_HTTPAUTHDELEGATOR, MessageQueue::getNextQueueId()), |
_operationMessageQueueId(operationMessageQueueId), |
_cimOperationMessageQueueId(cimOperationMessageQueueId), |
_exportMessageQueueId(exportMessageQueueId), |
_cimExportMessageQueueId(cimExportMessageQueueId), |
|
_wsmanOperationMessageQueueId(PEG_NOT_FOUND), |
_repository(repository) | _repository(repository) |
{ | { |
PEG_METHOD_ENTER(TRC_HTTP, | PEG_METHOD_ENTER(TRC_HTTP, |
|
|
} | } |
| |
// | // |
// Search for "CIMOperation" header: |
// Determine the type of this request: |
// | // |
|
// - A "CIMOperation" header indicates a CIM operation request |
|
// - A "CIMExport" header indicates a CIM export request |
|
// - A "/wsman" path in the start message indicates a WS-Man request |
|
// |
|
|
String cimOperation; | String cimOperation; |
| |
if (HTTPMessage::lookupHeader( | if (HTTPMessage::lookupHeader( |
|
|
cimOperation)); | cimOperation)); |
| |
MessageQueue* queue = | MessageQueue* queue = |
MessageQueue::lookup(_operationMessageQueueId); |
MessageQueue::lookup(_cimOperationMessageQueueId); |
| |
if (queue) | if (queue) |
{ | { |
|
|
"HTTPAuthenticatorDelegator - CIMExport: $0 ",cimOperation); | "HTTPAuthenticatorDelegator - CIMExport: $0 ",cimOperation); |
| |
MessageQueue* queue = | MessageQueue* queue = |
MessageQueue::lookup(_exportMessageQueueId); |
MessageQueue::lookup(_cimExportMessageQueueId); |
| |
if (queue) | if (queue) |
{ | { |
|
|
deleteMessage = false; | deleteMessage = false; |
} | } |
} | } |
|
else if ((_wsmanOperationMessageQueueId != PEG_NOT_FOUND) && |
|
((requestUri == "/wsman") || |
|
((requestUri == "/wsman-anon") && !enableAuthentication))) |
|
{ |
|
// Note: DSP0226 R5.3-1 specifies if /wsman is used, |
|
// unauthenticated access should not be allowed. This "should" |
|
// requirement is not implemented here, because it is difficult |
|
// for a client to determine whether enableAuthentication=true. |
|
|
|
// DSP0226 R5.3-2 specifies if /wsman-anon is used, authenticated |
|
// access shall not be required. Unauthenticated access is |
|
// currently not allowed if enableAuthentication=true. When |
|
// support for wsmid:Identify is added, it will be necessary to |
|
// respond to that request without requiring authentication, |
|
// regardless of the CIM Server configuration. |
|
|
|
MessageQueue* queue = |
|
MessageQueue::lookup(_wsmanOperationMessageQueueId); |
|
|
|
if (queue) |
|
{ |
|
httpMessage->dest = queue->getQueueId(); |
|
|
|
try |
|
{ |
|
queue->enqueue(httpMessage); |
|
} |
|
catch (const bad_alloc&) |
|
{ |
|
delete httpMessage; |
|
_sendHttpError( |
|
queueId, |
|
HTTP_STATUS_REQUEST_TOO_LARGE, |
|
String::EMPTY, |
|
String::EMPTY, |
|
closeConnect); |
|
PEG_METHOD_EXIT(); |
|
deleteMessage = false; |
|
return; |
|
} |
|
deleteMessage = false; |
|
} |
|
} |
else | else |
{ | { |
// We don't recognize this request message type | // We don't recognize this request message type |