2#if defined(HAVE_CONFIG_H)
28#define RESIPROCATE_SUBSYSTEM resip::Subsystem::REPRO
36 const Data& wsCookieExtraHeaderName,
50 DebugLog(<<
"Monkey handling request: " << *
this <<
"; reqcontext = " << rc);
65 if (sipMessage->
method() == ACK ||
66 sipMessage->
method() == BYE)
72 sipMessage->
header(h_From).isAllContacts() )
74 InfoLog(<<
"Malformed From header: cannot verify against cookie. Rejecting.");
95 WarningLog(<<
"mWsCookieExtraHeader does not match wsCookieContext value");
143 DebugLog(<<
"Matched cookie source URI field" << wsFromUri <<
" against request From header field URI " << fromUri);
152 DebugLog(<<
"Matched cookie destination URI field" << wsDestUri <<
" against request To header field URI " << toUri);
164 os <<
"CookieAuthentication monkey" << std::endl;
#define WarningLog(args_)
virtual void dump(EncodeStream &os) const
CookieAuthenticator(const Data &wsCookieAuthSharedSecret, const Data &wsCookieExtraHeaderName, resip::SipStack *stack)
bool cookieUriMatch(const resip::Uri &first, const resip::Uri &second)
virtual processor_action_t process(RequestContext &)
std::unique_ptr< resip::ExtensionHeader > mWsCookieExtraHeader
bool authorizedForThisIdentity(const MethodTypes method, const WsCookieContext &wsCookieContext, resip::Uri &fromUri, resip::Uri &toUri)
resip::Message * getCurrentEvent()
Returns the event that we are currently working on.
void sendResponse(resip::SipMessage &response)
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
static void makeResponse(SipMessage &response, const SipMessage &request, int responseCode, const Data &reason=Data::Empty, const Data &hostname=Data::Empty, const Data &warning=Data::Empty)
Make a response to a provided request.
bool isWellFormed() const
Returns true iff this element was parsed successfully, according to the implementation of parse().
The base-class used for message-passing.
Container class for ParserCategory, used by SipMessage to represent multi-valued headers (Contact,...
T & front()
Returns the first header field value in this container.
Represents a SIP message.
const Tuple & getReceivedTransportTuple() const
const RequestLine & header(const RequestLineType &l) const
Returns the RequestLine. This is only valid for request messages.
bool exists(const HeaderBase &headerType) const
Returns true if the given header field is present, false otherwise.
std::shared_ptr< WsCookieContext > getWsCookieContext() const noexcept
resip::MethodTypes method() const
returns the method type of the message
This is the primary point of interaction between the app-layer and the stack.
Represents the "header-value" element in the RFC 3261 grammar (ie, an unknown header field value).
const Data & value() const
bool isMyDomain(const Data &domain) const
Returns true iff domain matches one of the domains that this TransactionUser is responsible for.
TransportType getType() const
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Data getWsSessionExtra() const
time_t getExpiresTime() const
This Class is used to implement a primitive form of RPC using loose XML formatting.
dcm! – add UnusedChecking(_enum) below;
bool isEqualNoCase(const Data &left, const Data &right)
bool isWebSocket(TransportType type)
Returns true if passed in transport type is a WebSocket transport protocol.
RequestLineType h_RequestLine