Skip to content

Commit

Permalink
fix: tenant access to endpoints leading to access the base wallet (#3545
Browse files Browse the repository at this point in the history
)

* Fixing tenant endpoint access

---------

Signed-off-by: Thiago Romano <thiagoromano.s@gmail.com>
  • Loading branch information
thiagoromanos authored Feb 28, 2025
1 parent 3057c0e commit a4dec2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion acapy_agent/admin/decorators/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def tenant_auth(request):
(multitenant_enabled and authorization_header)
or (not multitenant_enabled and valid_key)
or (multitenant_enabled and valid_key and base_wallet_allowed_route)
or insecure_mode
or (insecure_mode and not multitenant_enabled)
or request.method == "OPTIONS"
):
return await handler(request)
Expand Down
6 changes: 3 additions & 3 deletions acapy_agent/admin/tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ async def test_options_request(self):
await decor_func(self.request)
self.decorated_handler.assert_called_once_with(self.request)

async def test_insecure_mode(self):
async def test_insecure_mode_witout_token(self):
self.profile.settings["admin.admin_insecure_mode"] = True
decor_func = tenant_authentication(self.decorated_handler)
await decor_func(self.request)
self.decorated_handler.assert_called_once_with(self.request)
with self.assertRaises(web.HTTPUnauthorized):
await decor_func(self.request)

async def test_single_tenant_invalid_api_key(self):
self.profile.settings["multitenant.enabled"] = False
Expand Down

0 comments on commit a4dec2c

Please sign in to comment.