Provides a workflow for friend.
Provides a workflow for [friend](https://github.com/cemerick/friend).
(build-access-token-request api-client shop code)
Takes an api-client map, a myshopify domain, and a temporary code. Returns a request map for a POST to Shopify to get a permanent token
Takes an api-client map, a myshopify domain, and a temporary code. Returns a request map for a POST to Shopify to get a permanent token
(callback-request-matcher callback-path request)
Returns whether or not the request is an auth callback, for a given callback path.
Returns whether or not the request is an auth callback, for a given callback path.
(fetch-access-token api-client shop code)
Takes an api-client map, a myshopify domain, and a temporary access code. Fires off a POST to Shopify requesting a permanent token, which is then returned.
Takes an api-client map, a myshopify domain, and a temporary access code. Fires off a POST to Shopify requesting a permanent token, which is then returned.
(handle-callback-request api-client request)
Uses the temporary code from an auth callback to fetch a permanent access token from Shopify and return it in an auth map.
Uses the temporary code from an auth callback to fetch a permanent access token from Shopify and return it in an auth map.
(handle-login-request api-client request callback-path)
Returns a redirect response to the user auth URL for the shop specified in the query params.
Returns a redirect response to the user auth URL for the shop specified in the query params.
(login-request-matcher login-path request)
Returns whether or not the request is a login, for a given login path.
Returns whether or not the request is a login, for a given login path.
(normalize-shop-domain domain)
Puts in the .myshopify.com if necessary.
Puts in the .myshopify.com if necessary.
(shopify-auths request)
Takes a ring request and returns a sequence of the current Shopify auth maps.
Takes a ring request and returns a sequence of the current Shopify auth maps.
(user-auth-url api-client shop & [redirect-path])
Takes an api-client map, a shop domain, and a redirect path and returns the URL where the user can grant access the api-client.
Takes an api-client map, a shop domain, and a redirect path and returns the URL where the user can grant access the api-client.
(workflow {:keys [api-client] :as config})
Takes a config map and returns a friend workflow. The only required
config key is :api-client
. Optional keys are :login-path
(defaults to
"/auth/shopify") and :callback-path
(defaults to
"/auth/shopify/callback"). Here's a typical config:
{:api-client
{:url "http://myapp.com"
:key "01abfc750a0c942167651c40d088531d"
:secret "dc2e817cb95adce7164db4767a13a53f"
:scope [:read_orders, :write_content]}
:login-path "/login"}
Takes a config map and returns a friend workflow. The only required config key is `:api-client`. Optional keys are `:login-path` (defaults to "/auth/shopify") and `:callback-path` (defaults to "/auth/shopify/callback"). Here's a typical config: {:api-client {:url "http://myapp.com" :key "01abfc750a0c942167651c40d088531d" :secret "dc2e817cb95adce7164db4767a13a53f" :scope [:read_orders, :write_content]} :login-path "/login"}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close