From ef8b8f1fd255bd6f425bdf86c09ce529aca5c384 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Sun, 18 Feb 2024 00:02:24 +0000 Subject: [PATCH] OB_Connector --- requirements.txt | 2 ++ src/owlboard_connector.py | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..13d45de --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +lxml==5.1.0 +python-docx-2023==0.2.17 diff --git a/src/owlboard_connector.py b/src/owlboard_connector.py index 8f098bd..ae87934 100644 --- a/src/owlboard_connector.py +++ b/src/owlboard_connector.py @@ -7,4 +7,26 @@ from imap_connector import IMAPConnector imap_connector = IMAPConnector() -imap_connector.fetch_filtered_emails("no-reply@owlboard.info") \ No newline at end of file + +def check_registration(): + ## First check env var `DGP_OB_UUID` + ## Then run a test query, if not unauthorized return TRUE + ## else FALSE. + uuid = os.environ.get('DGP_OB_UUID') + if not uuid: + return False + + ### Now run test query and if return not 200 return false. + return + +def register(): + ## Send registration Req + ## Keep checking IMAP until reg email received + ## Submit Reg confirmation + ## Save UUID to env var `DGP_OB_UUID` + return + +## INIT +is_registered = check_registration() +if not is_registered: + register() \ No newline at end of file