# `ExOss.CDN.Qiniu`
[🔗](https://github.com/choice-form/ex_oss/blob/main/lib/ex_oss/cdn/qiniu.ex#L1)

Qiniu CDN adapter.

Implements `ExOss.CDN.Behaviour` to generate signed URLs for Qiniu's
CDN service. This module is entirely self-contained — it does not
depend on the `qiniu` hex package.

## Download URL Signing

Qiniu CDN download URLs are signed with HMAC-SHA1 over the full URL
(including a `e` deadline parameter), producing a `token` query
parameter of the form `{access_key}:{signature}`.

## Upload Credentials

Upload credentials use a Qiniu [PutPolicy](ExOss.CDN.Qiniu.PutPolicy.html)
encoded as URL-safe Base64 JSON, signed with HMAC-SHA1 to produce an
`uptoken` of the form `{access_key}:{signature}:{encoded_policy}`.

## Configuration

    config :my_app, MyApp.Storage,
      cdn: [
        provider: :qiniu,
        endpoint: "https://cdn.example.com"
      ]

Credentials (`access_key_id` / `secret_access_key`) are taken from the
client's storage credentials, not from a separate CDN key configuration.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
