aboutsummaryrefslogtreecommitdiffstats
path: root/thallium-backend/src/routes/debug.py
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-08-18 20:16:38 +0100
committerGravatar Chris Lovering <[email protected]>2024-08-18 20:16:38 +0100
commit26954a4862bc33a0eab68d6b8992efdf038687d4 (patch)
tree9526e227a27d09f21417d4e8eca61240bae8e1dc /thallium-backend/src/routes/debug.py
parentForward correct path to localhost in compose file (diff)
Add debug router for debugging endpoints
Diffstat (limited to 'thallium-backend/src/routes/debug.py')
-rw-r--r--thallium-backend/src/routes/debug.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/thallium-backend/src/routes/debug.py b/thallium-backend/src/routes/debug.py
new file mode 100644
index 0000000..7fe42da
--- /dev/null
+++ b/thallium-backend/src/routes/debug.py
@@ -0,0 +1,29 @@
+import logging
+
+from fastapi import APIRouter
+
+from src.settings import PrintfulClient
+
+router = APIRouter(tags=["debug"])
+log = logging.getLogger(__name__)
+
+
[email protected]("/templates")
+async def get_templates(client: PrintfulClient) -> dict:
+ """Return all templates in printful."""
+ resp = await client.get("/product-templates")
+ return resp.json()
+
+
[email protected]("/oauth-scopes-v1")
+async def get_oauth_scopes(client: PrintfulClient) -> dict:
+ """Return all templates in printful."""
+ resp = await client.get("/oauth/scopes")
+ return resp.json()
+
+
[email protected]("/oauth-scopes-v2")
+async def get_v2_oauth_scopes(client: PrintfulClient) -> dict:
+ """Return all templates in printful."""
+ resp = await client.get("/v2/oauth-scopes")
+ return resp.json()