(file) Return to AuthenticationInfo.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/AuthenticationInfo.h between version 1.10 and 1.41.8.3

version 1.10, 2002/08/17 00:59:36 version 1.41.8.3, 2014/04/28 00:29:12
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%LICENSE////////////////////////////////////////////////////////////////
 //  
 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,  
 // The Open Group, Tivoli Systems  
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy  // Licensed to The Open Group (TOG) under one or more contributor license
 // of this software and associated documentation files (the "Software"), to  // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
 // deal in the Software without restriction, including without limitation the  // this work for additional information regarding copyright ownership.
 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or  // Each contributor licenses this file to you under the OpenPegasus Open
 // sell copies of the Software, and to permit persons to whom the Software is  // Source License; you may not use this file except in compliance with the
 // furnished to do so, subject to the following conditions:  // License.
 // //
 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN  // Permission is hereby granted, free of charge, to any person obtaining a
 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  // copy of this software and associated documentation files (the "Software"),
 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT  // to deal in the Software without restriction, including without limitation
 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR  // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT  // and/or sell copies of the Software, and to permit persons to whom the
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN  // Software is furnished to do so, subject to the following conditions:
 // 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 above copyright notice and this permission notice shall be included
   // in all copies or substantial portions of the Software.
 // //
 // Author:  Nag Boranna, Hewlett-Packard Company(nagaraja_boranna@hp.com)  // 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.
 // //
 // Modified By:  //////////////////////////////////////////////////////////////////////////
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 35 
Line 37 
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
 #include <Pegasus/Common/AuthenticationInfoRep.h> #include <Pegasus/Common/AuthenticationInfoRep.h>
 #include <Pegasus/Common/Linkage.h> #include <Pegasus/Common/Linkage.h>
   #include <Pegasus/Common/SSLContext.h>
  
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
   
 /** /**
     This class keeps the authentication information of a connection     This class keeps the authentication information of a connection
     persistent until the connection is destroyed.     persistent until the connection is destroyed.
Line 55 
Line 57 
 { {
 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
Line 108 
Line 110 
     /** Constructor - Instantiates a AuthenticationInfo object.     /** Constructor - Instantiates a AuthenticationInfo object.
     @param flag - used only to distinguish from the default constructor.     @param flag - used only to distinguish from the default constructor.
     */     */
     AuthenticationInfo(Boolean flag)      AuthenticationInfo(Boolean)
     {     {
         PEG_METHOD_ENTER(         PEG_METHOD_ENTER(
             TRC_AUTHENTICATION, "AuthenticationInfo::AuthenticationInfo");             TRC_AUTHENTICATION, "AuthenticationInfo::AuthenticationInfo");
  
         _rep = new AuthenticationInfoRep(flag);          _rep = new AuthenticationInfoRep();
  
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
     }     }
Line 129 
Line 131 
         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
Line 153 
Line 146 
     */     */
     String getAuthenticatedUser() const     String getAuthenticatedUser() const
     {     {
         _checkRep();          CheckRep(_rep);
         return _rep->getAuthenticatedUser();         return _rep->getAuthenticatedUser();
     }     }
  
