From 44cbe23590948b9e81f0f35c8defeafacb5f4ad6 Mon Sep 17 00:00:00 2001 From: swee Date: Tue, 21 Jan 2025 16:19:55 -0800 Subject: [PATCH] Update modules/cfd1.py --- modules/cfd1.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/cfd1.py b/modules/cfd1.py index 8246a31..f154fce 100644 --- a/modules/cfd1.py +++ b/modules/cfd1.py @@ -3,4 +3,10 @@ __ircat_type__ = "sql.provider" # The type of module __ircat_requires__ = ["cf_accountid", "cf_apitoken", "cf_d1database"] # The required config.yml entries. class broker: def __init__(self, cf_accountid, cf_apitoken, cf_d1database): - pass \ No newline at end of file + self.account_id = cf_accountid + self.api_token = cf_apitoken + self.base_url = f"https://api.cloudflare.com/client/v4/accounts/{self.account_id}/d1/database" + self.headers = { + "Content-Type": "application/json", + "Authorization": f"Bearer {self.api_token}" + } \ No newline at end of file