Panda3D

httpBasicAuthorization.h

00001 // Filename: httpBasicAuthorization.h
00002 // Created by:  drose (22Oct02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef HTTPBASICAUTHORIZATION_H
00016 #define HTTPBASICAUTHORIZATION_H
00017 
00018 #include "pandabase.h"
00019 
00020 // This module requires OpenSSL to compile, even though it doesn't
00021 // actually use any OpenSSL code, because it is a support module for
00022 // HTTPChannel, which *does* use OpenSSL code.
00023 
00024 #ifdef HAVE_OPENSSL
00025 
00026 #include "httpAuthorization.h"
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //       Class : HTTPBasicAuthorization
00030 // Description : Implements the "Basic" type of HTTP authorization.
00031 //               This authorization sends usernames and passwords over
00032 //               the net in cleartext, so it's not much in the way of
00033 //               security, but it's easy to implement and therefore
00034 //               widely supported.
00035 ////////////////////////////////////////////////////////////////////
00036 class HTTPBasicAuthorization : public HTTPAuthorization {
00037 public:
00038   HTTPBasicAuthorization(const Tokens &tokens, const URLSpec &url,
00039                          bool is_proxy);
00040   virtual ~HTTPBasicAuthorization();
00041 
00042   virtual const string &get_mechanism() const;
00043   virtual string generate(HTTPEnum::Method method, const string &request_path,
00044                           const string &username, const string &body);
00045 
00046 private:
00047   static const string _mechanism;
00048 };
00049 
00050 #include "httpBasicAuthorization.I"
00051 
00052 #endif  // HAVE_OPENSSL
00053 
00054 #endif
00055 
 All Classes Functions Variables Enumerations