reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ReproServerAuthManager.cxx
Go to the documentation of this file.
1#include "rutil/ResipAssert.h"
2
3#include "rutil/AsyncBool.hxx"
8#include "repro/UserStore.hxx"
9#include "repro/AclStore.hxx"
10
11#define RESIPROCATE_SUBSYSTEM Subsystem::REPRO
12
13using namespace resip;
14using namespace repro;
15
16
18 Dispatcher* authRequestDispatcher,
19 AclStore& aclDb,
20 bool useAuthInt,
21 bool rejectBadNonces,
22 bool challengeThirdParties,
23 const Data& staticRealm,
24 const std::vector<DigestType>& challengeDigestTypes):
25 ServerAuthManager(dum, dum.dumIncomingTarget(), challengeThirdParties, staticRealm, challengeDigestTypes),
26 mDum(dum),
27 mAuthRequestDispatcher(authRequestDispatcher),
28 mAclDb(aclDb),
29 mUseAuthInt(useAuthInt),
30 mRejectBadNonces(rejectBadNonces)
31{
32}
33
37
38bool
40{
41 return mUseAuthInt;
42}
43
44bool
46{
47 return mRejectBadNonces;
48}
49
52{
54 if(!mAclDb.isRequestTrusted(msg))
55 {
57 }
58 else
59 {
60 return False;
61 }
62}
63
64void
66 const Data& realm,
67 const SipMessage& msg,
68 const Auth& auth,
69 const Data& transactionId )
70{
71 // Build a UserAuthInfo object and pass to UserAuthGrabber to have a1 password filled in
72 UserAuthInfo* async = new UserAuthInfo(user,realm,transactionId,&mDum);
73 std::unique_ptr<ApplicationMessage> app(async);
74 mAuthRequestDispatcher->post(app);
75}
76
77
78/* ====================================================================
79 * The Vovida Software License, Version 1.0
80 *
81 * Copyright (c) 2026 SIP Spectrum, Inc. https://www.sipspectrum.com
82 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
83 *
84 * Redistribution and use in source and binary forms, with or without
85 * modification, are permitted provided that the following conditions
86 * are met:
87 *
88 * 1. Redistributions of source code must retain the above copyright
89 * notice, this list of conditions and the following disclaimer.
90 *
91 * 2. Redistributions in binary form must reproduce the above copyright
92 * notice, this list of conditions and the following disclaimer in
93 * the documentation and/or other materials provided with the
94 * distribution.
95 *
96 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
97 * and "Vovida Open Communication Application Library (VOCAL)" must
98 * not be used to endorse or promote products derived from this
99 * software without prior written permission. For written
100 * permission, please contact vocal@vovida.org.
101 *
102 * 4. Products derived from this software may not be called "VOCAL", nor
103 * may "VOCAL" appear in their name, without prior written
104 * permission of Vovida Networks, Inc.
105 *
106 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
107 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
108 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
109 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
110 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
111 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
112 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
113 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
114 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
115 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
116 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
117 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
118 * DAMAGE.
119 *
120 * ====================================================================
121 *
122 * This software consists of voluntary contributions made by Vovida
123 * Networks, Inc. and many individuals on behalf of Vovida Networks,
124 * Inc. For more information on Vovida Networks, Inc., please see
125 * <http://www.vovida.org/>.
126 *
127 */
#define resip_assert(x)
This file needs to work for both C and C++ code.
bool isRequestTrusted(const resip::SipMessage &request)
Definition AclStore.cxx:532
virtual void requestCredential(const resip::Data &user, const resip::Data &realm, const resip::SipMessage &msg, const resip::Auth &auth, const resip::Data &transactionId)
virtual resip::AsyncBool requiresChallenge(const resip::SipMessage &msg)
should return true if the request must be challenged The default is to challenge all requests - overr...
ReproServerAuthManager(resip::DialogUsageManager &dum, resip::Dispatcher *authRequestDispatcher, AclStore &aclDb, bool useAuthInt, bool rejectBadNonces, bool challengeThirdParties, const resip::Data &staticRealm=resip::Data::Empty, const std::vector< resip::DigestType > &challengeDigestTypes=std::vector< resip::DigestType >())
Represents the "credentials" and "challenge" elements in the SIP grammar.
Definition Auth.hxx:18
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
A generic thread-bank class.
virtual bool post(std::unique_ptr< resip::ApplicationMessage > &work)
Posts a message to this thread bank.
virtual AsyncBool requiresChallenge(const SipMessage &msg)
should return true if the request must be challenged The default is to challenge all requests - overr...
Represents a SIP message.
bool isRequest() const
Returns true if message is a request, false otherwise.
This Class is used to implement a primitive form of RPC using loose XML formatting.
dcm! – add UnusedChecking(_enum) below;