Commit 4a2b2d6 1 parent 509bfab commit 4a2b2d6 Copy full SHA for 4a2b2d6
File tree 4 files changed +20
-4
lines changed
protocols/out_of_band/v1_0
4 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ async def tenant_auth(request):
78
78
(multitenant_enabled and authorization_header )
79
79
or (not multitenant_enabled and valid_key )
80
80
or (multitenant_enabled and valid_key and base_wallet_allowed_route )
81
- or insecure_mode
81
+ or ( insecure_mode and not multitenant_enabled )
82
82
or request .method == "OPTIONS"
83
83
):
84
84
return await handler (request )
Original file line number Diff line number Diff line change @@ -86,11 +86,11 @@ async def test_options_request(self):
86
86
await decor_func (self .request )
87
87
self .decorated_handler .assert_called_once_with (self .request )
88
88
89
- async def test_insecure_mode (self ):
89
+ async def test_insecure_mode_witout_token (self ):
90
90
self .profile .settings ["admin.admin_insecure_mode" ] = True
91
91
decor_func = tenant_authentication (self .decorated_handler )
92
- await decor_func ( self .request )
93
- self . decorated_handler . assert_called_once_with (self .request )
92
+ with self .assertRaises ( web . HTTPUnauthorized ):
93
+ await decor_func (self .request )
94
94
95
95
async def test_single_tenant_invalid_api_key (self ):
96
96
self .profile .settings ["multitenant.enabled" ] = False
Original file line number Diff line number Diff line change @@ -130,6 +130,21 @@ def __repr__(self) -> str:
130
130
self .__class__ .__name__ , self .backend , self .name
131
131
)
132
132
133
+ def __eq__ (self , other ) -> bool :
134
+ """Equality checks for profiles.
135
+
136
+ Multiple profile instances can exist at the same time but point to the
137
+ same profile. This allows us to test equality based on the profile
138
+ pointed to by the instance rather than by object reference comparison.
139
+ """
140
+ if not isinstance (other , Profile ):
141
+ return False
142
+
143
+ if type (self ) is not type (other ):
144
+ return False
145
+
146
+ return self .name == other .name
147
+
133
148
134
149
class ProfileManager (ABC ):
135
150
"""Handle provision and open for profile instances."""
Original file line number Diff line number Diff line change @@ -328,6 +328,7 @@ async def invitation_receive(request: web.BaseRequest):
328
328
mediation_id = mediation_id ,
329
329
)
330
330
except (DIDXManagerError , StorageError , BaseModelError ) as err :
331
+ LOGGER .exception ("Error during receive invitation" )
331
332
raise web .HTTPBadRequest (reason = err .roll_up ) from err
332
333
333
334
return web .json_response (result .serialize ())
You can’t perform that action at this time.
0 commit comments