Panda3D
 All Classes Functions Variables Enumerations
httpBasicAuthorization.h
1 // Filename: httpBasicAuthorization.h
2 // Created by: drose (22Oct02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef HTTPBASICAUTHORIZATION_H
16 #define HTTPBASICAUTHORIZATION_H
17 
18 #include "pandabase.h"
19 
20 // This module requires OpenSSL to compile, even though it doesn't
21 // actually use any OpenSSL code, because it is a support module for
22 // HTTPChannel, which *does* use OpenSSL code.
23 
24 #ifdef HAVE_OPENSSL
25 
26 #include "httpAuthorization.h"
27 
28 ////////////////////////////////////////////////////////////////////
29 // Class : HTTPBasicAuthorization
30 // Description : Implements the "Basic" type of HTTP authorization.
31 // This authorization sends usernames and passwords over
32 // the net in cleartext, so it's not much in the way of
33 // security, but it's easy to implement and therefore
34 // widely supported.
35 ////////////////////////////////////////////////////////////////////
36 class HTTPBasicAuthorization : public HTTPAuthorization {
37 public:
38  HTTPBasicAuthorization(const Tokens &tokens, const URLSpec &url,
39  bool is_proxy);
40  virtual ~HTTPBasicAuthorization();
41 
42  virtual const string &get_mechanism() const;
43  virtual string generate(HTTPEnum::Method method, const string &request_path,
44  const string &username, const string &body);
45 
46 private:
47  static const string _mechanism;
48 };
49 
50 #include "httpBasicAuthorization.I"
51 
52 #endif // HAVE_OPENSSL
53 
54 #endif
55 
A container for a URL, e.g.
Definition: urlSpec.h:29