EndPointBlank.DeprecationHeaders (end_point_blank_elixir v0.6.0)

Copy Markdown

Formats the deprecation facts returned by an authorize call into the standard response headers.

  • Deprecation — RFC 9745, an Item Structured Header Date: @1688169599
  • Sunset — RFC 8594, an HTTP-date: Sat, 31 Dec 2018 23:59:59 GMT

RFC 9745 permits a past value ("was deprecated at that date"), which is what EndPointBlank emits: deprecation takes effect when it is declared.

Pure and stateless. The SDK does not know what a lifecycle is — it relays two timestamps the portal already decided about, and this turns them into two strings.

Header names are lowercase here, unlike the other SDKs. Plug requires it — put_resp_header/3 raises on an uppercase name — and HTTP/2 mandates it on the wire anyway. The values are unaffected.

Summary

Functions

Header name/value pairs for a deprecation block; [] when there is nothing to say.

@1688169599 — no quotes, no sub-second precision.

Puts the headers on a Plug.Conn, if there are any.

Sat, 31 Dec 2018 23:59:59 GMT — zero-padded day, always GMT.

Functions

build(deprecation)

Header name/value pairs for a deprecation block; [] when there is nothing to say.

deprecation_value(dt)

@1688169599 — no quotes, no sub-second precision.

put_headers(conn, deprecation)

Puts the headers on a Plug.Conn, if there are any.

Never raises into the provider's response path: a malformed timestamp is a bug worth no header, not a 500 on a request that already succeeded. A header the application already set is left alone — it has said something more specific than we know.

sunset_value(dt)

Sat, 31 Dec 2018 23:59:59 GMT — zero-padded day, always GMT.