File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,13 @@ def google_client_info():
29
29
user_agent = USER_AGENT_TEMPLATE .format (sqlalchemy .__version__ )
30
30
return client_info .ClientInfo (user_agent = user_agent )
31
31
32
+ def verify_args (email ,username ):
33
+ if not email .endswith ("geotab.com" ):
34
+ return False
35
+ if not bool (re .match ("^[A-Za-z0-9_-]*$" , username )):
36
+ return False
37
+ return True
38
+
32
39
logger = logging .getLogger ()
33
40
34
41
# Create a new google client on query run, database added, dataset added
@@ -67,6 +74,9 @@ def create_bigquery_client(
67
74
if project_id is None :
68
75
project_id = default_project
69
76
77
+ if email is not None and username is not None and not verify_args (email , username ):
78
+ logger .critical ("INVALID USERNAME OR EMAIL: {} {}" .format (username , email )
79
+
70
80
if email is not None :
71
81
logger .debug ("email: {}" .format (email ))
72
82
# credentials = credentials.with_scopes(SCOPES + ("email"))
You can’t perform that action at this time.
0 commit comments