UserRequest.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #ifndef SQUID_SRC_AUTH_DIGEST_USERREQUEST_H
10 #define SQUID_SRC_AUTH_DIGEST_USERREQUEST_H
11 
12 #if HAVE_AUTH_MODULE_DIGEST
13 
14 #include "auth/digest/Config.h"
15 #include "auth/UserRequest.h"
16 
17 class ConnStateData;
18 class HttpReply;
19 class HttpRequest;
20 
21 namespace Auth
22 {
23 namespace Digest
24 {
25 
29 class UserRequest : public Auth::UserRequest
30 {
31  MEMPROXY_CLASS(Auth::Digest::UserRequest);
32 
33 public:
34  UserRequest();
35  ~UserRequest() override;
36 
37  void authenticate(HttpRequest * request, ConnStateData * conn, Http::HdrType type) override;
38  Direction module_direction() override;
39  void addAuthenticationInfoHeader(HttpReply * rep, int accel) override;
40 #if WAITING_FOR_TE
41  virtual void addAuthenticationInfoTrailer(HttpReply * rep, int accel);
42 #endif
43 
44  void startHelperLookup(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB *, void *) override;
45  const char *credentialsStr() override;
46 
47  char *noncehex; /* "dcd98b7102dd2f0e8b11d0f600bfb0c093" */
48  char *cnonce; /* "0a4f113b" */
49  char *realm; /* = "testrealm@host.com" */
50  char *pszPass; /* = "Circle Of Life" */
51  char *algorithm; /* = "md5" */
52  char nc[9]; /* = "00000001" */
53  char *pszMethod; /* = "GET" */
54  char *qop; /* = "auth" */
55  char *uri; /* = "/dir/index.html" */
56  char *response;
57 
58  struct {
59  bool authinfo_sent;
60  bool invalid_password;
61  bool helper_queried;
62  } flags;
63  digest_nonce_h *nonce;
64 
65 private:
66  static HLPCB HandleReply;
67 };
68 
69 } // namespace Digest
70 } // namespace Auth
71 
72 #endif /* HAVE_AUTH_MODULE_DIGEST */
73 #endif /* SQUID_SRC_AUTH_DIGEST_USERREQUEST_H */
74 
HTTP Authentication.
Definition: Config.h:18
static void authenticate(int socket_fd, const char *username, const char *passwd)
Direction
Definition: UserRequest.h:64
#define MEMPROXY_CLASS(CLASS)
void HLPCB(void *, const Helper::Reply &)
Definition: forward.h:33
void AUTHCB(void *)
Definition: UserRequest.h:57

 

Introduction

Documentation

Support

Miscellaneous