version 1.31, 2006/11/10 18:14:57
|
version 1.39, 2008/12/01 17:49:46
|
|
|
//%2006//////////////////////////////////////////////////////////////////////// |
//%LICENSE//////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Licensed to The Open Group (TOG) under one or more contributor license |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with |
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
// this work for additional information regarding copyright ownership. |
// IBM Corp.; EMC Corporation, The Open Group. |
// Each contributor licenses this file to you under the OpenPegasus Open |
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
// Source License; you may not use this file except in compliance with the |
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// License. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
|
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy |
// Permission is hereby granted, free of charge, to any person obtaining a |
// of this software and associated documentation files (the "Software"), to |
// copy of this software and associated documentation files (the "Software"), |
// deal in the Software without restriction, including without limitation the |
// to deal in the Software without restriction, including without limitation |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, |
// sell copies of the Software, and to permit persons to whom the Software is |
// and/or sell copies of the Software, and to permit persons to whom the |
// furnished to do so, subject to the following conditions: |
// Software is furnished to do so, subject to the following conditions: |
// | // |
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN |
// The above copyright notice and this permission notice shall be included |
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED |
// in all copies or substantial portions of the Software. |
// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT |
|
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
|
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
|
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
// | // |
//============================================================================== |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
|
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
|
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
|
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
// |
|
////////////////////////////////////////////////////////////////////////// |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
{ | { |
public: | public: |
| |
/** Constructor - Creates an uninitiated new AuthenticationInfo |
/** Constructor - Creates an uninitialized new AuthenticationInfo |
object reprenting a AuthenticationInfo class. The class object |
object representing an AuthenticationInfo class. The class object |
created by this constructor can only be used in an operation such as the | created by this constructor can only be used in an operation such as the |
copy constructor. It cannot be used to do method calls like |
copy constructor. It cannot be used to do method calls such as |
setAuthStatus, getAuthType, etc. since it is unitiated. |
getAuthType, since it is uninitialized. |
| |
Use one of the other constructors to create an initiated new | Use one of the other constructors to create an initiated new |
AuthenticationInfo class object. Throws an exception | AuthenticationInfo class object. Throws an exception |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |
/** Get the authentication status of the request |
/** Sets the connection authentication status of the request to the |
@return the current authentication status |
status specified. |
*/ |
|
AuthenticationInfoRep::AuthStatus getAuthStatus() const |
|
{ |
|
_checkRep(); |
|
return _rep->getAuthStatus(); |
|
} |
|
|
|
/** Sets the authentication status of the request to the status |
|
specified. |
|
@param status - the new authentication status | @param status - the new authentication status |
*/ | */ |
void setAuthStatus(AuthenticationInfoRep::AuthStatus status) |
void setConnectionAuthenticated(Boolean status) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->setAuthStatus(status); |
_rep->setConnectionAuthenticated(status); |
} | } |
| |
/** Get the previously authenticated user name | /** Get the previously authenticated user name |
|
|
*/ | */ |
String getAuthenticatedUser() const | String getAuthenticatedUser() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getAuthenticatedUser(); | return _rep->getAuthenticatedUser(); |
} | } |
| |
|
|
*/ | */ |
void setAuthenticatedUser(const String& userName) | void setAuthenticatedUser(const String& userName) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->setAuthenticatedUser(userName); | _rep->setAuthenticatedUser(userName); |
} | } |
| |
|
#ifdef PEGASUS_OS_ZOS |
|
|
|
/** The connection user is for z/OS only. |
|
On z/OS Unix Local Domain Sockets and sockets |
|
protected by AT-TLS are able to get the user ID of |
|
the connected user. |
|
This information is needed for later authentication |
|
steps. |
|
*/ |
|
|
|
/** Get the connection user name |
|
@return the connection user name |
|
*/ |
|
String getConnectionUser() const |
|
{ |
|
CheckRep(_rep); |
|
return _rep->getConnectionUser(); |
|
} |
|
|
|
/** Sets the connection user name |
|
@param userName - string containing the user name |
|
provided by the connection |
|
*/ |
|
void setConnectionUser(const String& userName) |
|
{ |
|
CheckRep(_rep); |
|
_rep->setConnectionUser(userName); |
|
} |
|
|
|
#endif |
|
|
/** Get the previously authenticated password | /** Get the previously authenticated password |
@return the authenticated password | @return the authenticated password |
*/ | */ |
String getAuthenticatedPassword() const | String getAuthenticatedPassword() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getAuthenticatedPassword(); | return _rep->getAuthenticatedPassword(); |
} | } |
| |
|
|
*/ | */ |
void setAuthenticatedPassword(const String& password) | void setAuthenticatedPassword(const String& password) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->setAuthenticatedPassword(password); | _rep->setAuthenticatedPassword(password); |
} | } |
| |
/** Get the authentication challenge that was sent to the client |
/** Get the local authentication file path that was sent to client |
@return string containing the authentication challenge |
@return string containing the authentication file path |
*/ | */ |
String getAuthChallenge() const |
String getLocalAuthFilePath() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getAuthChallenge(); |
return _rep->getLocalAuthFilePath(); |
} | } |
| |
/** Sets the authentication challenge to the specified challenge |
/** Set the local authentication file path to the specified file path |
@param challenge - string containing the authentication challenge |
@param filePath String containing the authentication file path |
*/ | */ |
void setAuthChallenge(const String& challenge) |
void setLocalAuthFilePath(const String& filePath) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->setAuthChallenge(challenge); |
_rep->setLocalAuthFilePath(filePath); |
} | } |
| |
/** Get the authentication secret that was sent to client |
/** Get the local authentication secret that was sent to client |
@return string containing the authentication secret | @return string containing the authentication secret |
*/ | */ |
String getAuthSecret() const |
String getLocalAuthSecret() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getAuthSecret(); |
return _rep->getLocalAuthSecret(); |
} | } |
| |
/** Set the authentication secret to the specified secret |
/** Set the local authentication secret to the specified secret |
@param secret - string containing the authentication secret | @param secret - string containing the authentication secret |
*/ | */ |
void setAuthSecret(const String& secret) |
void setLocalAuthSecret(const String& secret) |
{ |
|
_checkRep(); |
|
_rep->setAuthSecret(secret); |
|
} |
|
|
|
/** Returns the connection type of the previous authenticated request |
|
@return true if the connection is privileged, false otherwise |
|
*/ |
|
Boolean isPrivileged() const |
|
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->isPrivileged(); |
_rep->setLocalAuthSecret(secret); |
} |
|
|
|
/** Set the privileged flag to the specified value |
|
@param privileged - boolean flag indicating the connection type |
|
*/ |
|
void setPrivileged(Boolean privileged) |
|
{ |
|
_checkRep(); |
|
_rep->setPrivileged(privileged); |
|
} | } |
| |
/** Is the request authenticated | /** Is the request authenticated |
|
|
/** Returns the authentication status of the current connection. | /** Returns the authentication status of the current connection. |
@return true if the connection was authenticated, false otherwise | @return true if the connection was authenticated, false otherwise |
*/ | */ |
Boolean isAuthenticated() const |
Boolean isConnectionAuthenticated() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->isAuthenticated(); |
return _rep->isConnectionAuthenticated(); |
} | } |
| |
/** Set the authentication type to the specified type | /** Set the authentication type to the specified type |
|
|
*/ | */ |
void setAuthType(const String& authType) | void setAuthType(const String& authType) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->setAuthType(authType); | _rep->setAuthType(authType); |
} | } |
| |
|
|
*/ | */ |
String getAuthType() const | String getAuthType() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getAuthType(); | return _rep->getAuthType(); |
} | } |
| |
|
|
*/ | */ |
void setIpAddress(const String& ipAddress) | void setIpAddress(const String& ipAddress) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->setIpAddress(ipAddress); | _rep->setIpAddress(ipAddress); |
} | } |
| |
|
|
*/ | */ |
String getIpAddress() const | String getIpAddress() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getIpAddress(); | return _rep->getIpAddress(); |
} | } |
| |
|
|
*/ | */ |
CIMKerberosSecurityAssociation* getSecurityAssociation() const | CIMKerberosSecurityAssociation* getSecurityAssociation() const |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getSecurityAssociation(); | return _rep->getSecurityAssociation(); |
} | } |
| |
|
|
*/ | */ |
void setSecurityAssociation() | void setSecurityAssociation() |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->setSecurityAssociation(); | _rep->setSecurityAssociation(); |
} | } |
#endif | #endif |
| |
Array<SSLCertificateInfo*> getClientCertificateChain() | Array<SSLCertificateInfo*> getClientCertificateChain() |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getClientCertificateChain(); | return _rep->getClientCertificateChain(); |
} | } |
| |
void setClientCertificateChain(Array<SSLCertificateInfo*> clientCertificate) | void setClientCertificateChain(Array<SSLCertificateInfo*> clientCertificate) |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->setClientCertificateChain(clientCertificate); | _rep->setClientCertificateChain(clientCertificate); |
} | } |
| |
|
|
*/ | */ |
void setRemotePrivilegedUserAccessChecked() | void setRemotePrivilegedUserAccessChecked() |
{ | { |
_checkRep(); |
CheckRep(_rep); |
_rep->setRemotePrivilegedUserAccessChecked(); | _rep->setRemotePrivilegedUserAccessChecked(); |
} | } |
| |
|
|
*/ | */ |
Boolean getRemotePrivilegedUserAccessChecked() | Boolean getRemotePrivilegedUserAccessChecked() |
{ | { |
_checkRep(); |
CheckRep(_rep); |
return _rep->getRemotePrivilegedUserAccessChecked(); | return _rep->getRemotePrivilegedUserAccessChecked(); |
} | } |
| |
|
|
| |
} | } |
| |
void _checkRep() const |
|
{ |
|
if (!_rep) |
|
throw UninitializedObjectException(); |
|
} |
|
|
|
AuthenticationInfoRep* _rep; | AuthenticationInfoRep* _rep; |
}; | }; |
| |