diff options
| author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-14 18:19:14 +0800 |
|---|---|---|
| committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-14 18:19:14 +0800 |
| commit | 306cf74eb0101a12b51549866a4d60296618ee0b (patch) | |
| tree | 89fe13b234f40f97de84cdb6610bcd11e1d47a88 /shopify.h | |
OAuth part
The minimum to pass all authentications and arrive at the embedded app
index. This library is to be used with shopify-app-template-c for now,
as it assumes the existence of shopify.app.toml in the parent directory,
and index.html in the frontend directory.
Diffstat (limited to 'shopify.h')
| -rw-r--r-- | shopify.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/shopify.h b/shopify.h new file mode 100644 index 0000000..6af62d1 --- /dev/null +++ b/shopify.h @@ -0,0 +1,30 @@ +#ifndef SHOPIFY_H +#define SHOPIFY_H + +#include <stdbool.h> +#include <microhttpd.h> + +struct shopify_param { + char *key; + char *val; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +void shopify_init(); +bool shopify_valid(struct MHD_Connection *conn, const char *url, + const char *redir_url, const char *key, + struct shopify_param *params[]); +enum MHD_Result shopify_respond(struct shopify_param params[], const char *url, + const char *redir_url, const char *app_url, const char *app_id, + const char *key, const char *secret_key, const char *dir, + struct MHD_Connection *conn, struct MHD_Response **resp); +void shopify_cleanup(); + +#ifdef __cplusplus +} +#endif + +#endif |