GUI-thread HTTP policy adapter; settings and parent must outlive requests.
More...
#include <extensionnetwork.h>
|
| | ExtensionNetwork (QSettings *settings, QObject *parent=nullptr) |
| | Construct a policy client.
|
| |
| bool | allowed (const QUrl &url) const override |
| | Test a destination without making a request.
|
| |
| QNetworkAccessManager * | shared () override |
| | Obtain the policy-enforcing network manager.
|
| |
| virtual | ~INetworkPolicy ()=default |
| | Destroy an implementation; extensions never delete the host-owned service.
|
| |
|
| QNetworkReply * | createRequest (Operation operation, const QNetworkRequest &request, QIODevice *outgoingData=nullptr) override |
| | Validate and normalize an outgoing Qt request before any IO.
|
| |
GUI-thread HTTP policy adapter; settings and parent must outlive requests.
◆ ExtensionNetwork()
| openswmmvis::ExtensionNetwork::ExtensionNetwork |
( |
QSettings * |
settings, |
|
|
QObject * |
parent = nullptr |
|
) |
| |
|
explicit |
Construct a policy client.
- Parameters
-
| [in] | settings | Required borrowed host settings, read under extensions/network/. |
| [in] | parent | Optional QObject owner. |
◆ allowed()
| bool openswmmvis::ExtensionNetwork::allowed |
( |
const QUrl & |
url | ) |
const |
|
overridevirtual |
Test a destination without making a request.
- Parameters
-
| [in] | url | HTTPS destination; credentials embedded in URLs are refused. |
- Returns
- False in offline mode, for unsupported schemes or outside an explicit host allowlist.
Implements OpenSWMM::Sdk::INetworkPolicy.
◆ createRequest()
| QNetworkReply * openswmmvis::ExtensionNetwork::createRequest |
( |
Operation |
operation, |
|
|
const QNetworkRequest & |
request, |
|
|
QIODevice * |
outgoingData = nullptr |
|
) |
| |
|
overrideprotected |
Validate and normalize an outgoing Qt request before any IO.
- Parameters
-
| [in] | operation | Qt request verb. |
| [in] | request | Requested URL and headers, copied before redirect policy is changed. |
| [in] | outgoingData | Optional body device borrowed by Qt for the request lifetime. |
- Returns
- Qt-owned normal reply or an asynchronous policy-refusal reply.
◆ shared()
| QNetworkAccessManager * openswmmvis::ExtensionNetwork::shared |
( |
| ) |
|
|
inlineoverridevirtual |
Obtain the policy-enforcing network manager.
- Returns
- Borrowed GUI-thread manager; replies are caller-owned under Qt conventions.
- Note
- Requests and manually followed redirects are checked before network IO.
Implements OpenSWMM::Sdk::INetworkPolicy.
The documentation for this class was generated from the following files: