Skip to main content

CDN Mapping

Provides a JS library @ds-ukassel/cdns to identify CDNs. All CDNs are listed in cdns.yaml in this repository, and dist/cdns.json in the package.

YAML Format

- name: AwesomeCDN
  homepage: https://www.awesomecdn.com
  type: commercial
  domains: # See "Domain patterns" below
    - 'awesomecdn.com'      # 'awesomecdn.com' is a full match of the domain (e.g. 'awesomecdn.com')
    - '**awesomecdn**'      # 'awesomecdn' is a substring of the domain (e.g. 'a.awessomecdn.com')
    - '*.cdn.awesome.com'   # '*' is a wildcard for a single domain level (e.g. 'a.cdn.awesome.com' or 'b.cdn.awesome.com')
    - '**.awesomecdn.*'     # '**' is a wildcard for one or more domain levels (e.g. 'a.b.awesomecdn.de' or 'c.d.e.awesomecdn.com')
  ranges:
    - range_type: 'ipv4'
      url: 'https://api.awesomecdn.com/ips-v4/'
    - range_type: 'ipv6'
      url: 'https://api.awesomecdn.com/ips-v6/'
    - range_type: 'combined'
      url: 'https://api.awesomecdn.com/ips/'
    - range_type: 'ipv4'
      ranges:
        - '111.111.111.111/32'
      last_updated: 1970-01-01
  asns:
    - 12345
    - 67890
  headers: # See "Header Patterns" below
    - X-AwesomeCDN:         # 'X-AwesomeCDN' header must be present
    - Server: AwesomeCDN    # 'Server' header must contain 'AwesomeCDN'
    - X-Cache: HIT          # 'X-Cache' header must contain 'HIT'
      X-Whatever:           # AND 'X-Whatever' header must be present

Domain Wildcard Syntax

When implementing the wildcard syntax for domains, the following rules apply:

  • * matches a single domain level
    • *.example.com matches abc.example.com
    • *.example.com does not match abc.def.example.com
  • ** matches one or more domain levels or any prefix
    • **.example.com matches a.example.com and b.c.example.com
    • **example.com matches example.com, a.example.com, and b.c.example.com

* and ** can appear anywhere in the domain string, including the beginning, middle, or end.

Regex Equivalents

  • * is equivalent to [^.]+ (matches any character except dots, one or more times)

  • ** is equivalent to .* (matches any character, including dots, zero or more times)

  • All special characters are escaped, e.g. . turns into \..

  • The regex receives the prefix ^ and suffix $.

Examples

  • **example.com -> ^.*example\.com$
  • *.example.com -> ^[^.]+\.example\.com$

Header Patterns

Header patterns have a few rules:

  • Header: (JSON: {"Header": null}) means the header must be present, but can have any value.
  • Header: foo (JSON: {"Header": "foo"}) means the header must be present and equal the value.
  • Multiple patterns in the same entry, e.g.
    Header-1:
    Header-2: bar
    
    or JSON: {"Header-1": null, "Header-2": "bar"} Means ALL header patterns must match.
  • Header keys are case-insensitive, but values are case-sensitive.

The values can use * as a wildcard for any number of characters, e.g. foo* matches foo, foobar, and foo123. Any amount of * can be used at different positions.

To use a literal *, escape it with a backslash: \*.

Types

Each CDN can have a designated type field. The type can either be commercial, private, public_assets or other.

  • commercial: CDNs used by different customers (e.g. Akamai, Fastly, ...)
  • private: CDNs used internally by a single company (e.g. Meta, Instagram, ...)
  • public_assets: CDNs providing public assets not uploaded by customers (e.g. BootstrapCDN)
  • other: CDNs with an entirely different model

The field is optional as this information isn't always available/clear.

Python API

def compile_domains(domains: list[str]) -> Pattern:
    ...
def compile_domain(domain: str) -> Pattern:
    ...

(source): Compile domain patterns to a RegExp according to the Domain Pattern rules.

def matches(headers: Dict[str, str], matcher: Dict[str, Optional[str]]) -> bool:
    ...
def match_headers(headers: Dict[str, str], matchers: List[Dict[str, Optional[str]]]) -> Dict[str, str]:
    ...

(source): Match response headers against the patterns according to the Header Pattern rules.

TS API

function compileDomains(domains: string[]): RegExp
function compileDomain(domain: string): RegExp

(source): Compile domain patterns to a RegExp according to the Domain Pattern rules.

function matchHeaders(headers: Record<string, string>, patterns: Record<string, string | null>[]

(source): Match response headers against the patterns according to the Header Pattern rules.

References

Metadata

Release files for cdns 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdns 0.1.0
File Size Uploaded Provenance Actions
cdns-0.1.0.tar.gz 15.3 kB Without provenance Details for cdns-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cdns 0.1.0
File Interpreter ABI Platform Actions
cdns-0.1.0-py3-none-any.whl Python 3 none any Details for cdns-0.1.0-py3-none-any.whl

Total release size: 32.0 kB

Release files / cdns-0.1.0.tar.gz

Download URL cdns-0.1.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1c1bd5e25c95b42771f99ee614a1fcc8722e005739e255f7f1a3cc3c40b120ed
BLAKE2b-256 checksum
How to use checksums
72719aec658e4cb33b5cd85b995cf2ed49765cb6737d34b5db0f4c543be2ef37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / cdns-0.1.0-py3-none-any.whl

Download URL cdns-0.1.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0c1d7888e916db0f8ba4bc0db14e1446fc5bc423317cbb1f7a902620379069f
BLAKE2b-256 checksum
How to use checksums
449f4de333a1cd76b66738139d6764e8a8e0f7644732426fd39795775d64586c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for cdns 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page