polarity-integration-utils
    Preparing search index...

    Interface NetworkContext

    Per-integration network configuration provided on every dispatch via context.network.

    Contains tier-1 (per-integration) TLS and proxy overrides configured by the Polarity admin. Global and host proxy settings are handled transparently via the worker environment and do not appear here.

    1. Tier 1 — Per-integration → surfaces on context.network
    2. Tier 2 — Global Proxy Settings → worker env (HTTPS_PROXY, etc.)
    3. Tier 3 — Host env → inherited by worker subprocess
    • Do not cache HTTP clients across dispatches — settings may change between dispatches when an admin updates the configuration.
    • Do not set process.env.HTTP_PROXY or process.env.NODE_TLS_REJECT_UNAUTHORIZED at runtime — this is racy on shared workers and leaks settings between integrations.
    • When proxy is absent, do nothing — the worker env carries tier 2/3 and most HTTP clients pick it up natively.
    async function doLookup(entities, options, context) {
    const proxyUrl = context.network.proxy?.https ?? context.network.proxy?.http;
    const rejectUnauthorized = context.network.rejectUnauthorized !== false;
    // Wire proxyUrl and rejectUnauthorized into your HTTP client
    }
    async function doLookup(entities, options, context) {
    const proxy = context.network.proxy?.https ?? context.network.proxy?.http;
    const client = request.defaults({
    ...(proxy && { proxy }),
    ...(context.network.rejectUnauthorized === false && {
    strictSSL: false,
    rejectUnauthorized: false,
    }),
    });
    }
    async function doLookup(entities, options, context) {
    const proxyUrl = context.network.proxy?.https ?? context.network.proxy?.http;
    const config: AxiosRequestConfig = {};
    if (proxyUrl) {
    const u = new URL(proxyUrl);
    config.proxy = {
    protocol: u.protocol.replace(':', ''),
    host: u.hostname,
    port: Number(u.port) || (u.protocol === 'https:' ? 443 : 80),
    ...(u.username && { auth: { username: u.username, password: u.password } }),
    };
    }
    if (context.network.rejectUnauthorized === false) {
    config.httpsAgent = new https.Agent({ rejectUnauthorized: false });
    }
    }
    interface NetworkContext {
        proxy?: NetworkProxy;
        rejectUnauthorized: boolean;
    }
    Index
    proxy?: NetworkProxy

    Per-integration proxy override (tier 1).

    Omitted entirely when no per-integration proxy is configured. When absent, HTTP clients should use their default behavior (which will pick up tier 2/3 from the worker environment).

    rejectUnauthorized: boolean

    Whether outbound TLS certificates should be verified.

    • true (default) — enforce certificate validation.
    • false — skip TLS certificate verification. Corresponds to the integration's "Allow Unauthorized TLS Certificates" admin setting.

    Always present — TLS strictness is meaningful regardless of proxy config.