File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -102,3 +102,34 @@ def get_exceptions(self):
102
102
103
103
def handle_error (self , handle_error ):
104
104
pass
105
+
106
+
107
+ class BasicAuthentication (Authentication ):
108
+ def __init__ (self , username , password ):
109
+ self ._username = username
110
+ self ._password = password
111
+
112
+ def set_client_session (self , client_session ):
113
+ pass
114
+
115
+ def set_http_session (self , http_session ):
116
+ try :
117
+ import requests .auth
118
+ except ImportError :
119
+ raise RuntimeError ('unable to import requests.auth' )
120
+
121
+ http_session .auth = requests .auth .HTTPBasicAuth (
122
+ self ._username ,
123
+ self ._password
124
+ )
125
+ return http_session
126
+
127
+ def setup (self , presto_client ):
128
+ self .set_client_session (presto_client .client_session )
129
+ self .set_http_session (presto_client .http_session )
130
+
131
+ def get_exceptions (self ):
132
+ return ()
133
+
134
+ def handle_error (self , handle_error ):
135
+ pass
You can’t perform that action at this time.
0 commit comments