Files
2026-05-27 23:47:53 +01:00
..
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00

@suaveplan/storage-cdn-rackspace - Rackspace Cloud Files (OpenStack Swift) origin + Rackspace CDN provider for @suaveplan/storage-cdn. v2 identity auth with proactive token refresh, service-catalog endpoint lookup (LON/IAD/DFW/ORD/SYD/HKG), HMAC-SHA1 TempURL signing, CDN purge, Range reads, native streaming, full AbortSignal threading, Retry-After honoured, OTel surface with provider+region attributes.

Rackspace Cloud Files (OpenStack Swift) origin + Rackspace CDN provider for @suaveplan/storage-cdn. Full AbstractStorage and CdnAdapter surface — get/set/delete/exists/getMetadata/getPartial/createReadStream/createWriteStream/getSize against Cloud Files, plus purge/signUrl/edgeUrl against the Rackspace CDN. v2 identity auth with proactive token refresh, service-catalog endpoint lookup (LON/IAD/DFW/ORD/SYD/HKG), HMAC-SHA1 TempURL signing, transient-status retry honouring Retry-After, full OTel surface with provider="rackspace" and region attributes.

Documentation tree

  • auth-client — RackspaceAuthClient wraps Rackspace identity v2 (POST /v2.0/tokens) with the three behaviours every consumer of the…
    • auth-client — RackspaceAuthClient wraps Rackspace identity v2 (POST /v2.0/tokens) with the three behaviours every consumer of the…
  • cdn-client — Wraps the two Rackspace CDN management operations the adapter actually needs at runtime: getCdnMetadata (HEAD on the…
    • cdn-client — Wraps the two Rackspace CDN management operations the adapter actually needs at runtime: getCdnMetadata (HEAD on the…
  • error-codes — Declares the canonical STORAGE_CDN_RACKSPACE error namespace used by every module in this package. Codes are produced…
    • error-codes — Declares the canonical STORAGE_CDN_RACKSPACE error namespace used by every module in this package. Codes are produced…
  • key-sanitizer — Validates and normalises caller-supplied storage keys before any fetch is issued against Rackspace Cloud Files, and pro…
    • key-sanitizer — Validates and normalises caller-supplied storage keys before any fetch is issued against Rackspace Cloud Files, and pro…
  • otel — Owns the OpenTelemetry instrument set for @suaveplan/storage-cdn-rackspace: counters (reads_total, writes_total,…
    • otel — Owns the OpenTelemetry instrument set for @suaveplan/storage-cdn-rackspace: counters (reads_total, writes_total,…
  • rackspace-cdn-adapter — RackspaceCdnAdapter is the concrete CdnAdapter implementation that binds @suaveplan/storage's AbstractStorage c…
    • rackspace-cdn-adapter.base — RackspaceCdnAdapterBase carries the shared internal machinery every RackspaceCdnAdapter instance needs: the resolve…
    • rackspace-cdn-adapter.cdn-methods — Houses the CDN-side method implementations consumed by RackspaceCdnAdapter: getSize (via fetchContainerSize), `pu…
    • rackspace-cdn-adapter.helpers — Internal helpers used by RackspaceCdnAdapter and its sibling ops/streams modules. Splits boundary concerns (option pa…
    • rackspace-cdn-adapter — RackspaceCdnAdapter is the concrete CdnAdapter implementation that binds @suaveplan/storage's AbstractStorage c…
    • rackspace-cdn-adapter.ops — Reusable Cloud Files HTTP operations used by RackspaceCdnAdapter: object GET (objectGet), HEAD (objectHead), PUT…
    • rackspace-cdn-adapter.streams — Builds the ReadableStream and WritableStream instances RackspaceCdnAdapter returns from createReadStream / `cre…
  • registry — Module-augments @suaveplan/storage/factory's StorageProviderRegistry and StorageProviderConfig to add the `"racks…
    • registry — Module-augments @suaveplan/storage/factory's StorageProviderRegistry and StorageProviderConfig to add the `"racks…
  • retry-helper — Coordinates retry logic for HTTP requests against Rackspace Cloud Files and the Rackspace CDN management API. Distingui…
    • retry-helper — Coordinates retry logic for HTTP requests against Rackspace Cloud Files and the Rackspace CDN management API. Distingui…
  • temp-url — Computes Swift TempURL signatures for short-lived signed URLs against Rackspace Cloud Files. The OpenStack Swift TempUR…
    • temp-url — Computes Swift TempURL signatures for short-lived signed URLs against Rackspace Cloud Files. The OpenStack Swift TempUR…

Install

bun add @suaveplan/storage-cdn-rackspace

Quick start

import { RackspaceCdnAdapter } from "@suaveplan/storage-cdn-rackspace";

const storage = new RackspaceCdnAdapter({
    originBaseUrl: "https://storage101.lon3.clouddrive.com/v1/AUTH_acc/",
    edgeBaseUrl: "https://abc.r88.cf6.rackcdn.com/",
    username: process.env["RAX_USER"]!,
    apiKey: process.env["RAX_KEY"]!,
    region: "LON",
    container: "myc",
    tempUrlKey: process.env["RAX_TEMPURL_KEY"]!,
});

await storage.set("photos/a.jpg", bytes);
await storage.purge("photos/a.jpg");
const signed = await storage.signUrl("photos/a.jpg", { ttlSeconds: 300, method: "GET" });

Factory registration

import { registerRackspaceCdnProvider } from "@suaveplan/storage-cdn-rackspace";
import { createStorage } from "@suaveplan/storage/factory";

registerRackspaceCdnProvider();
const storage = createStorage({ type: "rackspace-cdn", config });

Modules

  • error-codes — STORAGE_CDN_RACKSPACE_CODES registry + StorageCdnRackspaceError.
  • constants — region whitelist, default auth URL, retry defaults.
  • auth-client — v2 identity auth, token cache, service-catalog lookup, proactive refresh.
  • cdn-client — getCdnMetadata, purgeObject.
  • temp-url — HMAC-SHA1 TempURL signer via WebCrypto.
  • key-sanitizer — strict key validation + per-segment encoder.
  • retry-helper — transient classifier + Retry-After honour.
  • otel — meters, histograms, counters, tracer.
  • rackspace-cdn-adapter — the main RackspaceCdnAdapter class.
  • registry — module-augmentation slot for createStorage({ type: "rackspace-cdn", ... }).

Capabilities matrix

{
    partialReads: true,
    partialWrites: false,
    nativeStreams: true,
    atomicWrites: false,
    contentAddressable: false,
    cdn: {
        cdnPurge: true,
        cdnPrefixPurge: false,
        cdnSignedUrls: true,
        cdnOriginUploads: true,
    },
}

Features

  • Universal purity — no node:* or DOM-only imports.
  • Full Cloud Files surface — origin GET/PUT/DELETE/HEAD with Range, native streaming, AbortSignal.
  • CDN integration — purge, signed (TempURL) URLs, edge URL composition.
  • Proactive auth refresh — token re-issued five minutes before expiry; concurrent calls deduplicated.
  • Service-catalog endpoint resolution — works against any region in the LON/IAD/DFW/ORD/SYD/HKG set; misconfigured region surfaces as STORAGE_CDN_RACKSPACE.REGION_NOT_IN_CATALOG.
  • Retry on transient outcomes — 408/425/429/5xx retried with Retry-After honoured.
  • OTel built-in — storage_cdn_rackspace.* instruments with provider="rackspace" and region attributes for cross-provider dashboards.
  • 100 / 100 / 100 / 100 Istanbul coverage.

License

MIT — see LICENSE at the repo root.