Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7163551
D5304.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D5304.diff
View Options
diff --git a/swh/auth/pytest_plugin.py b/swh/auth/pytest_plugin.py
--- a/swh/auth/pytest_plugin.py
+++ b/swh/auth/pytest_plugin.py
@@ -5,6 +5,7 @@
from copy import copy
from datetime import datetime, timezone
+import json
from typing import Dict, List, Optional
from unittest.mock import Mock
@@ -140,9 +141,12 @@
self.userinfo.return_value = copy(user_info)
else:
self.authorization_url = Mock() # type: ignore
- exception = KeycloakError(
- error_message="Authentication failed", response_code=401
- )
+ error = {
+ "error": "invalid_grant",
+ "error_description": "Invalid user credentials",
+ }
+ error_message = json.dumps(error).encode()
+ exception = KeycloakError(error_message=error_message, response_code=401)
self.authorization_code.side_effect = exception
self.authorization_url.side_effect = exception
self.refresh_token.side_effect = exception
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 30, 10:14 AM (18 h, 46 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3218363
Attached To
D5304: auth.pytest_plugin: Adjust error type according to reality
Event Timeline
Log In to Comment