This commit is contained in:
parent
69887c4a02
commit
1c619acfe1
1 changed files with 4 additions and 2 deletions
|
@ -1,13 +1,15 @@
|
||||||
import os
|
import os, traceback
|
||||||
|
from cryptography.fernet import Fernet
|
||||||
from cloudflare import Cloudflare
|
from cloudflare import Cloudflare
|
||||||
__ircat_type__ = "sql.provider" # The type of module
|
__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:
|
class broker:
|
||||||
def __init__(self, cf_accountid:str, cf_apitoken:str, cf_d1database:str):
|
def __init__(self, cf_accountid:str, cf_apitoken:str, cf_d1database:str):
|
||||||
self.account_id = cf_accountid
|
self.account_id = cf_accountid
|
||||||
self.api_token = cf_apitoken
|
self.api_token = cf_apitoken
|
||||||
self.database = cf_d1database
|
self.database = cf_d1database
|
||||||
self.client = Cloudflare(api_token=cf_apitoken)
|
self.client = Cloudflare(api_token=cf_apitoken)
|
||||||
|
self.fnet = Fernet(fernet_key)
|
||||||
self.client.d1.database.query(
|
self.client.d1.database.query(
|
||||||
database_id=self.database,
|
database_id=self.database,
|
||||||
account_id=self.account_id,
|
account_id=self.account_id,
|
||||||
|
|
Loading…
Add table
Reference in a new issue