@@ -82,7 +82,7 @@ def _wrapper(*args, **kwargs):
82
82
return func (* args , ** kwargs )
83
83
except GSSError as error :
84
84
msg = f"{ gss_stage } context failed: { error .gen_message ()} "
85
- log .exception (f" { func . __name__ } (): { msg } " )
85
+ log .exception ("%s (): %s" , func . __name__ , msg )
86
86
if callable (result ):
87
87
return result (msg , * args , ** kwargs )
88
88
return result
@@ -164,7 +164,7 @@ def handle_response(self,
164
164
num_401s = 0
165
165
while response .status_code == 401 and num_401s < 2 :
166
166
num_401s += 1
167
- log .debug (f "Handling 401 response, total seen: { num_401s } " )
167
+ log .debug ("Handling 401 response, total seen: %d" , num_401s )
168
168
169
169
if _negotiate_value (response ) is None :
170
170
log .debug ("GSSAPI is not supported" )
@@ -191,7 +191,7 @@ def handle_mutual_auth(self, response: Response, ctx: SecurityContext):
191
191
192
192
This is necessary so that we can authenticate responses if requested
193
193
"""
194
- log .debug (f "handle_mutual_auth(): Handling { response .status_code } " )
194
+ log .debug ("handle_mutual_auth(): Handling %d" , response .status_code )
195
195
196
196
if self .mutual_authentication == DISABLED :
197
197
log .debug ("handle_mutual_auth(): Mutual auth disabled, ignoring" )
@@ -213,8 +213,9 @@ def handle_mutual_auth(self, response: Response, ctx: SecurityContext):
213
213
elif is_http_error or self .mutual_authentication == OPTIONAL :
214
214
if response .status_code != httpx .codes .OK :
215
215
log .error (
216
- f"handle_mutual_auth(): Mutual authentication unavailable "
217
- f"on { response .status_code } response"
216
+ "handle_mutual_auth(): Mutual authentication unavailable"
217
+ " on %d response" ,
218
+ response .status_code ,
218
219
)
219
220
if (self .mutual_authentication == REQUIRED
220
221
and self .sanitize_mutual_error_response ):
@@ -243,9 +244,9 @@ def set_auth_header(self,
243
244
gss_resp = ctx .step (token or None )
244
245
auth_header = f"Negotiate { b64encode (gss_resp ).decode ()} "
245
246
log .debug (
246
- f "add_request_header(): "
247
- f" { 'Preemptive ' if token is None else '' } "
248
- f"Authorization header: { auth_header } "
247
+ "add_request_header(): %sAuthorization header: %s" ,
248
+ 'Preemptive ' if token is None else '' ,
249
+ auth_header ,
249
250
)
250
251
251
252
request .headers ['Authorization' ] = auth_header
@@ -262,7 +263,7 @@ def authenticate_server(self,
262
263
Returns True on success, False on failure.
263
264
"""
264
265
auth_header = _negotiate_value (response )
265
- log .debug (f "authenticate_server(): Authenticate header: { auth_header } " )
266
+ log .debug ("authenticate_server(): Authenticate header: %s" , auth_header )
266
267
267
268
# If the handshake isn't complete here, nothing we can do
268
269
ctx .step (auth_header )
0 commit comments