8#include "QtCore/qbuffer.h"
9#include "QtCore/qlist.h"
10#include "QtCore/qurl.h"
11#include "QtCore/QMutexLocker"
12#include "QtNetwork/qauthenticator.h"
36 iterator
it = std::lower_bound(
begin(),
end(), domain);
53 newCredential.
domain = domain;
54 newCredential.
user = user;
64 virtual void dispose()
override {
delete this; }
67#ifndef QT_NO_NETWORKPROXY
74 key.setScheme(
"proxy-socks5"_L1);
79 key.setScheme(
"proxy-http"_L1);
83 key.setScheme(
"proxy-ftp"_L1);
95 if (
key.scheme().isEmpty())
102 key.setFragment(realm);
103 return "auth:" +
key.toEncoded();
110 copy.setFragment(realm);
115#ifndef QT_NO_NETWORKPROXY
172 realm = authenticator->
realm();
188 "Internal inconsistency: found a cache key for a proxy, but it's empty");
198 if (authenticator->
isNull())
207 copy.setUserName(authenticator->
user());
221 if (
copy.userName().isEmpty()) {
249 realm = authentication->
realm();
261 if (cred != auth->end())
The QAuthenticator class provides an authentication object.
QString user() const
Returns the user used for authentication.
QString password() const
Returns the password used for authentication.
QString realm() const
Returns the realm requiring authentication.
bool isNull() const
Returns true if the object has not been initialized.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
bool isEmpty() const noexcept
iterator insert(qsizetype i, parameter_type t)
void reserve(qsizetype size)
void cacheCredentials(const QUrl &url, const QAuthenticator *auth)
QNetworkAuthenticationCredential fetchCachedCredentials(const QUrl &url, const QAuthenticator *auth=nullptr)
Fetch the credential data from the credential cache.
QNetworkAuthenticationCredential fetchCachedProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth=nullptr)
QNetworkAccessCache authenticationCache
void cacheProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth)
void setShareable(bool enable)
void setExpires(bool enable)
bool hasEntry(const QByteArray &key) const
CacheableObject * requestEntryNow(const QByteArray &key)
void addEntry(const QByteArray &key, CacheableObject *entry, qint64 connectionCacheExpiryTimeoutSeconds=-1)
void releaseEntry(const QByteArray &key)
iterator findClosestMatch(const QString &domain)
void insert(const QString &domain, const QString &user, const QString &password)
virtual void dispose() override
QNetworkAuthenticationCache()
The QNetworkProxy class provides a network layer proxy.
static QNetworkProxy applicationProxy()
Returns the application level network proxying.
QString user() const
Returns the user name used for authentication.
void setUser(const QString &userName)
Sets the user name for proxy authentication to be user.
QNetworkProxy::ProxyType type() const
Returns the proxy type for this instance.
QString password() const
Returns the password used for authentication.
QString hostName() const
Returns the host name of the proxy host.
quint16 port() const
Returns the port of the proxy host.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void clear()
Clears the contents of the string and makes it null.
bool isNull() const
Returns true if this string is null; otherwise returns false.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString password(ComponentFormattingOptions=FullyDecoded) const
Returns the password of the URL if it is defined; otherwise an empty string is returned.
QString path(ComponentFormattingOptions options=FullyDecoded) const
Returns the path of the URL.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static jboolean copy(JNIEnv *, jobject)
static int closestMatch(QRgb pixel, const QList< QRgb > &clut)
static QByteArray proxyAuthenticationKey(const QNetworkProxy &proxy, const QString &realm)
static QByteArray authenticationKey(const QUrl &url, const QString &realm)
#define Q_ASSERT_X(cond, x, msg)
QUrl url("example.com")
[constructor-url-reference]