Line 162 
Line 155 
     */     */
     void   setAuthenticatedUser(const String& userName)     void   setAuthenticatedUser(const String& userName)
     {     {
         _checkRep();          CheckRep(_rep);
         _rep->setAuthenticatedUser(userName);         _rep->setAuthenticatedUser(userName);
     }     }
  
     /** Get the authentication challenge that was sent to the client  #ifdef PEGASUS_OS_ZOS
         @return string containing the authentication challenge  
       /** 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
     */     */
     String getAuthChallenge() const      void   setConnectionUser(const String& userName)
     {     {
         _checkRep();          CheckRep(_rep);
         return _rep->getAuthChallenge();          _rep->setConnectionUser(userName);
     }     }
  
     /** Sets the authentication challenge to the specified challenge  #endif
         @param challenge - string containing the authentication challenge  
       /** Get the previously authenticated password
           @return the authenticated password
     */     */
     void   setAuthChallenge(const String& challenge)      String getAuthenticatedPassword() const
     {     {
         _checkRep();          CheckRep(_rep);
         _rep->setAuthChallenge(challenge);          return _rep->getAuthenticatedPassword();
     }     }
  
     /** Get the authentication secret that was sent to client      /** Sets the authenticated password
         @return string containing the authentication secret          @param password - string containing the authenticated password
     */     */
     String getAuthSecret() const      void   setAuthenticatedPassword(const String& password)
     {     {
         _checkRep();          CheckRep(_rep);
         return _rep->getAuthSecret();          _rep->setAuthenticatedPassword(password);
     }     }
  
     /** Set the authentication secret to the specified secret      /** Get the local authentication file path that was sent to client
         @param secret - string containing the authentication secret          @return string containing the authentication file path
     */     */
     void   setAuthSecret(const String& secret)      String getLocalAuthFilePath() const
     {     {
         _checkRep();          CheckRep(_rep);
         _rep->setAuthSecret(secret);          return _rep->getLocalAuthFilePath();
     }     }
  
     /** Returns the connection type of the previous authenticated request      /** Set the local authentication file path to the specified file path
         @return true if the connection is privileged, false otherwise          @param filePath String containing the authentication file path
     */     */
     Boolean isPrivileged() const      void setLocalAuthFilePath(const String& filePath)
     {     {
         _checkRep();          CheckRep(_rep);
         return _rep->isPrivileged();          _rep->setLocalAuthFilePath(filePath);
     }     }
  
     /** Set the privileged flag to the specified value      /** Get the local authentication secret that was sent to client
         @param privileged - boolean flag indicating the connection type          @return string containing the authentication secret
     */     */
     void   setPrivileged(Boolean privileged)      String getLocalAuthSecret() const
     {     {
         _checkRep();          CheckRep(_rep);
         _rep->setPrivileged(privileged);          return _rep->getLocalAuthSecret();
       }
   
       /** Set the local authentication secret to the specified secret
           @param secret - string containing the authentication secret
       */
       void   setLocalAuthSecret(const String& secret)
       {
           CheckRep(_rep);
           _rep->setLocalAuthSecret(secret);
     }     }
  
     /** Is the request authenticated     /** Is the request authenticated
Line 225 
Line 249 
     /** 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
Line 236 
Line 260 
     */     */
     void   setAuthType(const String& authType)     void   setAuthType(const String& authType)
     {     {
         _checkRep();          CheckRep(_rep);
         _rep->setAuthType(authType);         _rep->setAuthType(authType);
     }     }
  
Line 245 
Line 269 
     */     */
     String getAuthType() const     String getAuthType() const
     {     {
         _checkRep();          CheckRep(_rep);
         return _rep->getAuthType();         return _rep->getAuthType();
     }     }
  
 private:      /**
           Set the IP address to the specified IP address
           @param string containing the IP address
       */
       void setIpAddress(const String& ipAddress)
       {
           CheckRep(_rep);
           _rep->setIpAddress(ipAddress);
       }
  
     AuthenticationInfo(AuthenticationInfoRep* rep) : _rep(rep)      /**
           Get the IP address of the connection
   
           NOTE: The IP address is for debug use only.
           It should not be used for authentication purposes.
   
           @return string containing the IP address
       */
       String getIpAddress() const
     {     {
           CheckRep(_rep);
           return _rep->getIpAddress();
       }
   
  
       Array<SSLCertificateInfo*> getClientCertificateChain()
       {
           CheckRep(_rep);
           return _rep->getClientCertificateChain();
       }
   
       void setClientCertificateChain(Array<SSLCertificateInfo*> clientCertificate)
       {
           CheckRep(_rep);
           _rep->setClientCertificateChain(clientCertificate);
       }
   
       /** Set flag to show that isRemotePrivilegedUserAccess check has been done
           this function should only be used by OpenPegasus AuthenticationHandlers
       */
       void setRemotePrivilegedUserAccessChecked()
       {
           CheckRep(_rep);
           _rep->setRemotePrivilegedUserAccessChecked();
       }
   
       /** Indicates whether the isRemotePrivilegedUserAccess check has been
           performed.  This method should only be used by OpenPegasus
           AuthenticationHandlers
       */
       Boolean getRemotePrivilegedUserAccessChecked()
       {
           CheckRep(_rep);
           return _rep->getRemotePrivilegedUserAccessChecked();
       }
   
       void setAuthHandle(const AuthHandle & authHandle)
       {
           CheckRep(_rep);
           _rep->setAuthHandle(authHandle);
       }
   
       AuthHandle getAuthHandle()
       {
           CheckRep(_rep);
           return _rep->getAuthHandle();
     }     }
  
     void _checkRep() const      void setUserRole(const String & userRole)
     {     {
         if (!_rep)          CheckRep(_rep);
             throw UninitializedHandle ();          _rep->setUserRole(userRole);
       }
   
       String getUserRole()
       {
           CheckRep(_rep);
           return _rep->getUserRole();
       }
   
       void setExpiredPassword(Boolean status)
       {
           CheckRep(_rep);
           _rep->setExpiredPassword(status);
       }
   
       Boolean isExpiredPassword() const
       {
           CheckRep(_rep);
           return _rep->isExpiredPassword();
       }
   
   private:
   
       AuthenticationInfo(AuthenticationInfoRep* rep) : _rep(rep)
       {
   
     }     }
  
     AuthenticationInfoRep* _rep;     AuthenticationInfoRep* _rep;


Legend:
Removed from v.1.10  
changed lines
  Added in v.1.41.8.3

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2