Oneflow v0.1.2 Oneflow.Http.Authorization

This is the the module that allows generating the value for the x-oneflow-authorization header.

Link to this section Summary

Functions

Generates authentication header value given the request %Request{ method: :get, url: "/url"}. and the timestamp 1498601557

Link to this section Functions

Link to this function header_value(req, timestamp)
header_value(Oneflow.Http.Request.t, integer) :: String.t

Generates authentication header value given the request %Request{ method: :get, url: "/url"}. and the timestamp 1498601557.

Returns "token:6f88d384bd48daed9bf03efad5d5b5bdf89f3063".

If the url contains a query string but the path is the same, the value must be the same.

Examples

iex> request = %Oneflow.Http.Request{ method: :get, path: “/url”} iex> Oneflow.Http.Authorization.header_value(request, 498601557) “token:6f88d384bd48daed9bf03efad5d5b5bdf89f3063”

iex> request = %Oneflow.Http.Request{ method: :get, path: “/url?foo=bar”} iex> Oneflow.Http.Authorization.header_value(request, 498601557) “token:6f88d384bd48daed9bf03efad5d5b5bdf89f3063”