From 76417428478c52be5a2ef1651c23cd35047924ab Mon Sep 17 00:00:00 2001 From: Billy Robinson Date: Sat, 26 Oct 2024 01:23:08 +0100 Subject: [PATCH] [PS-58] Add Fakebook oAuth window for the oAuth endpoint --- Dockerfile | 3 +- facebook-mock-api.json | 38 +++++-------------- oauth.html | 85 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 31 deletions(-) create mode 100644 oauth.html diff --git a/Dockerfile b/Dockerfile index 2a50bb4..786014c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,7 @@ FROM node:20-alpine WORKDIR /app RUN npm install -g @mockoon/cli -COPY facebook-mock-api.json /app/ -COPY index.html /app/ +COPY . /app/ EXPOSE 3000 CMD ["mockoon-cli", "start", "--data", "/app/facebook-mock-api.json", "--port", "3000"] diff --git a/facebook-mock-api.json b/facebook-mock-api.json index 1533830..5d7afe1 100644 --- a/facebook-mock-api.json +++ b/facebook-mock-api.json @@ -345,10 +345,10 @@ "statusCode": 200, "label": "", "headers": [], - "bodyType": "INLINE", - "filePath": "", + "bodyType": "FILE", + "filePath": "oauth.html", "databucketID": "", - "sendFileAsBody": false, + "sendFileAsBody": true, "rules": [ { "target": "query", @@ -363,19 +363,14 @@ "fallbackTo404": false, "default": false, "crudKey": "id", - "callbacks": [ - { - "uuid": "86576dba-774c-4cbd-b55b-bfd08e3a3d87", - "latency": 0 - } - ] + "callbacks": [] }, { - "uuid": "0d44a409-56c4-4ca5-ab72-f36bd9a8f4fa", - "body": "{\n \"error\": \"State query param not provided\"\n}", + "uuid": "bdcd8528-8046-4917-b578-5d45861288fa", + "body": "{\n \"error\": \"Numeric state query paramater not provided\"\n \"example\": \"?state=1234567\"\n}", "latency": 0, "statusCode": 422, - "label": "", + "label": "State query paramater not provided", "headers": [], "bodyType": "INLINE", "filePath": "", @@ -501,23 +496,8 @@ "id": "2q0d", "name": "New data", "documentation": "", - "value": "[\n]" + "value": "[\n {\"id\": \"75adb32f-f92b-44ff-9a29-ca28fac17e50\", \"message\": \"test\"},\n {\"id\": \"f220d0a9-0d43-4224-a0bb-4b1553c89643\", \"message\": \"hello\"}\n]" } ], - "callbacks": [ - { - "uuid": "86576dba-774c-4cbd-b55b-bfd08e3a3d87", - "id": "n7x2", - "uri": "https://clementine.postsuite.xyz/connections/callback?code={{faker 'number.int' min=10 max=100000000}}&state={{queryParam 'state'}}", - "name": "Callback", - "documentation": "oAuth callback ", - "method": "get", - "headers": [], - "bodyType": "INLINE", - "body": "", - "databucketID": "", - "filePath": "", - "sendFileAsBody": true - } - ] + "callbacks": [] } \ No newline at end of file diff --git a/oauth.html b/oauth.html new file mode 100644 index 0000000..cd060d0 --- /dev/null +++ b/oauth.html @@ -0,0 +1,85 @@ + + + + + + OAuth Provider - Authorization + + + +
+

Fakebook oAuth Window

+

Hi John Smith,

Click to link your Fakebook account to PostSuite.

This will give permission to:
- Manage your page
- Post on your behalf

+ +
+ © 2024 Fakebook Inc +
+
+ + + +