11#define RESIPROCATE_SUBSYSTEM Subsystem::DUM
13const resip::NameAddr UserProfile::mAnonymous(
"\"Anonymous\" <sip:anonymous@anonymous.invalid>",
true );
18 mClientOutboundEnabled(false),
19 mDigestCacheUseLimit(0)
27 mClientOutboundEnabled(false),
28 mDigestCacheUseLimit(0)
38std::shared_ptr<UserProfile>
41 std::shared_ptr<UserProfile> anon(this->
clone());
42 anon->setDefaultFrom(mAnonymous);
73 mServiceRoute = sRoute;
85 return !mInstanceId.
empty();
136 mDigestCredentials.clear();
144 DebugLog (<<
"Adding credential: " << cred);
145 mDigestCredentials.erase(cred);
146 mDigestCredentials.insert(cred);
153 if(mDigestCredentials.empty())
156 WarningLog(<<
"No digest credentials available");
160 DigestCredentials::const_iterator it = mDigestCredentials.find(
DigestCredential(realm));
161 if (it == mDigestCredentials.end())
163 DebugLog(<<
"Didn't find credential for realm: " << realm <<
" " << *mDigestCredentials.begin());
164 return *mDigestCredentials.begin();
168 DebugLog(<<
"Found credential for realm: " << *it << realm);
177 isPasswordA1Hash(pwdA1Hash)
184 password(
Data::Empty),
185 isPasswordA1Hash(false)
192 password(
Data::Empty),
193 isPasswordA1Hash(false)
200 return realm < rhs.
realm;
206 strm <<
"UserProfile: " << profile.mDefaultFrom <<
Inserter(profile.mDigestCredentials);
213 strm <<
"realm=" << cred.
realm <<
" user=" << cred.
user ;
#define WarningLog(args_)
#define resip_assert(x)
This file needs to work for both C and C++ code.
static const UserProfile::DigestCredential emptyDigestCredential
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
bool empty() const noexcept
Checks whether the Data is empty.
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
virtual NameAddr & getGruu(const Data &aor)
virtual NameAddrs & getServiceRoute() noexcept
virtual void setInstanceId(const Data &id)
virtual bool hasGruu(const Data &aor) const
virtual void setDigestCredential(const Data &realm, const Data &user, const Data &password, bool isPasswordA1Hash=false)
For the password you may either provide the plain text password (isPasswordA1Hash = false) or the Dig...
virtual bool hasInstanceId()
virtual const Data & getInstanceId() const noexcept
virtual const DigestCredential & getDigestCredential(const Data &realm)
virtual std::shared_ptr< UserProfile > getAnonymousUserProfile() const
virtual UserProfile * clone() const
virtual void setServiceRoute(const NameAddrs &sRoute)
virtual void clearDigestCredentials() noexcept
The following functions deal with clearing, setting and getting of digest credentals.
virtual void setDefaultFrom(const NameAddr &from)
virtual NameAddr & getDefaultFrom() noexcept
virtual void addGruu(const Data &aor, const NameAddr &contact)
dcm! – add UnusedChecking(_enum) below;
InserterClass< T > Inserter(const T &t)
Templatized function to construct an instance of InserterClass for a container to be inserted.
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)
bool operator<(const DigestCredential &rhs) const