From 306cf74eb0101a12b51549866a4d60296618ee0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Wed, 14 Sep 2022 18:19:14 +0800 Subject: 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. --- shopify.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 shopify.h (limited to 'shopify.h') 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 +#include + +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 -- cgit v1.2.3