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
|
86 kumpf 1.26 private:
|
87 mike 1.2
|
88 kumpf 1.26 void _sendResponse(
89 Uint32 queueId,
90 Buffer& message,
91 Boolean closeConnect);
|
92 mike 1.2
|
93 gerarda 1.11 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
|
94 kumpf 1.26 void _sendSuccess(
95 Uint32 queueId,
96 const String& authResponse,
97 Boolean closeConnect);
98 #endif
99
100 void _sendChallenge(
101 Uint32 queueId,
102 const String& authResponse,
103 Boolean closeConnect);
104
105 void _sendHttpError(
106 Uint32 queueId,
107 const String& status,
108 const String& cimError = String::EMPTY,
109 const String& pegasusError = String::EMPTY,
110 Boolean closeConnect = false);
|
111 mike 1.2
|
112 kumpf 1.27 Uint32 _cimOperationMessageQueueId;
113 Uint32 _cimExportMessageQueueId;
114 Uint32 _wsmanOperationMessageQueueId;
|
115 mike 1.2
|
116 kumpf 1.26 AutoPtr<AuthenticationManager> _authenticationManager;
|
117 h.sterling 1.17
118 private:
|
119 j.alex 1.22 CIMRepository* _repository;
|
120 mike 1.2 };
121
122 PEGASUS_NAMESPACE_END
123
124 #endif /* Pegasus_HTTPAuthenticatorDelegator_h */
|