@backblaze-labs/b2-sdk - v0.2.0
    Preparing search index...

    Function deriveAllowedSuffixes

    • Extract host suffixes to allow from a B2 authorize-account response.

      Known B2 realm hosts under backblazeb2.com are collapsed to that parent. Unknown or custom realm hosts are used as scoped suffixes: the returned hostname and its subdomains are allowed, but sibling hosts and parent domains are not. This avoids accidentally trusting broad public suffixes such as co.uk.

      Always includes backblaze.com because upload-pod URLs returned by b2_get_upload_url use that parent domain (pod-NNN-NNNN-NN.backblaze.com) rather than backblazeb2.com.

      Parameters

      • storageApi: { apiUrl: string; downloadUrl: string; s3ApiUrl: string }

        The apiInfo.storageApi portion of the authorize response.

      Returns readonly string[]

      Sorted list of unique host suffixes to allow.