1 martin 1.28 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.29 //
|
3 martin 1.28 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.29 //
|
10 martin 1.28 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.29 //
|
17 martin 1.28 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.29 //
|
20 martin 1.28 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.29 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.28 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.29 //
|
28 martin 1.28 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.2 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_HTTPAuthenticatorDelegator_h
33 #define Pegasus_HTTPAuthenticatorDelegator_h
34
35 #include <Pegasus/Common/Config.h>
|
36 sahana.prabhakar 1.30 #include <Pegasus/Common/MessageQueue.h>
|
37 mike 1.2 #include <Pegasus/Common/HTTPAcceptor.h>
38 #include <Pegasus/Common/HTTPConnection.h>
39 #include <Pegasus/Common/HTTPMessage.h>
|
40 a.arora 1.15 #include <Pegasus/Common/AutoPtr.h>
|
41 mike 1.2 #include <Pegasus/Security/Authentication/AuthenticationManager.h>
|
42 kumpf 1.10 #include <Pegasus/Server/Linkage.h>
|
43 mike 1.2
|
44 h.sterling 1.17 #include <Pegasus/Repository/CIMRepository.h>
45
|
46 mike 1.2 PEGASUS_NAMESPACE_BEGIN
47
48 /**
|
49 mday 1.5 This class parses the HTTP header in the HTTPMessage passed to it and
50 performs authentication based on the authentication specified in the
51 configuration. It sends the challenge for unauthorized requests and
52 validates the response.
|
53 mike 1.2 */
|
54 kumpf 1.26 class PEGASUS_SERVER_LINKAGE HTTPAuthenticatorDelegator :
|
55 sahana.prabhakar 1.30 public MessageQueue
|
56 mike 1.2 {
|
57 kumpf 1.26 public:
|
58 mike 1.2
|
59 sahana.prabhakar 1.30 typedef MessageQueue Base;
|
60 mday 1.3
|
61 kumpf 1.26 /** Constructor. */
62 HTTPAuthenticatorDelegator(
|
63 kumpf 1.27 Uint32 cimOperationMessageQueueId,
64 Uint32 cimExportMessageQueueId,
|
65 kumpf 1.26 CIMRepository* repository);
|
66 mike 1.2
|
67 kumpf 1.26 /** Destructor. */
68 ~HTTPAuthenticatorDelegator();
|
69 mike 1.2
|
70 kumpf 1.26 /**
71 This method is overridden here to force the message to be handled
72 by the same thread that enqueues it. See Bugzilla 641 for details.
73 */
74 virtual void enqueue(Message* message);
|
75 kumpf 1.12
|
76 kumpf 1.26 virtual void handleEnqueue(Message*);
77 virtual void handleEnqueue();
|
78 mike 1.2
|
79 kumpf 1.26 void handleHTTPMessage(HTTPMessage* httpMessage, Boolean& deleteMessage);
|
80 mike 1.2
|
81 kumpf 1.27 void setWsmQueueId(Uint32 wsmanOperationMessageQueueId)
82 {
83 _wsmanOperationMessageQueueId = wsmanOperationMessageQueueId;
84 }
|
85 karl 1.30.6.2 #ifdef PEGASUS_ENABLE_PROTOCOL_WEB
86 void setWebQueueId(Uint32 webOperationMessageQueueId)
87 {
88 _webOperationMessageQueueId = webOperationMessageQueueId;
89 }
90 #endif
91
92 void setRsQueueId(Uint32 rsOperationMessageQueueId)
93 {
94 _rsOperationMessageQueueId = rsOperationMessageQueueId;
95 }
|
96 kumpf 1.27
|
97 kumpf 1.26 private:
|
98 mike 1.2
|
99 kumpf 1.26 void _sendResponse(
100 Uint32 queueId,
101 Buffer& message,
102 Boolean closeConnect);
|
103 mike 1.2
|
104 gerarda 1.11 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
|
105 kumpf 1.26 void _sendSuccess(
106 Uint32 queueId,
107 const String& authResponse,
108 Boolean closeConnect);
109 #endif
110
111 void _sendChallenge(
112 Uint32 queueId,
|
113 karl 1.30.6.1 const String& errorDetail,
|
114 kumpf 1.26 const String& authResponse,
115 Boolean closeConnect);
116
117 void _sendHttpError(
118 Uint32 queueId,
119 const String& status,
120 const String& cimError = String::EMPTY,
121 const String& pegasusError = String::EMPTY,
122 Boolean closeConnect = false);
|
123 mike 1.2
|
124 kumpf 1.27 Uint32 _cimOperationMessageQueueId;
125 Uint32 _cimExportMessageQueueId;
126 Uint32 _wsmanOperationMessageQueueId;
|
127 karl 1.30.6.2 Uint32 _rsOperationMessageQueueId;
128 #ifdef PEGASUS_ENABLE_PROTOCOL_WEB
129 Uint32 _webOperationMessageQueueId;
130 #endif
|
131 mike 1.2
|
132 kumpf 1.26 AutoPtr<AuthenticationManager> _authenticationManager;
|
133 h.sterling 1.17
134 private:
|
135 j.alex 1.22 CIMRepository* _repository;
|
136 mike 1.2 };
137
138 PEGASUS_NAMESPACE_END
139
140 #endif /* Pegasus_HTTPAuthenticatorDelegator_h */
|