Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(auth): preserve trusted local resource access

Maxvintb8265a37be24
diff --git a/storage/resource_access_service.py b/storage/resource_access_service.py
index b268b90e0..82e779c18 100644
--- a/storage/resource_access_service.py
+++ b/storage/resource_access_service.py
@@ -518,6 +518,8 @@ def _policy_allows(
policy: Mapping[str, Any] | None,
group_ids: Sequence[str],
) -> bool:
+ if context.is_trusted_local:
+ return True
if not context.can_use_resource(resource_kind):
return False
if policy is None:
diff --git a/tests/test_ui_resource_access_api.py b/tests/test_ui_resource_access_api.py
index a78e39863..b62700f69 100644
--- a/tests/test_ui_resource_access_api.py
+++ b/tests/test_ui_resource_access_api.py
@@ -66,7 +66,7 @@ def test_organization_context_and_policy_routes_use_signed_cookie_claims(monkeyp
client = app.test_client()
client.set_cookie(
remote_access.SESSION_COOKIE_NAME,
- _organization_cookie(config),
+ _organization_cookie(config, instance_role="editor"),
domain="alex.avibe.bot",
)
@@ -75,7 +75,7 @@ def test_organization_context_and_policy_routes_use_signed_cookie_claims(monkeyp
policies = client.get("/api/resource-policies?kind=agent", base_url="https://alex.avibe.bot")
assert context.status_code == 200
- assert context.get_json()["instance_role"] == "viewer"
+ assert context.get_json()["instance_role"] == "editor"
assert context.get_json()["organization"] == {
"id": "org-1",
"member_id": "organization-member-1",
@@ -96,7 +96,7 @@ def test_organization_context_and_policy_routes_use_signed_cookie_claims(monkeyp
"policy_revision": 2,
"last_applied_control_plane_revision": 2,
"can_use": True,
- "can_manage": True,
+ "can_manage": False,
}
]
diff --git a/vibe/ui_server.py b/vibe/ui_server.py
index 0a8860e02..ab3bb9d75 100644
--- a/vibe/ui_server.py
+++ b/vibe/ui_server.py
@@ -2918,6 +2918,8 @@ async def _wait_for_project_session_access_loss(
def _show_page_resource_access_allowed(context: Any, session_id: str) -> bool:
from storage import resource_access_service
+ if context is None:
+ return True
try:
return resource_access_service.can_use_resource(
context,