Skip to content

Commit 0fd1830

Browse files
committed
chore: copilot comments
#1252 (review)
1 parent e572389 commit 0fd1830

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

oauth2_provider/oauth2_validators.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _authenticate_basic_auth(self, request):
157157
try:
158158
client_id, client_secret = map(unquote_plus, auth_string_decoded.split(":", 1))
159159
except ValueError:
160-
log.debug("Failed basic auth, Invalid base64 encoding.")
160+
log.debug("Failed basic auth, Invalid base64 encoding")
161161
return False
162162

163163
if self._load_application(client_id, request) is None:
@@ -205,16 +205,16 @@ def _load_application(self, client_id, request):
205205
if request.client:
206206
# check for cached client, to save the db hit if this has already been loaded
207207
if not isinstance(request.client, Application):
208-
log.debug("request.client is not an Application, something else set request.client erroneously, resetting request.client.")
208+
log.debug("request.client is not an Application, something else set request.client erroneously, resetting request.client")
209209
request.client = None
210210
elif request.client.client_id != client_id:
211-
log.debug("request.client client_id does not match the given client_id, resetting request.client.")
211+
log.debug("request.client client_id does not match the given client_id, resetting request.client")
212212
request.client = None
213213
elif not request.client.is_usable(request):
214-
log.debug("request.client is a valid Application, but is not usable, resetting request.client.")
214+
log.debug("request.client is a valid Application, but is not usable, resetting request.client")
215215
request.client = None
216216
else:
217-
log.debug("request.client is a valid Application, reusing it.")
217+
log.debug("request.client is a valid Application, reusing it")
218218
return request.client
219219
try:
220220
# cache wasn't hit, load from db
@@ -223,8 +223,8 @@ def _load_application(self, client_id, request):
223223
if not client.is_usable(request):
224224
log.debug("Failed to load application: Application %r is not usable" % (client_id))
225225
return None
226-
log.debug("Loaded application %r from database", client)
227226
request.client = client
227+
log.debug("Loaded application %r from database", client)
228228
return request.client
229229
except Application.DoesNotExist:
230230
log.debug("Failed to load application: Application %r does not exist" % (client_id))

tests/test_authorization_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ def test_request_body_params(self):
13101310

13111311
def test_request_body_params_client_typo(self):
13121312
"""
1313-
Request an access token using client_type: public
1313+
Verify that using incorrect parameter name (client instead of client_id) returns invalid_client error
13141314
"""
13151315
self.client.login(username="test_user", password="123456")
13161316
authorization_code = self.get_auth()

0 commit comments

Comments
 (0)