+/*
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
#ifndef _SQUID_SRC_AUTH_NEGOTIATE_USERREQUEST_H
#define _SQUID_SRC_AUTH_NEGOTIATE_USERREQUEST_H
+#if HAVE_AUTH_MODULE_NEGOTIATE
+
#include "auth/UserRequest.h"
-#include "MemPool.h"
+#include "helper/forward.h"
+#include "helper/ReservationId.h"
class ConnStateData;
class HttpReply;
class HttpRequest;
-class helper_stateful_server;
-/// \ingroup AuthNegotiateAPI
-class AuthNegotiateUserRequest : public AuthUserRequest
+namespace Auth
+{
+namespace Negotiate
{
-public:
- MEMPROXY_CLASS(AuthNegotiateUserRequest);
+class UserRequest : public Auth::UserRequest
+{
+ MEMPROXY_CLASS(Auth::Negotiate::UserRequest);
- AuthNegotiateUserRequest();
- virtual ~AuthNegotiateUserRequest();
+public:
+ UserRequest();
+ virtual ~UserRequest();
virtual int authenticated() const;
- virtual void authenticate(HttpRequest * request, ConnStateData * conn, http_hdr_type type);
- virtual Auth::Direction module_direction();
- virtual void onConnectionClose(ConnStateData *);
- virtual void module_start(RH *, void *);
-
- virtual void addAuthenticationInfoHeader(HttpReply * rep, int accel);
+ virtual void authenticate(HttpRequest * request, ConnStateData * conn, Http::HdrType type);
+ virtual Direction module_direction();
+ virtual void startHelperLookup(HttpRequest *request, AccessLogEntry::Pointer &al, AUTHCB *, void *);
+ virtual const char *credentialsStr();
virtual const char * connLastHeader();
- /* we need to store the helper server between requests */
- helper_stateful_server *authserver;
void releaseAuthServer(void); ///< Release the authserver helper server properly.
/* what connection is this associated with */
/* need access to the request flags to mess around on pconn failure */
HttpRequest *request;
+ /// a helper-issued reservation locking the helper state between
+ /// HTTP requests
+ Helper::ReservationId reservationId;
private:
- static HLPSCB HandleReply;
+ static HLPCB HandleReply;
};
-MEMPROXY_CLASS_INLINE(AuthNegotiateUserRequest);
+} // namespace Negotiate
+} // namespace Auth
+#endif /* HAVE_AUTH_MODULE_NEGOTIATE */
#endif /* _SQUID_SRC_AUTH_NEGOTIATE_USERREQUEST_H */
+