|
||||
File indexing completed on 2025-01-18 09:55:12
0001 /* 0002 * This File is part of Davix, The IO library for HTTP based protocols 0003 * Copyright (C) CERN 2013 0004 * Author: Adrien Devresse <adrien.devresse@cern.ch> 0005 * 0006 * This library is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU Lesser General Public 0008 * License as published by the Free Software Foundation; either 0009 * version 2.1 of the License, or (at your option) any later version. 0010 * 0011 * This library is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 * Lesser General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU Lesser General Public 0017 * License along with this library; if not, write to the Free Software 0018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 0019 * 0020 */ 0021 #ifndef DAVIX_AUTH_HPP 0022 #define DAVIX_AUTH_HPP 0023 0024 0025 #include <string> 0026 #include <vector> 0027 0028 #include "../utils/davix_types.hpp" 0029 #include "davixx509cred.hpp" 0030 0031 0032 #ifndef __DAVIX_INSIDE__ 0033 #error "Only davix.hpp for the C++ API or davix.h for the C API should be included." 0034 #endif 0035 0036 /// @file davixauth.hpp 0037 /// @brief Authentication support for davix 0038 /// support for client cert x509, login password, S3 tokens 0039 0040 0041 namespace Davix { 0042 0043 class SessionInfoInternal; 0044 class DavixCopyInternal; 0045 class NEONSession; 0046 class StandaloneCurlRequest; 0047 0048 /// @class SessionInfo 0049 /// @brief server related info 0050 class DAVIX_EXPORT SessionInfo: NonCopyable { 0051 public: 0052 std::vector<std::string> & getReadableDN() const; 0053 0054 private: 0055 SessionInfo(); 0056 SessionInfoInternal* data; 0057 friend class NEONSession; 0058 friend class StandaloneCurlRequest; 0059 friend class DavixDelegation; 0060 }; 0061 0062 0063 #ifdef __DAVIX_HAS_STD_FUNCTION 0064 0065 /// 0066 /// std::function for advanced authentication with client cert X509 0067 /// 0068 /// @param info : Session info, contains information about server requesting the certificate 0069 /// @param cert : Client side credential to provide 0070 /// @return 0 if client cert is provider with success, can throw DavixException if error occurs 0071 typedef std::function<int (const SessionInfo & info, X509Credential& cert)> authFunctionClientCertX509; 0072 0073 #endif 0074 0075 0076 /// 0077 /// callback for advanced authentication with client cert X509 0078 /// @param userdata : user defined data 0079 /// @param info : Session info, contains information about server requesting the certificate 0080 /// @param cert : Client side credential to provide 0081 /// @param err : error object to set if an error occures 0082 /// @return MUST return 0 if credential if provided with success or != 0 if error occures 0083 typedef int (*authCallbackClientCertX509)(void* userdata, const SessionInfo & info, X509Credential * cert, DavixError** err); 0084 0085 0086 /// 0087 /// callback for advanced authentication with client cert X509 0088 /// @param userdata : user defined data 0089 /// @param info : Session info, contains information about server requesting the certificate 0090 /// @param login : login to use 0091 /// @param password : password to use 0092 /// @param count : number of try 0093 /// @return MUST return 0 if success, or !=0 if an error has occures 0094 typedef int (*authCallbackLoginPasswordBasic)(void* userdata, const SessionInfo & info, std::string & login, std::string & password, 0095 int count, DavixError** err); 0096 0097 0098 /// \cond PRIVATE_SYMBOLS 0099 std::string getAwsAuthorizationField(const std::string & stringToSign, const std::string & private_key, const std::string & access_key); 0100 /// \endcond PRIVATE_SYMBOLS 0101 0102 } // namespace Davix 0103 0104 #endif // DAVIX_AUTHOBJECT_HPP
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |