From 1c619acfe1c43c9f561705bb9ddfff7052cb119a Mon Sep 17 00:00:00 2001 From: swee Date: Sat, 25 Jan 2025 18:46:24 -0800 Subject: [PATCH] Update modules/cfd1.py --- modules/cfd1.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/cfd1.py b/modules/cfd1.py index 9117658..ef81f5f 100644 --- a/modules/cfd1.py +++ b/modules/cfd1.py @@ -1,13 +1,15 @@ -import os +import os, traceback +from cryptography.fernet import Fernet from cloudflare import Cloudflare __ircat_type__ = "sql.provider" # The type of module -__ircat_requires__ = ["cf_accountid", "cf_apitoken", "cf_d1database"] # The required config.yml entries. +__ircat_requires__ = ["cf_accountid", "cf_apitoken", "cf_d1database", "fernet-key"] # The required config.yml entries. class broker: def __init__(self, cf_accountid:str, cf_apitoken:str, cf_d1database:str): self.account_id = cf_accountid self.api_token = cf_apitoken self.database = cf_d1database self.client = Cloudflare(api_token=cf_apitoken) + self.fnet = Fernet(fernet_key) self.client.d1.database.query( database_id=self.database, account_id=self.account_id,