Capability first · transport second

ArcaneNetworkPolicy.js

Validates the Arcane domain/network deny policy and matches domain, IPv4/IPv6 CIDR, protocol, and port rules.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
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

JavaScript
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

BindingFormDeclaration or signatureParameter syntax
ARCANE_NETWORK_POLICY_SCHEMA_VERSIONvariable · valuevariable ARCANE_NETWORK_POLICY_SCHEMA_VERSION
ARCANE_NETWORK_POLICY_URLvariable · valuevariable ARCANE_NETWORK_POLICY_URL
canonicalNetworkHostnamefunctionfunction canonicalNetworkHostname(value)value
validateArcaneNetworkPolicyfunctionfunction validateArcaneNetworkPolicy(value)value
findDeniedDomainRulefunctionfunction findDeniedDomainRule(policy,hostnameOrUrl)policy,hostnameOrUrl
findDeniedNetworkRulefunctionfunction findDeniedNetworkRule(policy,ipLiteral,context)policy,ipLiteral,context
invalidateArcaneNetworkPolicyCachefunctionfunction invalidateArcaneNetworkPolicyCache()
loadArcaneNetworkPolicyfunctionasync 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}={}
emptyArcaneNetworkPolicyfunctionfunction 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_INVALID
  • ARCANE_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

JavaScript
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'));

No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.