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): align temporary org app surfaces

Max08e5132686bc
diff --git a/tests/test_instance_authorization.py b/tests/test_instance_authorization.py
index 767fce32a..2530f43e8 100644
--- a/tests/test_instance_authorization.py
+++ b/tests/test_instance_authorization.py
@@ -91,6 +91,25 @@ def test_temporary_org_app_access_is_not_projected_as_a_capability() -> None:
) is False
+def test_temporary_org_members_receive_show_events_at_viewer_instance_role() -> None:
+ member = AuthorizationContext(
+ instance_role="viewer",
+ organization_id="org-1",
+ organization_member_id="membership-1",
+ organization_role="member",
+ instance_access_source="organization_group",
+ is_remote=True,
+ )
+ non_member = AuthorizationContext(
+ instance_role="viewer",
+ instance_access_source="email",
+ is_remote=True,
+ )
+
+ assert can_receive_workbench_event(member, "show.event") is True
+ assert can_receive_workbench_event(non_member, "show.event") is False
+
+
@pytest.mark.parametrize(
("role", "expected"),
[
@@ -303,7 +322,7 @@ def test_remote_http_policy_defaults_local_machine_and_unknown_routes_to_local_o
("GET", "/api/backend/codex/runtime", REMOTE_HTTP_LOCAL_ONLY),
("GET", "/api/opencode/permission-status", REMOTE_HTTP_LOCAL_ONLY),
("GET", "/api/vault/audit", REMOTE_HTTP_ALLOWED),
- ("GET", "/api/dock", REMOTE_HTTP_ALLOWED),
+ ("GET", "/api/dock", REMOTE_HTTP_ACTIVE_ORGANIZATION_MEMBER),
("POST", "/api/dock/pins", REMOTE_HTTP_ACTIVE_ORGANIZATION_MEMBER),
("PUT", "/api/dock/order", REMOTE_HTTP_ACTIVE_ORGANIZATION_MEMBER),
# A push endpoint is caller-supplied and `send_web_push()` fetches it
@@ -369,6 +388,7 @@ def test_remote_http_policy_keeps_approved_management_and_read_surfaces(
("method", "path"),
[
("POST", "/api/dock/pins"),
+ ("GET", "/api/dock"),
("DELETE", "/api/dock/pins/ses-1"),
("PUT", "/api/dock/order"),
("GET", "/api/files/list"),
@@ -508,7 +528,12 @@ def test_temporary_org_app_policy_does_not_open_adjacent_or_sensitive_endpoints(
("canAdministerMemory", "POST", "/api/memory/clear", REMOTE_HTTP_LOCAL_ONLY),
# Dock is temporarily writable by active Organization members while
# Workbench preferences remain a trusted-local control.
- ("dockAndWorkbenchPrefs", "GET", "/api/dock", REMOTE_HTTP_ALLOWED),
+ (
+ "dockAndWorkbenchPrefs",
+ "GET",
+ "/api/dock",
+ REMOTE_HTTP_ACTIVE_ORGANIZATION_MEMBER,
+ ),
("dockAndWorkbenchPrefs", "GET", "/api/workbench/prefs", REMOTE_HTTP_ALLOWED),
(
"dockAndWorkbenchPrefs",
diff --git a/tests/test_ui_project_access.py b/tests/test_ui_project_access.py
index 168298ec6..b14d7bf04 100644
--- a/tests/test_ui_project_access.py
+++ b/tests/test_ui_project_access.py
@@ -181,7 +181,7 @@ def test_remote_editor_project_access_filters_every_read_surface(monkeypatch, tm
monkeypatch.setattr(
api,
"list_show_pages",
- lambda: {
+ lambda **_kwargs: {
"ok": True,
"count": 3,
"pages": [
@@ -381,7 +381,7 @@ def test_archived_project_invalidates_retained_remote_urls(monkeypatch, tmp_path
monkeypatch.setattr(
api,
"list_show_pages",
- lambda: {
+ lambda **_kwargs: {
"ok": True,
"count": 1,
"pages": [{"session_id": ids["session_a"]}],
diff --git a/tests/test_ui_remote_access_auth.py b/tests/test_ui_remote_access_auth.py
index 986253f5a..6c3dc4e8d 100644
--- a/tests/test_ui_remote_access_auth.py
+++ b/tests/test_ui_remote_access_auth.py
@@ -1238,6 +1238,7 @@ def test_remote_session_info_includes_authenticated_subject(monkeypatch, tmp_pat
"email": "[email protected]",
"sub": "user-1",
"instance_role": "owner",
+ "temporary_unrestricted_org_app_access": False,
"capabilities": {
"is_instance_owner": True,
"can_read_instance": True,
@@ -1351,6 +1352,12 @@ def test_remote_org_members_can_use_files_editor_and_builtin_apps(
"editor",
"library",
]
+ session_response = client.get(
+ "/api/session",
+ base_url="https://alex.avibe.bot",
+ environ_base=_remote_peer(),
+ )
+ assert session_response.get_json()["temporary_unrestricted_org_app_access"] is True
@pytest.mark.parametrize(
diff --git a/tests/test_ui_server_fastapi.py b/tests/test_ui_server_fastapi.py
index d44e69fc9..09659bc17 100644
--- a/tests/test_ui_server_fastapi.py
+++ b/tests/test_ui_server_fastapi.py
@@ -2315,6 +2315,50 @@ def test_workbench_events_filter_privileged_events_for_viewers(monkeypatch, tmp_
assert "hidden-secret" not in body
+def test_workbench_events_allow_show_events_to_temporary_org_viewers() -> None:
+ from vibe.authorization import AuthorizationContext
+ from vibe.sse_broker import broker
+ from vibe.ui_compat import g
+
+ async def collect_show_event() -> str:
+ with app.test_request_context("/api/events"):
+ g.authorization_context = AuthorizationContext(
+ instance_role="viewer",
+ instance_access_source="organization_group",
+ organization_id="org-1",
+ organization_member_id="member-1",
+ organization_role="member",
+ is_remote=True,
+ )
+ response = await ui_server.workbench_events()
+ iterator = response.body_iterator.__aiter__()
+ try:
+ for _ in range(3):
+ await iterator.__anext__()
+ broker.publish(
+ "show.event",
+ {
+ "session_id": "show-session-1",
+ "payload": {
+ "screenshot": {
+ "path": "/private/host/path.png",
+ "attachmentId": "attachment-1",
+ }
+ },
+ },
+ )
+ chunk = await asyncio.wait_for(iterator.__anext__(), timeout=1)
+ finally:
+ await iterator.aclose()
+ return chunk.decode("utf-8") if isinstance(chunk, bytes) else chunk
+
+ body = asyncio.run(collect_show_event())
+
+ assert "event: show.event" in body
+ assert "show-session-1" in body
+ assert "/private/host/path.png" not in body
+
+
def test_workbench_events_end_at_authorization_refresh_deadline():
from vibe.authorization import AuthorizationContext
from vibe.ui_compat import g
diff --git a/ui/src/components/AppShell.test.tsx b/ui/src/components/AppShell.test.tsx
index e01221a10..673b00c93 100644
--- a/ui/src/components/AppShell.test.tsx
+++ b/ui/src/components/AppShell.test.tsx
@@ -31,6 +31,7 @@ const status = vi.hoisted(() => ({ state: 'ready' as const }));
const inbox = vi.hoisted(() => ({ totalUnread: 0 }));
const instanceAuth = vi.hoisted(() => ({
remote: true,
+ hasTemporaryUnrestrictedOrgAppAccess: true,
capabilities: {
can_manage_instance: true,
can_use_system: false,
@@ -48,7 +49,9 @@ vi.mock('../context/StatusContext', () => ({ useStatus: () => ({ status }) }));
vi.mock('../context/WorkbenchInboxContext', () => ({ useWorkbenchInbox: () => inbox }));
vi.mock('../context/InstanceAuthorizationContext', () => ({ useInstanceAuthorization: () => instanceAuth }));
vi.mock('../context/DockProvider', () => ({
- DockProvider: ({ children }: { children: ReactNode }) => <div data-testid="dock-provider">{children}</div>,
+ DockProvider: ({ children, enabled = true }: { children: ReactNode; enabled?: boolean }) => (
+ <div data-testid="dock-provider" data-enabled={String(enabled)}>{children}</div>
+ ),
}));
vi.mock('../context/WindowManagerProvider', () => ({
WindowManagerProvider: ({ children }: { children: ReactNode }) => <>{children}</>,
@@ -69,6 +72,7 @@ vi.mock('react-i18next', () => ({
beforeEach(() => {
instanceAuth.capabilities.can_manage_instance = true;
+ instanceAuth.hasTemporaryUnrestrictedOrgAppAccess = true;
api.getConfig.mockResolvedValue({ platforms: { enabled: [] } });
api.getMemorySettings.mockResolvedValue({
status: 'failed',
@@ -125,6 +129,28 @@ describe('AppShell remote Apps access', () => {
expect(screen.getByTestId('window-layer')).toBeTruthy();
});
+ it('hides Apps surfaces and redirects App routes for non-Organization remote users', async () => {
+ instanceAuth.hasTemporaryUnrestrictedOrgAppAccess = false;
+
+ render(
+ <MemoryRouter initialEntries={['/apps/library']}>
+ <Routes>
+ <Route element={<AppShell />}>
+ <Route path="apps/library" element={<div data-testid="library-surface" />} />
+ <Route index element={<div data-testid="workbench-surface" />} />
+ </Route>
+ </Routes>
+ </MemoryRouter>,
+ );
+
+ expect(await screen.findByTestId('workbench-surface')).toBeTruthy();
+ expect(screen.queryByTestId('library-surface')).toBeNull();
+ expect(screen.queryByTestId('apps-launcher')).toBeNull();
+ expect(screen.queryByTestId('mobile-dock-drawer')).toBeNull();
+ expect(screen.queryByTestId('window-layer')).toBeNull();
+ expect(screen.getByTestId('dock-provider').getAttribute('data-enabled')).toBe('false');
+ });
+
it.each([
['owner', true],
['member', false],
diff --git a/ui/src/components/AppShell.tsx b/ui/src/components/AppShell.tsx
index 1a941922b..7e3af106c 100644
--- a/ui/src/components/AppShell.tsx
+++ b/ui/src/components/AppShell.tsx
@@ -232,7 +232,11 @@ export const AppShell: React.FC = () => {
const { t } = useTranslation();
const { status } = useStatus();
const { totalUnread } = useWorkbenchInbox();
- const { capabilities, remote } = useInstanceAuthorization();
+ const {
+ capabilities,
+ remote,
+ hasTemporaryUnrestrictedOrgAppAccess,
+ } = useInstanceAuthorization();
const api = useApi();
const location = useLocation();
const [enabledPlatforms, setEnabledPlatforms] = useState<string[]>([]);
@@ -362,6 +366,7 @@ export const AppShell: React.FC = () => {
const hasChannelPlatforms = enabledPlatforms.some((platform) => platformSupportsChannels(config, platform));
const modelHubEnabled = modelHubEnabledFromConfig(config);
const isRunning = status.state === 'running';
+ const canUseApps = !remote || hasTemporaryUnrestrictedOrgAppAccess === true;
const ownerOnlyPath =
location.pathname === '/setup' ||
@@ -377,10 +382,12 @@ export const AppShell: React.FC = () => {
const resourceUseDenied =
(location.pathname.startsWith('/skills') && !capabilities.can_use_skills) ||
(location.pathname.startsWith('/vaults') && !capabilities.can_use_vault_secrets);
+ const appAccessDenied = location.pathname.startsWith('/apps/') && !canUseApps;
if (
(ownerOnlyPath && !capabilities.can_manage_instance) ||
(localSystemPath && !capabilities.can_use_system) ||
- resourceUseDenied
+ resourceUseDenied ||
+ appAccessDenied
) {
return <Navigate to="/" replace />;
}
@@ -407,10 +414,11 @@ export const AppShell: React.FC = () => {
match: (p: string) => p.startsWith('/admin/organization'),
}]
: []),
- // Permanent escape hatch to the App Library (a workbench app). Always present,
- // so the Library is reachable from the control panel even when it is undocked
- // (§7.1c #7). Matches any /apps/library path so it stays active on the route.
- { to: '/apps/library', label: t('nav.appLibrary'), icon: LayoutGrid, match: (p) => p.startsWith('/apps/library') },
+ // Permanent escape hatch to the App Library (a workbench app) for principals
+ // covered by the current Apps policy. It stays reachable even when undocked.
+ ...(canUseApps
+ ? [{ to: '/apps/library', label: t('nav.appLibrary'), icon: LayoutGrid, match: (p: string) => p.startsWith('/apps/library') }]
+ : []),
{ to: '/admin/remote-access', label: t('nav.remoteAccess'), icon: Globe },
{
// 通讯平台: groups everything about connecting messaging platforms — the
@@ -523,7 +531,9 @@ export const AppShell: React.FC = () => {
// Apps (§7.1b): replaces the old 更多 route tab. Tapping toggles the Dock
// drawer (the mobile Dock) rather than navigating; `grid-2x2` distinguishes
// it from Capabilities' `layout-grid`.
- { label: t('nav.apps'), icon: Grid2x2, onClick: () => setAppsDrawerOpen((v) => !v), match: () => appsDrawerOpen },
+ ...(canUseApps
+ ? [{ label: t('nav.apps'), icon: Grid2x2, onClick: () => setAppsDrawerOpen((v) => !v), match: () => appsDrawerOpen }]
+ : []),
];
// Chat is a full-screen detail (own composer) and Search is a full-screen
@@ -547,7 +557,7 @@ export const AppShell: React.FC = () => {
// Desktop: normal document flow.
<WindowManagerProvider standalone={standaloneAppTab}>
<StandaloneAppTabContext.Provider value={standaloneAppTab}>
- <DockProvider>
+ <DockProvider enabled={canUseApps}>
<ShowPageDragProvider>
{/* Chromeless (single-app tab): the locked full-viewport column applies on DESKTOP too —
the app fills the browser area exactly, with nothing to scroll around it. */}
@@ -618,7 +628,7 @@ export const AppShell: React.FC = () => {
centered Chat composer. Workbench → Settings (control panel);
Control Panel → Back to Workbench, the mint counterpart. */}
<div className="flex items-stretch gap-2">
- <AppsLauncher />
+ {canUseApps && <AppsLauncher />}
{shellMode === 'workbench' && ORGANIZATION_NAV_ENABLED && (
<Link
to="/admin/organization/overview"
@@ -801,7 +811,7 @@ export const AppShell: React.FC = () => {
{/* Mobile Dock drawer — the workbench Apps tab summons it (§7.1b). Mobile-only
(md:hidden internally); mounted inside DockProvider so it reads the same
docked tiles + order as the desktop Dock. */}
- {shellMode === 'workbench' && (
+ {shellMode === 'workbench' && canUseApps && (
<MobileDockDrawer open={appsDrawerOpen} onClose={() => setAppsDrawerOpen(false)} />
)}
@@ -824,7 +834,7 @@ export const AppShell: React.FC = () => {
second launcher on top in full-screen anymore (product: avoid the fullscreen floating
button; a Dock redesign comes later). Un-maximize via the window traffic-lights to reach
the sidebar launcher. */}
- <WindowLayer />
+ {canUseApps && <WindowLayer />}
</div>
</ShowPageDragProvider>
</DockProvider>
diff --git a/ui/src/context/DockProvider.tsx b/ui/src/context/DockProvider.tsx
index db90813be..70433de08 100644
--- a/ui/src/context/DockProvider.tsx
+++ b/ui/src/context/DockProvider.tsx
@@ -20,7 +20,32 @@ import { useLatestRef } from '@/lib/useLatestRef';
// server's fresh-instance seed; reconcileDock takes over once the GET resolves.
const DEFAULT_DOC: DockDoc = seedDefaultDock();
-export const DockProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
+const DISABLED_DOCK_VALUE: DockValue = {
+ order: DEFAULT_DOC.order,
+ pins: [],
+ isPinned: () => false,
+ isDocked: (dockId) => DEFAULT_DOC.order.includes(dockId),
+ pinFor: () => null,
+ pin: () => Promise.resolve(),
+ unpin: () => Promise.resolve(),
+ dock: () => Promise.resolve(),
+ undock: () => Promise.resolve(),
+ setOrder: () => Promise.resolve(),
+};
+
+export const DockProvider: React.FC<{ children: React.ReactNode; enabled?: boolean }> = ({
+ children,
+ enabled = true,
+}) => {
+ if (!enabled) {
+ return (
+ <DockContext.Provider value={DISABLED_DOCK_VALUE}>{children}</DockContext.Provider>
+ );
+ }
+ return <EnabledDockProvider>{children}</EnabledDockProvider>;
+};
+
+const EnabledDockProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
const api = useApi();
const [doc, setDoc] = useState<DockDoc>(DEFAULT_DOC);
// Latest committed doc for the async actions' rollback (avoids stale closures).
diff --git a/ui/src/context/InstanceAuthorizationContext.ts b/ui/src/context/InstanceAuthorizationContext.ts
index 28a077055..ea15fdb42 100644
--- a/ui/src/context/InstanceAuthorizationContext.ts
+++ b/ui/src/context/InstanceAuthorizationContext.ts
@@ -6,12 +6,15 @@ import { DENIED_INSTANCE_CAPABILITIES } from '../lib/sessionInfo';
export interface InstanceAuthorizationValue {
remote: boolean;
instanceRole: 'owner' | 'editor' | 'viewer' | null;
+ /** Temporary rollout policy, derived from signed active-Organization-member claims. */
+ hasTemporaryUnrestrictedOrgAppAccess?: boolean;
capabilities: InstanceCapabilities;
}
export const InstanceAuthorizationContext = createContext<InstanceAuthorizationValue>({
remote: false,
instanceRole: null,
+ hasTemporaryUnrestrictedOrgAppAccess: false,
capabilities: DENIED_INSTANCE_CAPABILITIES,
});
diff --git a/ui/src/context/InstanceAuthorizationProvider.tsx b/ui/src/context/InstanceAuthorizationProvider.tsx
index 2eeeb6937..9f3e11e31 100644
--- a/ui/src/context/InstanceAuthorizationProvider.tsx
+++ b/ui/src/context/InstanceAuthorizationProvider.tsx
@@ -22,15 +22,23 @@ export const InstanceAuthorizationProvider = ({
return {
remote: false,
instanceRole: session.instance_role ?? 'owner',
+ hasTemporaryUnrestrictedOrgAppAccess: false,
capabilities: session.capabilities ?? OWNER_INSTANCE_CAPABILITIES,
};
}
if (!session.authenticated) {
- return { remote: true, instanceRole: null, capabilities: DENIED_INSTANCE_CAPABILITIES };
+ return {
+ remote: true,
+ instanceRole: null,
+ hasTemporaryUnrestrictedOrgAppAccess: false,
+ capabilities: DENIED_INSTANCE_CAPABILITIES,
+ };
}
return {
remote: true,
instanceRole: session.instance_role,
+ hasTemporaryUnrestrictedOrgAppAccess:
+ session.temporary_unrestricted_org_app_access,
capabilities: session.capabilities,
};
}, [session]);
diff --git a/ui/src/lib/sessionInfo.test.ts b/ui/src/lib/sessionInfo.test.ts
index 04a9b2cf1..d3dac21ad 100644
--- a/ui/src/lib/sessionInfo.test.ts
+++ b/ui/src/lib/sessionInfo.test.ts
@@ -34,6 +34,7 @@ describe('normalizeSessionInfo', () => {
sub: 'owner-1',
instance_role: 'owner',
+ temporary_unrestricted_org_app_access: false,
capabilities: OWNER_INSTANCE_CAPABILITIES,
});
});
@@ -44,6 +45,7 @@ describe('normalizeSessionInfo', () => {
authenticated: true,
instance_role: 'viewer',
+ temporary_unrestricted_org_app_access: false,
capabilities: {
can_read_instance: true,
can_use_show_pages: true,
@@ -55,6 +57,7 @@ describe('normalizeSessionInfo', () => {
authenticated: true,
instance_role: 'viewer',
+ temporary_unrestricted_org_app_access: false,
capabilities: {
...DENIED_INSTANCE_CAPABILITIES,
can_read_instance: true,
@@ -63,6 +66,20 @@ describe('normalizeSessionInfo', () => {
});
});
+ it('preserves the temporary Organization policy signal without projecting a capability', () => {
+ const session = normalizeSessionInfo({
+ remote: true,
+ authenticated: true,
+ email: '[email protected]',
+ instance_role: 'viewer',
+ temporary_unrestricted_org_app_access: true,
+ capabilities: { can_read_instance: true },
+ });
+
+ expect(session.temporary_unrestricted_org_app_access).toBe(true);
+ expect(session.capabilities.can_use_system).toBe(false);
+ });
+
it('keeps local sessions owner-compatible when an older server omits capabilities', () => {
expect(normalizeSessionInfo({ remote: false })).toEqual({
remote: false,
diff --git a/ui/src/lib/sessionInfo.ts b/ui/src/lib/sessionInfo.ts
index 49341ac93..02a7ec4f5 100644
--- a/ui/src/lib/sessionInfo.ts
+++ b/ui/src/lib/sessionInfo.ts
@@ -24,6 +24,7 @@ export type SessionInfo =
email: string;
sub?: string;
instance_role: 'owner' | 'editor' | 'viewer';
+ temporary_unrestricted_org_app_access: boolean;
capabilities: InstanceCapabilities;
};
@@ -101,6 +102,8 @@ export const normalizeSessionInfo = (value: unknown): SessionInfo => {
email: typeof value.email === 'string' ? value.email : '',
...(typeof value.sub === 'string' ? { sub: value.sub } : {}),
instance_role: instanceRole,
+ temporary_unrestricted_org_app_access:
+ value.temporary_unrestricted_org_app_access === true,
capabilities,
};
};
diff --git a/vibe/authorization.py b/vibe/authorization.py
index f62961e2a..7027cd7cf 100644
--- a/vibe/authorization.py
+++ b/vibe/authorization.py
@@ -183,7 +183,7 @@ class AuthorizationContext:
def has_temporary_unrestricted_org_app_access(
- context: AuthorizationContext | None,
+ context: AuthorizationContext | Mapping[str, Any] | None,
) -> bool:
"""Return whether the temporary Organization Apps policy applies.
@@ -193,11 +193,18 @@ def has_temporary_unrestricted_org_app_access(
Show Page email grants remain confined to their signed page subtree.
"""
+ resolved = (
+ context
+ if isinstance(context, AuthorizationContext)
+ else context_from_session_payload(context)
+ if context is not None
+ else None
+ )
return bool(
- context is not None
- and context.is_remote
- and context.instance_access_source != "show_page_email"
- and context.is_active_organization_member
+ resolved is not None
+ and resolved.is_remote
+ and resolved.instance_access_source != "show_page_email"
+ and resolved.is_active_organization_member
)
@@ -337,6 +344,8 @@ def can_receive_workbench_event(
) -> bool:
"""Return whether an SSE subscriber may receive a workbench event."""
+ if event_type == "show.event" and has_temporary_unrestricted_org_app_access(context):
+ return True
try:
require_instance_role(context, required_workbench_event_role(event_type))
except InstanceAuthorizationError:
@@ -357,7 +366,6 @@ _VIEWER_HTTP_RULES = tuple(
r"^/api/projects(?:/[^/]+)?$",
r"^/api/workbench/prefs$",
r"^/api/workbench/projects-bootstrap$",
- r"^/api/dock$",
r"^/api/sessions$",
r"^/api/sessions/[^/]+$",
r"^/api/sessions/[^/]+/(?:bootstrap|messages|activity|turn-state)$",
@@ -466,6 +474,7 @@ _REMOTE_PAYLOAD_FILTERED_HTTP_RULES = tuple(
_TEMPORARY_ORGANIZATION_APP_HTTP_RULES = tuple(
(methods, re.compile(pattern))
for methods, pattern in (
+ (frozenset({"GET", "HEAD"}), r"^/api/dock$"),
(frozenset({"POST"}), r"^/api/dock/pins$"),
(frozenset({"DELETE"}), r"^/api/dock/pins/[^/]+$"),
(frozenset({"PUT"}), r"^/api/dock/order$"),
@@ -507,10 +516,8 @@ _REMOTE_OWNER_ALLOWED_HTTP_RULES = tuple(
frozenset({"GET", "HEAD", "PUT"}),
r"^/api/show-pages/[^/]+/authorized-emails$",
),
- # Reading the Dock remains generally remote-safe. Dock writes are not
- # listed here: the temporary Organization Apps matrix above admits only
- # active members, while Workbench preference writes remain local-only.
- (frozenset({"GET", "HEAD"}), r"^/api/dock$"),
+ # Dock reads and writes are admitted only by the temporary Organization
+ # Apps matrix above; Workbench preference writes remain local-only.
# Reading push status stays remote, and so does the `POST` form of it:
# it reports this principal's own subscription count and can only
# re-attach a device id to an endpoint that is already stored and
diff --git a/vibe/ui_server.py b/vibe/ui_server.py
index f66eff4c9..9f8384f55 100644
--- a/vibe/ui_server.py
+++ b/vibe/ui_server.py
@@ -6557,7 +6557,11 @@ def remote_access_auth_callback():
@app.route("/api/session", methods=["GET"])
def api_session():
from vibe import remote_access
- from vibe.authorization import context_from_session_payload, trusted_local_context
+ from vibe.authorization import (
+ context_from_session_payload,
+ has_temporary_unrestricted_org_app_access,
+ trusted_local_context,
+ )
config = _load_remote_access_config()
if config is None or not _is_remote_access_request(config):
@@ -6592,6 +6596,9 @@ def api_session():
"email": str(payload.get("email", "")),
"sub": str(payload.get("sub", "")),
"instance_role": context.instance_role,
+ "temporary_unrestricted_org_app_access": (
+ has_temporary_unrestricted_org_app_access(context)
+ ),
"capabilities": context.capability_projection(),
}
)