On this page
Overview
Validates the Arcane domain/network deny policy and matches domain, IPv4/IPv6 CIDR, protocol, and port rules.
- Artifact
ArcaneNetworkPolicy.js· esm - Classification
public first party - Availability
Cross-host - Normalization
Strict coded normalization.
Import and lifecycle
import * as module from '/arcane/modules/ArcaneNetworkPolicy.js';
Validation and matching are pure; loadArcaneNetworkPolicy(options) fetches same-origin policy with a timeout and caches only the default load until invalidated.
Application-facing behavior: Policy constants plus validate/load/cache/match helpers.
Protocol and host implementation
Same-origin policy fetch This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
ARCANE_NETWORK_POLICY_SCHEMA_VERSION | variable · value | variable ARCANE_NETWORK_POLICY_SCHEMA_VERSION | — |
ARCANE_NETWORK_POLICY_URL | variable · value | variable ARCANE_NETWORK_POLICY_URL | — |
canonicalNetworkHostname | function | function canonicalNetworkHostname(value) | value |
validateArcaneNetworkPolicy | function | function validateArcaneNetworkPolicy(value) | value |
findDeniedDomainRule | function | function findDeniedDomainRule(policy,hostnameOrUrl) | policy,hostnameOrUrl |
findDeniedNetworkRule | function | function findDeniedNetworkRule(policy,ipLiteral,context) | policy,ipLiteral,context |
invalidateArcaneNetworkPolicyCache | function | function invalidateArcaneNetworkPolicyCache() | — |
loadArcaneNetworkPolicy | function | async function loadArcaneNetworkPolicy({url=ARCANE_NETWORK_POLICY_URL,fetchImpl=globalThis.fetch,refresh=false,timeoutMs=DEFAULT_POLICY_LOAD_TIMEOUT_MS}={}) | {url=ARCANE_NETWORK_POLICY_URL,fetchImpl=globalThis.fetch,refresh=false,timeoutMs=DEFAULT_POLICY_LOAD_TIMEOUT_MS}={} |
emptyArcaneNetworkPolicy | function | function emptyArcaneNetworkPolicy() | — |
Parameter meanings and results
validateArcaneNetworkPolicy(value) returns a frozen indexed schema-v1 policy. Domain and network matchers return the first applicable normalized rule or null, with protocol and port-aware CIDR matching.
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
This artifact has no additional documented lifecycle event flow.
Direct coded failures
ARCANE_NETWORK_POLICY_INVALIDARCANE_NETWORK_POLICY_QUERY_INVALID
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- ARCANE_NETWORK_POLICY_INVALID
- ARCANE_NETWORK_POLICY_QUERY_INVALID
- uncoded Error messages prefixed ARCANE_NETWORK_POLICY_LOAD_FAILED or ARCANE_NETWORK_POLICY_LOAD_TIMEOUT
Availability and capabilities
Cross-host. Strict coded normalization.
Canonical shared deny-policy layer usable by browser and native enforcement; it supplies decisions, not socket enforcement.
Contract example
import {canonicalNetworkHostname, validateArcaneNetworkPolicy, findDeniedDomainRule} from '/arcane/modules/ArcaneNetworkPolicy.js';
const policy=validateArcaneNetworkPolicy({
schemaVersion:1,
generation:1,
domainRules:[],
networkRules:[]
});
console.log(canonicalNetworkHostname('EXAMPLE.COM.'),findDeniedDomainRule(policy,'example.com'));
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.