3 kumpf 1.2 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
|
6 kumpf 1.2 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
14 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21 kumpf 1.1 //
22 //==============================================================================
23 //
24 // Author: Nag Boranna, Hewlett-Packard Company(nagaraja_boranna@hp.com)
25 //
26 // Modified By:
27 //
28 //%/////////////////////////////////////////////////////////////////////////////
29
30 #ifndef Pegasus_AuthenticationInfoRep_h
31 #define Pegasus_AuthenticationInfoRep_h
32
33 #include <Pegasus/Common/Config.h>
34 #include <Pegasus/Common/String.h>
35 #include <Pegasus/Common/Sharable.h>
36
37
38 PEGASUS_NAMESPACE_BEGIN
39
40 class AuthenticationInfo;
41
42 kumpf 1.1 /**
43 This class keeps the authentication information of a connection
44 persistent until the connection is destroyed.
45 */
46 class PEGASUS_COMMON_LINKAGE AuthenticationInfoRep : public Sharable
47 {
48 public:
49 enum AuthStatus { NEW_REQUEST, CHALLENGE_SENT, AUTHENTICATED };
50
51 AuthenticationInfoRep(Boolean flag);
52
53 ~AuthenticationInfoRep();
54
55 AuthStatus getAuthStatus() const
56 {
57 return _authStatus;
58 }
59
60 void setAuthStatus(AuthStatus status);
61
62 String getAuthenticatedUser() const
63 kumpf 1.1 {
64 return _authUser;
65 }
66
67 void setAuthenticatedUser(const String& userName);
68
69 String getAuthChallenge() const
70 {
71 return _authChallenge;
72 }
73
74 void setAuthChallenge(const String& challenge);
75
76 String getAuthSecret() const
77 {
78 return _authSecret;
79 }
80
81 void setAuthSecret(const String& secret);
82
83 Boolean isPrivileged() const
84 kumpf 1.1 {
85 return _privileged;
86 }
87
88 void setPrivileged(Boolean privileged);
89
90 Boolean isAuthenticated() const
91 {
92 return (_authStatus == AUTHENTICATED) ? true : false;
93 }
94
95 String getAuthType() const
96 {
97 return _authType;
98 }
99
100 void setAuthType(const String& authType);
101
102 private:
103
104 /** Constructors */
105 kumpf 1.1 AuthenticationInfoRep();
106
107 AuthenticationInfoRep(const AuthenticationInfoRep& x);
108
109 AuthenticationInfoRep& operator=(const AuthenticationInfoRep& x);
110
111 String _authUser;
112 String _authChallenge;
113 String _authSecret;
114 Boolean _privileged;
115 String _authType;
116 AuthStatus _authStatus;
117 };
118
119 PEGASUS_NAMESPACE_END
120
121 #endif /* Pegasus_AuthenticationInfoRep_h*/
|