Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

feat(integrations): unify semantic credential management

Rahman232ad9572674
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 409fa896..16ab9f66 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -8,6 +8,8 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Added**
+- `integrations` unify semantic credential management
+- add bounded Dokploy Dockerfile build operation
- `mcp` add session cards, readable logs and handover guide
- split MCP access and add plugin registry
diff --git a/docs/INTEGRATIONS.md b/docs/INTEGRATIONS.md
index 29e4fb31..50bf8010 100644
--- a/docs/INTEGRATIONS.md
+++ b/docs/INTEGRATIONS.md
@@ -56,11 +56,22 @@ not prove the external session is authorized, and MSO never falls back to a loca
Open `/integrations`. Public instructions are readable before sign-in; an Owner
session is required to read/manage credential profiles or open their private forms.
Choose the credential user, provider, named connection, source and authentication.
-User creation/rename/duplicate/default/deletion, folder mappings, connection CRUD,
-verification and credential clearing use the same metadata actions as the CLI/MCP.
-User duplication copies metadata by default. Copying direct credential values needs
-the separate explicit `copyCredentials` opt-in; external linked identities are never
-copied into a different profile.
+The browser workbench keeps **Users**, **Routing**, and **Transfer** visible instead of
+hiding identity management in a generic settings menu. The credential-owner picker is
+a semantic-token listbox rather than a native OS select, so dark/light rendering stays
+consistent across desktop and mobile. User creation/rename/duplicate/default/deletion,
+folder mappings, connection CRUD/defaults, verification, per-field credential removal,
+and full credential clearing use the same metadata actions as the CLI/MCP.
+
+A direct named connection can also be **shared** to another credential user as a
+read-only alias. The alias resolves the owner's current backing credential at use time,
+so rotations propagate without copying a second plaintext value. Alias metadata can be
+renamed or selected as that user's default, but credential edits and re-sharing are
+refused. Backing connection/user deletion is blocked while dependents exist; **Unshare**
+removes only the alias. User duplication materializes an incoming alias into an
+independent direct connection: metadata-only by default, or values only with the
+explicit `copyCredentials` opt-in. External linked identities are never copied into a
+different profile.
The secure form is bound to an **existing direct connection**, not just a provider.
It displays official guidance, masked fields, show/hide, and Validate & save. Blank
@@ -164,6 +175,14 @@ and `cwd` and use the same resolver. Their owner HTTP routes also accept this se
The compatibility provider APIs operate on a resolved connection, not a parallel store.
New native provider operations must reuse this resolver rather than read unscoped keys.
+SI-Coder's runtime **custom-provider definition CRUD** is intentionally not mirrored
+into MSO's reviewed execution catalog yet. MSO's provider IDs are also operation guards:
+turning arbitrary metadata into executable providers would weaken the bounded-tool
+contract. Custom provider schema editing therefore remains SC-owned until MSO has a
+separate metadata-only dynamic registry whose entries cannot acquire network/exec
+capabilities implicitly. This is a deliberate safety boundary, not a hidden or fake
+browser control.
+
The twelve native service definitions provide credential setup and verification.
This release does **not** add every service's entire API or replace provider-owned
OAuth clients. Explicit direct execution covers Dokploy project listing/ensure,
diff --git a/lib/host/audit.test.ts b/lib/host/audit.test.ts
index 41226be1..ed1742e6 100644
--- a/lib/host/audit.test.ts
+++ b/lib/host/audit.test.ts
@@ -173,9 +173,12 @@ describe("test-run guard", () => {
// forgets to stub OS_AUDIT_LOG now writes nowhere instead of into their log.
vi.stubEnv("OS_AUDIT_LOG", "");
const home = path.join(os.homedir(), ".mso", "audit.log");
- const before = await fs.readFile(home, "utf8").catch(() => "");
- await audit({ action: "exec.run", target: "should-never-be-written" });
+ const marker = `vitest-audit-guard-${process.pid}-${Date.now()}`;
+ await audit({ action: "exec.run", target: marker });
const after = await fs.readFile(home, "utf8").catch(() => "");
- expect(after).toBe(before);
+ // The live MSO server may legitimately append unrelated audit entries while
+ // this suite runs. Assert on this test's unique marker rather than requiring
+ // the owner's whole forensic log to remain byte-identical.
+ expect(after).not.toContain(marker);
});
});
diff --git a/lib/infra/connection-manage.ts b/lib/infra/connection-manage.ts
index 50ac4778..e3b517e9 100644
--- a/lib/infra/connection-manage.ts
+++ b/lib/infra/connection-manage.ts
@@ -3,13 +3,13 @@ import { randomUUID } from "node:crypto";
import { mutateIntegrationState } from "./connection-storage";
import { createConnectionIn, summaryIn } from "./connection-service";
import { IntegrationError, identity, connectionLabel, canonicalFolder, selectConnection, metadataOnly, assertNotBusy, type ConnectionSource } from "./identity";
-export const INTEGRATION_ACTIONS=["user.create","user.rename","user.duplicate","user.delete","user.default","folder.map","folder.unmap","connection.create","connection.rename","connection.default","connection.delete","credential.delete"] as const;
+export const INTEGRATION_ACTIONS=["user.create","user.rename","user.duplicate","user.delete","user.default","folder.map","folder.unmap","connection.create","connection.rename","connection.default","connection.delete","connection.share","connection.unshare","credential.delete"] as const;
export async function integrationManage(input:Record<string,unknown>){
metadataOnly(input);if(input.confirm!==true)throw new IntegrationError("confirmation_required",403);
const shapes:Record<string,string[]>={
"user.create":["user","label"],"user.rename":["user","target","label"],"user.duplicate":["user","target","label","copyCredentials"],"user.delete":["user"],"user.default":["user"],
"folder.map":["user","path","provider","connection"],"folder.unmap":["path"],"connection.create":["user","provider","connection","label","source","authMethod","makeDefault"],
- "connection.rename":["user","provider","connection","label"],"connection.default":["user","provider","connection"],"connection.delete":["user","provider","connection"],"credential.delete":["user","provider","connection","key"],
+ "connection.rename":["user","provider","connection","label"],"connection.default":["user","provider","connection"],"connection.delete":["user","provider","connection"],"connection.share":["user","provider","connection","target","label","makeDefault"],"connection.unshare":["user","provider","connection"],"credential.delete":["user","provider","connection","key"],
};
const action=String(input.action);if(!shapes[action]||Object.keys(input).some(k=>!["action","confirm",...shapes[action]].includes(k)))throw new IntegrationError("invalid_management_fields");
return mutateIntegrationState(state=>{
@@ -22,16 +22,19 @@ export async function integrationManage(input:Record<string,unknown>){
const profile=state.users[user];if(!profile)throw new IntegrationError("user_not_found",404);
if(action==="user.default"){state.defaultUser=user;return{ok:true,action,user};}
if(action==="user.delete"){
+ if(Object.values(state.users).some(u=>Object.values(u.connections).some(rows=>Object.values(rows).some(c=>c.sharedFrom?.user===user))))throw new IntegrationError("user_has_shared_dependents",409);
Object.values(profile.connections).flatMap(Object.values).forEach(assertNotBusy);
delete state.users[user];state.bindings=state.bindings.filter(b=>b.user!==user);if(state.defaultUser===user)state.defaultUser=null;return{ok:true,action,user};
}
if(action==="user.rename"||action==="user.duplicate"){
const target=identity(input.target,"target");if(Object.hasOwn(state.users,target))throw new IntegrationError("user_exists",409);
Object.values(profile.connections).flatMap(Object.values).forEach(assertNotBusy);
- const copy=structuredClone(profile);copy.id=target;if(action==="user.duplicate")copy.uid=randomUUID();copy.label=connectionLabel(input.label??target);
+ const copy=structuredClone(profile);copy.id=target;
+ // A duplicate must not retain an invisible dependency on a sharing owner.
+ if(action==="user.duplicate")for(const rows of Object.values(copy.connections))for(const c of Object.values(rows))if(c.sharedFrom){const ref=c.sharedFrom,owner=state.users[ref.user]?.connections[ref.provider]?.[ref.connection];if(!owner)throw new IntegrationError("shared_backing_not_found",409);c.values={...owner.values};delete c.sharedFrom;}if(action==="user.duplicate")copy.uid=randomUUID();copy.label=connectionLabel(input.label??target);
for(const rows of Object.values(copy.connections))for(const c of Object.values(rows)){c.uid=randomUUID();c.revision++;c.updatedAt=Date.now();delete c.lease;if(action==="user.duplicate"&&input.copyCredentials!==true){c.values={};delete c.verifiedAt;}if(action==="user.duplicate"&&c.source!=="direct"){c.external=undefined;delete c.verifiedAt;}}
state.users[target]=copy;
- if(action==="user.rename"){delete state.users[user];for(const b of state.bindings)if(b.user===user)b.user=target;if(state.defaultUser===user)state.defaultUser=target;}
+ if(action==="user.rename"){delete state.users[user];for(const u of Object.values(state.users))for(const rows of Object.values(u.connections))for(const c of Object.values(rows))if(c.sharedFrom?.user===user)c.sharedFrom.user=target;for(const b of state.bindings)if(b.user===user)b.user=target;if(state.defaultUser===user)state.defaultUser=target;}
return{ok:true,action,user:target};
}
if(action==="folder.map"){
@@ -42,9 +45,22 @@ export async function integrationManage(input:Record<string,unknown>){
const provider=identity(input.provider,"provider"),connection=identity(input.connection,"connection");
if(action==="connection.create"){const c=createConnectionIn(state,{user,provider,connection,label:input.label as string|undefined,source:input.source as ConnectionSource|undefined,authMethod:input.authMethod as string|undefined,makeDefault:input.makeDefault===true});return{ok:true,action,connection:summaryIn(state,user,c)};}
const {connection:c}=selectConnection(state,provider,{user,connection});assertNotBusy(c);
+ if(action==="connection.share"){
+ if(c.source!=="direct")throw new IntegrationError("external_connections_cannot_share",409);if(c.sharedFrom)throw new IntegrationError("shared_alias_cannot_share",409);
+ const target=identity(input.target,"target"), targetUser=state.users[target];if(!targetUser)throw new IntegrationError("user_not_found",404);if(target===user)throw new IntegrationError("shared_alias_same_user",409);
+ const rows=targetUser.connections[provider]??{},rawBase=String(input.label??connection).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"shared",base=rawBase.slice(0,56),id=Array.from({length:100},(_,i)=>i?`${base.slice(0,61-String(i+1).length)}-${i+1}`:base).find(x=>!Object.hasOwn(rows,x));if(!id)throw new IntegrationError("connection_alias_limit",409);identity(id,"connection");
+ const alias=structuredClone(c);alias.id=id;alias.uid=randomUUID();alias.label=connectionLabel(input.label??c.label);alias.values={};alias.sharedFrom={user,connection,provider};alias.revision++;alias.createdAt=Date.now();alias.updatedAt=Date.now();delete alias.lease;
+ targetUser.connections[provider]={...rows,[id]:alias};if(input.makeDefault===true||!targetUser.defaults[provider])targetUser.defaults[provider]=id;return{ok:true,action,connection:summaryIn(state,target,alias)};
+ }
+ if(action==="connection.unshare"){
+ if(!c.sharedFrom)throw new IntegrationError("connection_not_shared",409);delete profile.connections[provider][connection];if(profile.defaults[provider]===connection)delete profile.defaults[provider];return{ok:true,action,user,provider,connection};
+ }
+ if(c.sharedFrom&&action==="connection.delete")throw new IntegrationError("shared_alias_use_unshare",409);
+ if(c.sharedFrom&&action==="credential.delete")throw new IntegrationError("shared_alias_readonly",409);
if(action==="connection.default")profile.defaults[provider]=connection;
if(action==="connection.rename"){c.label=connectionLabel(input.label);c.updatedAt=Date.now();}
if(action==="connection.delete"){
+ if(Object.values(state.users).some(u=>Object.values(u.connections).some(rows=>Object.values(rows).some(x=>x.sharedFrom?.user===user&&x.sharedFrom.connection===connection&&x.provider===provider))))throw new IntegrationError("connection_has_shared_dependents",409);
if(state.bindings.some(b=>b.user===user&&b.connections[provider]===connection))throw new IntegrationError("connection_has_folder_binding",409);
if(Object.values(profile.connections).some(rows=>Object.values(rows).some(x=>x.source==="composio"&&x.external?.brokerConnection===connection&&provider==="composio")))throw new IntegrationError("broker_has_linked_connections",409);
delete profile.connections[provider][connection];if(profile.defaults[provider]===connection)delete profile.defaults[provider];return{ok:true,action,user,provider,connection};
diff --git a/lib/infra/connection-model.test.ts b/lib/infra/connection-model.test.ts
index 846120f3..9c101b3b 100644
--- a/lib/infra/connection-model.test.ts
+++ b/lib/infra/connection-model.test.ts
@@ -90,6 +90,28 @@ describe("native credential identity core",()=>{
await f.manage({action:"user.duplicate",confirm:true,user:"alice",target:"key-copy",copyCredentials:true});expect((await f.directConnectionValues("github",{user:"key-copy",connection:"work"})).apiKey).toBe(KEY_A);
await f.manage({action:"folder.map",confirm:true,user:"alice",path:root});await f.manage({action:"user.rename",confirm:true,user:"alice",target:"renamed"});expect((await f.integrationQuery({view:"which",cwd:root}) as {user:string}).user).toBe("renamed");
});
+ it("shares direct credentials as read-only aliases with live backing, safe ids, rename/default, duplication, and unshare invariants",async()=>{
+ const f=await fixture();await f.add("alice","github","work","direct",{apiKey:KEY_A});
+ const shared=await f.manage({action:"connection.share",confirm:true,user:"alice",provider:"github",connection:"work",target:"bob",label:"Shared Work GitHub"}) as {connection:{id:string}};
+ expect(shared.connection.id).toBe("shared-work-github");
+ let bob=await f.integrationSnapshot({user:"bob"});const alias=bob.connections.find(c=>c.id===shared.connection.id)!;expect(alias.sharedFrom).toEqual({user:"alice",provider:"github",connection:"work"});expect(alias.fields.find(f=>f.key==="apiKey")?.stored).toBe(true);expect(JSON.stringify(alias)).not.toContain(KEY_A);
+ expect((await f.directConnectionValues("github",{user:"bob",connection:alias.id})).apiKey).toBe(KEY_A);
+ await expect(f.credentialSnapshot("github",{user:"bob",connection:alias.id})).rejects.toMatchObject({code:"shared_alias_readonly"});
+ await expect(f.manage({action:"credential.delete",confirm:true,user:"bob",provider:"github",connection:alias.id,key:"apiKey"})).rejects.toMatchObject({code:"shared_alias_readonly"});
+ await expect(f.manage({action:"connection.share",confirm:true,user:"bob",provider:"github",connection:alias.id,target:"alice",label:"No reshare"})).rejects.toMatchObject({code:"shared_alias_cannot_share"});
+ await f.manage({action:"connection.rename",confirm:true,user:"bob",provider:"github",connection:alias.id,label:"Renamed shared account"});await f.manage({action:"connection.default",confirm:true,user:"bob",provider:"github",connection:alias.id});
+ const owner=await f.credentialSnapshot("github",{user:"alice",connection:"work"});await f.saveConnectionValues("github",{user:"alice",connection:"work"},{apiKey:KEY_B},owner.connection);expect((await f.directConnectionValues("github",{user:"bob",connection:alias.id})).apiKey).toBe(KEY_B);
+ await expect(f.manage({action:"connection.delete",confirm:true,user:"alice",provider:"github",connection:"work"})).rejects.toMatchObject({code:"connection_has_shared_dependents"});await expect(f.manage({action:"user.delete",confirm:true,user:"alice"})).rejects.toMatchObject({code:"user_has_shared_dependents"});
+ await f.manage({action:"user.rename",confirm:true,user:"alice",target:"owner-renamed"});bob=await f.integrationSnapshot({user:"bob"});expect(bob.connections.find(c=>c.id===alias.id)?.sharedFrom?.user).toBe("owner-renamed");
+ await f.manage({action:"user.duplicate",confirm:true,user:"bob",target:"bob-empty"});const empty=await f.integrationSnapshot({user:"bob-empty"});expect(empty.connections[0].sharedFrom).toBeNull();expect(await f.directConnectionValues("github",{user:"bob-empty",connection:alias.id})).toEqual({});
+ await f.manage({action:"user.duplicate",confirm:true,user:"bob",target:"bob-copy",copyCredentials:true});const copied=await f.integrationSnapshot({user:"bob-copy"});expect(copied.connections[0].sharedFrom).toBeNull();expect((await f.directConnectionValues("github",{user:"bob-copy",connection:alias.id})).apiKey).toBe(KEY_B);
+ await f.manage({action:"connection.unshare",confirm:true,user:"bob",provider:"github",connection:alias.id});expect((await f.integrationSnapshot({user:"bob"})).connections).toHaveLength(0);await expect(f.manage({action:"connection.unshare",confirm:true,user:"bob-copy",provider:"github",connection:alias.id})).rejects.toMatchObject({code:"connection_not_shared"});
+ await f.manage({action:"connection.delete",confirm:true,user:"owner-renamed",provider:"github",connection:"work"});
+ });
+ it("rejects sharing external sources and deletes one direct credential field without exposing values",async()=>{
+ const f=await fixture();await f.add("alice","github","hosted","oauth2",{},"composio");await expect(f.manage({action:"connection.share",confirm:true,user:"alice",provider:"github",connection:"hosted",target:"bob",label:"Hosted share"})).rejects.toMatchObject({code:"external_connections_cannot_share"});
+ await f.add("alice","convex-cloud","deploy","deployment",{deployKey:KEY_A,deploymentName:"test-deployment"});await f.manage({action:"credential.delete",confirm:true,user:"alice",provider:"convex-cloud",connection:"deploy",key:"deploymentName"});const values=await f.directConnectionValues("convex-cloud",{user:"alice",connection:"deploy"});expect(values).toEqual({deployKey:KEY_A});const row=(await f.integrationSnapshot({user:"alice"})).connections.find(c=>c.id==="deploy")!;expect(row.missing).toContain("deploymentName");expect(JSON.stringify(row)).not.toContain(KEY_A);
+ });
it("rejects secret-shaped machine input, unconfirmed writes, and identity pollution",async()=>{
const f=await fixture();await expect(f.manage({action:"user.create",user:"eve"})).rejects.toMatchObject({code:"confirmation_required"});
await expect(f.integrationQuery({view:"snapshot",nested:{token:"synthetic"}})).rejects.toMatchObject({code:"secret_input_forbidden"});
diff --git a/lib/infra/connection-registry.ts b/lib/infra/connection-registry.ts
index 637c40f6..7088e367 100644
--- a/lib/infra/connection-registry.ts
+++ b/lib/infra/connection-registry.ts
@@ -28,9 +28,9 @@ export function connectionMethod(provider:string,source:ConnectionSource,method?
}
export function connectionSources(provider:string){return ["direct",...(COMPOSIO[provider]?["composio"]:[]),...(NATIVE[provider]?["native-mcp"]:[])] as ConnectionSource[];}
export function connectionCatalog(){return listInfraProviderDefinitions().map(p=>({id:p.id,title:p.title,description:p.description,sources:connectionSources(p.id).map(id=>({id,label:id==="direct"?"MSO direct":id==="composio"?"Composio":"Provider MCP",methods:connectionMethods(p.id,id)}))}));}
-export function connectionSummary(user:string,c:IntegrationConnection,isDefault=false){
- const method=connectionMethod(c.provider,c.source,c.authMethod),missing=method.fields.filter(f=>f.required&&!c.values[f.key]).map(f=>f.key);
- return {user,id:c.id,label:c.label,provider:c.provider,source:c.source,authMethod:c.authMethod,scope:c.scope,revision:c.revision,isDefault,missing,fields:method.fields.map(f=>({...f,stored:Boolean(c.values[f.key])})),state:c.source==="direct"?(missing.length?"incomplete":c.lastCheck?(c.lastCheck.revision===c.revision?c.lastCheck.result:"configured"):c.verifiedAt?"verified":"configured"):c.external?.status??"authorization-required",verifiedAt:c.verifiedAt??null,lastCheck:c.lastCheck?.revision===c.revision?c.lastCheck:null,external:c.external??null};
+export function connectionSummary(user:string,c:IntegrationConnection,isDefault=false,values:Record<string,string>=c.values){
+ const method=connectionMethod(c.provider,c.source,c.authMethod),missing=method.fields.filter(f=>f.required&&!values[f.key]).map(f=>f.key);
+ return {user,id:c.id,label:c.label,provider:c.provider,source:c.source,authMethod:c.authMethod,scope:c.scope,revision:c.revision,isDefault,missing,fields:method.fields.map(f=>({...f,stored:Boolean(values[f.key])})),state:c.source==="direct"?(missing.length?"incomplete":c.lastCheck?(c.lastCheck.revision===c.revision?c.lastCheck.result:"configured"):c.verifiedAt?"verified":"configured"):c.external?.status??"authorization-required",verifiedAt:c.verifiedAt??null,lastCheck:c.lastCheck?.revision===c.revision?c.lastCheck:null,sharedFrom:c.sharedFrom??null,external:c.external??null};
}
export const composioDefinition=(provider:string)=>COMPOSIO[provider];
export const nativeDefinition=(provider:string)=>NATIVE[provider];
diff --git a/lib/infra/connection-service.ts b/lib/infra/connection-service.ts
index 2fb544f5..7b80e94a 100644
--- a/lib/infra/connection-service.ts
+++ b/lib/infra/connection-service.ts
@@ -2,7 +2,7 @@ import { randomUUID } from "node:crypto";
import { AsyncLocalStorage } from "node:async_hooks";
import { connectionCatalog, connectionMethod, connectionSummary, nativeDefinition } from "./connection-registry";
import { readIntegrationState, mutateIntegrationState } from "./connection-storage";
-import { IntegrationError, identity, connectionLabel, selectConnection, resolveUser, folderBinding, metadataOnly, assertNotBusy, type ConnectionSelector, type IntegrationState, type IntegrationConnection, type ConnectionSource } from "./identity";
+import { IntegrationError, identity, connectionLabel, selectConnection, resolveUser, folderBinding, metadataOnly, assertNotBusy, resolveSharedConnection, type ConnectionSelector, type IntegrationState, type IntegrationConnection, type ConnectionSource } from "./identity";
import { normalizeInfraValues, isInfraProviderId } from "./catalog";
const CONTEXT=new AsyncLocalStorage<{selector:ConnectionSelector; pinned:Map<string,Record<string,string>>}>();
export function withIntegrationSelection<T>(selector:ConnectionSelector,fn:()=>T){return CONTEXT.run({selector,pinned:new Map()},fn);}
@@ -12,9 +12,9 @@ export async function directConnectionValues(provider:string,selector:Connection
const state=await readIntegrationState();if(!Object.keys(state.users).length&&!selector.user&&!selector.connection)return{};
let result;try{result=selectConnection(state,provider,selector);}catch(e){if(e instanceof IntegrationError&&e.code==="connection_not_found"&&!selector.connection&&!folderBinding(state,selector.cwd)?.connections[provider]&&!state.users[resolveUser(state,selector)]?.defaults[provider])return{};throw e;}
if(result.connection.source!=="direct")throw new IntegrationError("external_source_requires_own_executor",409);
- const copy={...result.connection.values};if(context&&context.selector===selector)context.pinned.set(provider,copy);return copy;
+ const copy={...resolveSharedConnection(state,result.user,result.connection).connection.values};if(context&&context.selector===selector)context.pinned.set(provider,copy);return copy;
}
-export function summaryIn(state:IntegrationState,user:string,c:IntegrationConnection){return connectionSummary(user,c,state.users[user].defaults[c.provider]===c.id);}
+export function summaryIn(state:IntegrationState,user:string,c:IntegrationConnection){return connectionSummary(user,c,state.users[user].defaults[c.provider]===c.id,resolveSharedConnection(state,user,c).connection.values);}
export async function resolveIntegration(provider:string,selector:ConnectionSelector={}){
const state=await readIntegrationState(),resolved=selectConnection(state,provider,selector),c=resolved.connection;
return{...summaryIn(state,resolved.user,c),resolution:resolved.reason,execution:c.source==="direct"?{route:"native-direct"}:c.source==="composio"?{route:"composio",connectedAccountId:c.external?.connectedAccountId??null,toolkit:c.external?.toolkit??null}:{route:"provider-mcp",endpoint:nativeDefinition(provider)?.url??null,authorization:"provider-client-owned"}};
@@ -34,12 +34,12 @@ export function createConnectionIn(state:IntegrationState,input:{user:string;pro
}
export async function credentialSnapshot(provider:string,selector:ConnectionSelector){
const state=await readIntegrationState(),r=selectConnection(state,provider,selector);
- if(r.connection.source!=="direct")throw new IntegrationError("external_secrets_forbidden",409);
+ if(r.connection.source!=="direct")throw new IntegrationError("external_secrets_forbidden",409);if(r.connection.sharedFrom)throw new IntegrationError("shared_alias_readonly",409);
return{user:r.user,connection:structuredClone(r.connection)};
}
export async function saveConnectionValues(provider:string,selector:ConnectionSelector,values:Record<string,unknown>,expected:{uid:string;revision:number},verified=true){
return mutateIntegrationState(state=>{
- const r=selectConnection(state,provider,selector),c=r.connection;assertNotBusy(c);if(c.source!=="direct")throw new IntegrationError("external_secrets_forbidden",409);
+ const r=selectConnection(state,provider,selector),c=r.connection;assertNotBusy(c);if(c.source!=="direct")throw new IntegrationError("external_secrets_forbidden",409);if(c.sharedFrom)throw new IntegrationError("shared_alias_readonly",409);
if(c.uid!==expected.uid||c.revision!==expected.revision)throw new IntegrationError("connection_changed_reopen_setup",409);
if(!isInfraProviderId(provider))throw new IntegrationError("unknown_provider",404);
const method=connectionMethod(provider,c.source,c.authMethod),allowed=new Set(method.fields.map(f=>f.key));
diff --git a/lib/infra/connection-storage.ts b/lib/infra/connection-storage.ts
index 854a5763..0c0fcce8 100644
--- a/lib/infra/connection-storage.ts
+++ b/lib/infra/connection-storage.ts
@@ -19,7 +19,7 @@ async function readRaw():Promise<{raw:Record<string,unknown>;bytes:string}|null>
function validate(d:IntegrationState):IntegrationState{
if(d.version!==2||!d.instanceId||!d.users||typeof d.users!=="object"||Array.isArray(d.users)||!Array.isArray(d.bindings))throw new IntegrationError("invalid_integration_store");
for(const [id,u] of Object.entries(d.users)){identity(id);if(u.id!==id||!u.connections||!u.defaults)throw new IntegrationError("invalid_integration_store");
- for(const [p,rows]of Object.entries(u.connections)){identity(p);for(const [cid,c]of Object.entries(rows)){identity(cid);if(c.id!==cid||c.provider!==p||!c.uid||!Number.isInteger(c.revision)||!c.values||typeof c.values!=="object"||Array.isArray(c.values)||Object.values(c.values).some(v=>typeof v!=="string"))throw new IntegrationError("invalid_connection_store");connectionMethod(c.provider,c.source,c.authMethod);if(c.source!=="direct"&&Object.keys(c.values).length)throw new IntegrationError("external_secrets_forbidden");}}
+ for(const [p,rows]of Object.entries(u.connections)){identity(p);for(const [cid,c]of Object.entries(rows)){identity(cid);if(c.id!==cid||c.provider!==p||!c.uid||!Number.isInteger(c.revision)||!c.values||typeof c.values!=="object"||Array.isArray(c.values)||Object.values(c.values).some(v=>typeof v!=="string"))throw new IntegrationError("invalid_connection_store");connectionMethod(c.provider,c.source,c.authMethod);if(c.sharedFrom&&(!c.sharedFrom.user||!c.sharedFrom.connection||c.sharedFrom.provider!==p||c.source!=="direct"||Object.keys(c.values).length))throw new IntegrationError("invalid_shared_connection");if(c.source!=="direct"&&Object.keys(c.values).length)throw new IntegrationError("external_secrets_forbidden");}}
}
return d;
}
diff --git a/lib/infra/connection-ui-style.ts b/lib/infra/connection-ui-style.ts
index 831799a1..2d81d060 100644
--- a/lib/infra/connection-ui-style.ts
+++ b/lib/infra/connection-ui-style.ts
@@ -34,8 +34,7 @@ export const CONNECTION_MANAGER_STYLE = String.raw`
.integration .connection-state{font-size:12px;line-height:1.5;border:1px solid var(--sep-strong);border-radius:99px;padding:3px 9px;white-space:nowrap}
.integration .connection-state[data-ready=true]{color:var(--success-text);background:color-mix(in srgb,var(--success-text) 10%,var(--surface))}
.integration .identity-tags{display:flex;flex-wrap:wrap;gap:6px;margin:14px 0;color:var(--text-dim);font-size:12px}
-.integration .identity-tags span+span:before{content:"·";margin-right:6px}
-.integration .identity-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
+.integration .identity-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}.integration .identity-workbench{margin-top:0}.integration .identity-credential-status{display:grid;gap:6px;margin:14px 0;font-size:13px}.integration .identity-credential-status>div{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--sep)}.integration .credential-field-state{font-size:12px;color:var(--warning)}.integration .credential-field-state[data-stored=true]{color:var(--success-text)}
.integration .identity-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:18px 0}
.integration .identity-fields label{min-width:0}.integration .identity-fields input,.integration .identity-fields select{margin-top:6px}
.integration .identity-feedback{min-height:24px;margin:12px 0;color:var(--text-dim);overflow-wrap:anywhere}
@@ -53,5 +52,9 @@ export const CONNECTION_MANAGER_STYLE = String.raw`
.integration .identity-summary dl{display:flex;gap:24px;flex-wrap:wrap;margin:0}.integration .identity-summary dt{font-size:12px;color:var(--text-dim)}.integration .identity-summary dd{font-weight:700;font-size:20px;margin:2px 0 0}
.integration :is(button,a,input,select,summary):focus-visible{outline:2px solid var(--os-accent);outline-offset:3px}
@media(max-width:760px){.integration.manager{--integration-rail:180px;--integration-gap:16px}.integration .identity-providers{padding-right:12px}.integration .identity-heading{align-items:start}.integration .identity-count{white-space:normal;text-align:right}.integration .identity-summary dl{gap:16px}}
-@media(max-width:560px){.integration .identity-layout{grid-template-columns:1fr;gap:18px}.integration .identity-providers{grid-template-columns:repeat(2,minmax(0,1fr));max-height:240px;overflow-y:auto;padding:0 0 12px;border:0;border-bottom:1px solid var(--sep)}.integration .identity-providers input{grid-column:1/-1;position:sticky;top:0;background:var(--surface);z-index:1}.integration .identity-providers button{font-size:12px;padding:7px;gap:7px}.integration .identity-fields{grid-template-columns:1fr}.integration .identity-bar{gap:8px;margin:18px 0}.integration .identity-bar>label{max-width:none;flex-basis:100%}.integration .connection-card{padding:16px}.integration .provider-heading{align-items:start;flex-wrap:wrap}.integration .identity-summary{padding:14px;gap:14px}.integration .identity-summary dl{gap:14px}.integration .identity-summary dd{font-size:17px}.integration .identity-tools[open] .identity-actions{left:0;right:auto}.integration .identity-heading p{font-size:13px}}
-`;
+@media(max-width:560px){.integration .owner-picker{max-width:none;flex-basis:100%}.integration .identity-workbench{width:100%}.integration .identity-layout{grid-template-columns:1fr;gap:18px}.integration .identity-providers{grid-template-columns:repeat(2,minmax(0,1fr));max-height:240px;overflow-y:auto;padding:0 0 12px;border:0;border-bottom:1px solid var(--sep)}.integration .identity-providers input{grid-column:1/-1;position:sticky;top:0;background:var(--surface);z-index:1}.integration .identity-providers button{font-size:12px;padding:7px;gap:7px}.integration .identity-fields{grid-template-columns:1fr}.integration .identity-bar{gap:8px;margin:18px 0}.integration .identity-bar>label{max-width:none;flex-basis:100%}.integration .connection-card{padding:16px}.integration .provider-heading{align-items:start;flex-wrap:wrap}.integration .identity-summary{padding:14px;gap:14px}.integration .identity-summary dl{gap:14px}.integration .identity-summary dd{font-size:17px}.integration .identity-tools[open] .identity-actions{left:0;right:auto}.integration .identity-heading p{font-size:13px}}
+
+.integration .owner-picker{position:relative;min-width:220px;flex:1;max-width:340px}.integration .identity-picker-label{display:block;margin-bottom:6px;font-size:12px;font-weight:650;color:var(--text-dim)}.integration .owner-picker-trigger{display:flex;align-items:center;width:100%;justify-content:space-between;text-align:left;background:var(--field);border-color:var(--sep-strong)}
+.integration .owner-picker-popup{position:absolute;z-index:3;top:calc(100% + 6px);left:0;right:0;max-height:240px;overflow:auto;padding:6px;background:var(--surface);border:1px solid var(--sep-strong);border-radius:var(--radius);box-shadow:var(--shadow-pop)}
+.integration .owner-picker-option{display:flex;width:100%;text-align:left;background:transparent;border-color:transparent}.integration .owner-picker-option:hover,.integration .owner-picker-option:focus-visible,.integration .owner-picker-option[aria-selected=true]{background:var(--hover);border-color:var(--sep-strong)}.integration .owner-picker-option[aria-selected=true]{font-weight:700}
+`;
\ No newline at end of file
diff --git a/lib/infra/connection-ui.ts b/lib/infra/connection-ui.ts
index 7fc7b1bb..3ce94abb 100644
--- a/lib/infra/connection-ui.ts
+++ b/lib/infra/connection-ui.ts
@@ -11,7 +11,18 @@ function mountConnectionManager(root,catalog,bridge,initial={}){
const n=(tag,text,cls)=>{const v=integrationNode(tag,text);if(cls)v.className=cls;return v};
const b=(text,fn,cls)=>{const v=n("button",text,cls);v.type="button";v.addEventListener("click",fn);return v};
const input=(label,value="",type="text")=>{const l=n("label",label),i=n("input");i.type=type;i.value=value;i.autocomplete="off";i.maxLength=120;l.append(i);return{label:l,input:i}};
- const textError=e=>({user_required:"Select a credential owner first.",connection_ambiguous:"Choose a named connection; more than one account exists.",connection_has_folder_binding:"Remove or change this connection's folder binding before deleting it.",connection_busy:"This connection is being used. Retry after that operation finishes.",choose_auth_config_id:"Several Composio auth configs match. Enter the intended auth config ID.",matching_auth_config_required:"Select a matching Composio auth config, or explicitly permit managed OAuth setup.",composio_project_key_required:"Configure a Composio project key under this same credential owner first.",external_source_requires_own_executor:"This connection uses an external backend; a local API key will not be substituted.",owner_required:"Sign in as an Owner before changing connections."}[e.code||e.message]||e.message||"Operation failed.");
+ const choicePicker=(label,rows,selected,onChoose)=>{
+ const wrap=n("div",undefined,"owner-picker"),caption=n("span",label,"identity-picker-label"),trigger=b("",()=>{popup.hidden?open():close()},"owner-picker-trigger"),popup=n("div",undefined,"owner-picker-popup");let value=selected||"";const options=[];
+ wrap.setAttribute("role","group");wrap.setAttribute("aria-label",label);trigger.setAttribute("aria-haspopup","listbox");trigger.setAttribute("aria-expanded","false");popup.hidden=true;popup.setAttribute("role","listbox");popup.setAttribute("aria-label",label+" options");
+ const current=()=>rows.find(row=>row.id===value),paint=()=>{const row=current();trigger.textContent=row?row.text:"Choose "+label.toLowerCase();for(const pair of options)pair[1].setAttribute("aria-selected",String(pair[0].id===value))};
+ const close=(focus=false)=>{popup.hidden=true;trigger.setAttribute("aria-expanded","false");if(focus)trigger.focus()},open=()=>{popup.hidden=false;trigger.setAttribute("aria-expanded","true");const pair=options.find(pair=>pair[0].id===value)||options[0];pair?.[1].focus()},pick=row=>{value=row.id;paint();close(true);onChoose(row)};
+ for(const row of rows){const option=b(row.text,()=>pick(row),"owner-picker-option");option.setAttribute("role","option");option.tabIndex=-1;options.push([row,option]);popup.append(option)}
+ const move=(event,delta)=>{event.preventDefault();if(popup.hidden){open();return}const active=options.findIndex(pair=>pair[1]===document.activeElement),next=(active<0?(delta>0?0:options.length-1):(active+delta+options.length)%options.length);options[next]?.[1].focus()};
+ trigger.addEventListener("keydown",event=>{if(event.key==="ArrowDown")move(event,1);else if(event.key==="ArrowUp")move(event,-1);else if(event.key==="Escape"){event.preventDefault();close()}});
+ popup.addEventListener("keydown",event=>{if(event.key==="ArrowDown")move(event,1);else if(event.key==="ArrowUp")move(event,-1);else if(event.key==="Home"){event.preventDefault();options[0]?.[1].focus()}else if(event.key==="End"){event.preventDefault();options.at(-1)?.[1].focus()}else if(event.key==="Escape"){event.preventDefault();close(true)}});
+ wrap.addEventListener("focusout",()=>setTimeout(()=>{if(!wrap.contains(document.activeElement))close()},0));wrap.append(caption,trigger,popup);paint();return{wrap,get value(){return value},set value(next){value=next;paint()}};
+ };
+ const textError=e=>({user_required:"Select a credential owner first.",connection_ambiguous:"Choose a named connection; more than one account exists.",connection_has_folder_binding:"Remove or change this connection's folder binding before deleting it.",connection_busy:"This connection is being used. Retry after that operation finishes.",choose_auth_config_id:"Several Composio auth configs match. Enter the intended auth config ID.",matching_auth_config_required:"Select a matching Composio auth config, or explicitly permit managed OAuth setup.",composio_project_key_required:"Configure a Composio project key under this same credential owner first.",external_source_requires_own_executor:"This connection uses an external backend; a local API key will not be substituted.",user_has_shared_dependents:"Unshare this owner’s shared connections before deleting the owner.",connection_has_shared_dependents:"Unshare dependent accounts before deleting this connection.",shared_alias_readonly:"Shared connections are read-only. Rotate credentials from the owner connection.",shared_alias_cannot_share:"A shared connection cannot be shared again. Share from its owner instead.",external_connections_cannot_share:"Only direct MSO credentials can be shared between credential owners.",shared_alias_use_unshare:"Use Unshare to remove a shared connection without touching its owner.",owner_required:"Sign in as an Owner before changing connections."}[e.code||e.message]||e.message||"Operation failed.");
function remember(){if(bridge.remember)bridge.remember({user,provider:provider.id})}
async function reload(){const version=++sequence;if(!bridge.query){draw();return}try{const next=await bridge.query({view:"snapshot",...(user?{user}:{})});if(disposed||version!==sequence)return;snapshot=next;user=next.user||user;draw();remember()}catch(e){if(!disposed){draw();status.textContent=textError(e)}}}
async function change(args,after=reload){if(!bridge.manage)return;try{status.textContent="Saving connection metadata…";await bridge.manage({...args,confirm:true});await after()}catch(e){status.textContent=textError(e)}}
@@ -19,8 +30,7 @@ function mountConnectionManager(root,catalog,bridge,initial={}){
function draw(){
root.replaceChildren();root.classList.add("integration","manager");
const heading=n("header",undefined,"identity-heading"),title=n("div");title.append(n(bridge.headingLevel===1?"h1":"h2","Integrations"),n("p","Connect your services. Choose the account each project uses."));heading.append(title,n("span",catalog.length+" services","identity-count"));root.append(heading);
- const toolbar=n("div",undefined,"identity-bar"),label=n("label","Credential owner"),select=n("select");select.setAttribute("aria-label","Credential owner");const placeholder=n("option","Choose a user");placeholder.value="";select.append(placeholder);
- for(const row of snapshot.users){const o=n("option",row.label+" ("+row.id+")"+(row.isDefault?" · default":""));o.value=row.id;select.append(o)}select.value=user||"";select.addEventListener("change",()=>{user=select.value||null;remember();void reload()});label.append(select);toolbar.append(label,b("Refresh",reload));const tools=n("details",undefined,"identity-tools"),toolActions=n("div",undefined,"identity-actions");tools.append(n("summary","Settings"));toolActions.append(b("Manage users",profiles),b("Folder bindings",bindings));const transfer=b("Import / export JSON",()=>bridge.openTransfer?bridge.openTransfer():bridge.openTransferBrowser?.());transfer.disabled=!bridge.openTransfer&&!bridge.openTransferBrowser;toolActions.append(transfer);tools.append(toolActions);toolbar.append(tools);root.append(toolbar);
+ const toolbar=n("div",undefined,"identity-bar"),owner=choicePicker("Credential owner",snapshot.users.map(row=>({id:row.id,text:row.label+" · "+row.id+(row.isDefault?" · default":"")})),user,row=>{user=row.id;remember();void reload()});toolbar.append(owner.wrap,b("Refresh",reload));const workbench=n("div",undefined,"identity-actions identity-workbench");const usersAction=b("Users",profiles),routingAction=b("Routing",bindings);usersAction.disabled=routingAction.disabled=!bridge.manage;workbench.append(usersAction,routingAction);const transfer=b("Transfer",()=>bridge.openTransfer?bridge.openTransfer():bridge.openTransferBrowser?.());transfer.disabled=!bridge.openTransfer&&!bridge.openTransferBrowser;workbench.append(transfer);toolbar.append(workbench);root.append(toolbar);
if(!bridge.manage)root.append(n("p","Sign in as an MSO Owner to manage credentials. Device roles and credential users are different; the public guides remain available.","identity-readonly"));
if(snapshot.connections.length){
const summary=n("section",undefined,"identity-summary"),count=snapshot.connections.filter(ready).length,ring=n("div",undefined,"identity-ring");
@@ -51,13 +61,14 @@ function mountConnectionManager(root,catalog,bridge,initial={}){
const create=b("New connection",newConnection,"primary");create.disabled=!user||!bridge.manage;if(bridge.manage)heading.append(create);
const rows=snapshot.connections.filter(c=>c.provider===provider.id);
if(!rows.length){const empty=n("div",undefined,"identity-empty");empty.append(n("h3","Connect "+provider.title),n("p",user?"Add an account to start using "+provider.title+" in your projects.":bridge.manage?"Select a credential owner to add an account.":"Read the setup guide below, then sign in to connect your account."));const start=b("Add "+provider.title+" account",newConnection,"primary");start.disabled=!user||!bridge.manage;if(bridge.manage)empty.append(start);detail.append(empty);const help=n("details");help.append(n("summary","Connection methods & setup guides"));for(const s of provider.sources)for(const m of s.methods){const info=n("section");info.append(n("h3",s.label+" · "+m.label));guide(m,info);help.append(info)}detail.append(help)}
- for(const c of rows){const card=n("article",undefined,"connection-card");const top=n("header",undefined,"connection-heading"),name=n("div");name.append(n("h3",c.label),n("small",c.id));const state=n("span",stateLabel(c),"connection-state");state.dataset.ready=String(ready(c));top.append(name,state);card.append(top);const tags=n("div",undefined,"identity-tags");for(const value of [human(c.source),human(c.authMethod),c.isDefault?"Default account":""])if(value)tags.append(n("span",value));card.append(tags);const actions=n("div",undefined,"identity-actions"),more=n("details",undefined,"identity-tools"),secondary=n("div",undefined,"identity-actions");more.append(n("summary","More"));more.append(secondary);
- const open=b(c.source==="direct"?(c.fields.some(f=>f.stored)?"Update credentials":"Finish setup"):"Authorize",()=>{if(c.source==="direct")void bridge.openSetup({user,provider:provider.id,connection:c.id}).catch(e=>status.textContent=textError(e));else external(c)});open.disabled=!bridge.manage;actions.append(open);
+ for(const c of rows){const card=n("article",undefined,"connection-card");const top=n("header",undefined,"connection-heading"),name=n("div");name.append(n("h3",c.label),n("small",c.id));const state=n("span",stateLabel(c),"connection-state");state.dataset.ready=String(ready(c));top.append(name,state);card.append(top);const tags=n("div",undefined,"identity-tags");for(const value of [human(c.source),human(c.authMethod),c.sharedFrom?"Shared from "+c.sharedFrom.user:"",c.isDefault?"Default account":""])if(value)tags.append(n("span",value));card.append(tags);const actions=n("div",undefined,"identity-actions"),more=n("details",undefined,"identity-tools"),secondary=n("div",undefined,"identity-actions");more.append(n("summary","More"));more.append(secondary);
+ const open=b(c.source==="direct"?(c.fields.some(f=>f.stored)?"Update credentials":"Finish setup"):"Authorize",()=>{if(c.source==="direct")void bridge.openSetup({user,provider:provider.id,connection:c.id}).catch(e=>status.textContent=textError(e));else external(c)});open.disabled=!bridge.manage;if(!c.sharedFrom)actions.append(open);
const verify=b("Verify",async()=>{try{status.textContent="Checking selected connection…";const result=await bridge.execute({user,provider:provider.id,connection:c.id,operation:"verify"});await reload();status.textContent=(result.ok===true?"Verified: ":"Status: ")+result.detail}catch(e){status.textContent=textError(e)}});verify.disabled=!bridge.execute;actions.append(verify);
const rename=b("Rename",()=>{detail.replaceChildren(n("h2","Rename connection"));const name=input("Label",c.label);detail.append(name.label,b("Save label",()=>change({action:"connection.rename",user,provider:provider.id,connection:c.id,label:name.input.value})),b("Cancel",drawProvider))});rename.disabled=!bridge.manage;secondary.append(rename);
- if(c.source==="direct"&&c.fields.some(f=>f.stored)){const clear=b("Clear credentials",()=>confirmation("Clear this connection's credential fields",c.id,()=>change({action:"credential.delete",user,provider:provider.id,connection:c.id})),"danger");clear.disabled=!bridge.manage;secondary.append(clear)}
+ if(c.sharedFrom){card.append(n("p","Read-only shared backing: "+c.sharedFrom.user+" / "+c.sharedFrom.connection,"identity-muted"));}else if(c.source==="direct"){const fields=n("div",undefined,"identity-credential-status");for(const f of c.fields){const line=n("div");line.append(n("span",f.label));const fieldState=n("span",f.stored?"Stored":"Missing","credential-field-state");fieldState.dataset.stored=String(f.stored);line.append(fieldState);if(f.stored){const remove=b("Remove",()=>confirmation("Remove credential field",f.key,()=>change({action:"credential.delete",user,provider:provider.id,connection:c.id,key:f.key})),"danger");remove.disabled=!bridge.manage;line.append(remove)}fields.append(line)}card.append(fields);if(c.fields.some(f=>f.stored)){const clear=b("Clear credentials",()=>confirmation("Clear this connection's credential fields",c.id,()=>change({action:"credential.delete",user,provider:provider.id,connection:c.id})),"danger");clear.disabled=!bridge.manage;secondary.append(clear)}}
if(!c.isDefault){const def=b("Make default",()=>change({action:"connection.default",user,provider:provider.id,connection:c.id}));def.disabled=!bridge.manage;secondary.append(def)}
- const del=b("Delete",()=>confirmation("Delete named connection",c.id,()=>change({action:"connection.delete",user,provider:provider.id,connection:c.id})),"danger");del.disabled=!bridge.manage;secondary.append(del);actions.append(more);card.append(actions);if(c.lastCheck)card.append(n("small","Last checked "+new Date(c.lastCheck.checkedAt).toLocaleString()+" · "+stateLabel(c)));else if(c.verifiedAt)card.append(n("small","Last verified "+new Date(c.verifiedAt).toLocaleString()));detail.append(card);
+ if(c.sharedFrom){const unshare=b("Unshare",()=>confirmation("Remove shared alias",c.id,()=>change({action:"connection.unshare",user,provider:provider.id,connection:c.id})),"danger");unshare.disabled=!bridge.manage;secondary.append(unshare)}else if(c.source==="direct"){const share=b("Share",()=>shareConnection(c));share.disabled=!bridge.manage;secondary.append(share)}
+ if(!c.sharedFrom){const del=b("Delete",()=>confirmation("Delete named connection",c.id,()=>change({action:"connection.delete",user,provider:provider.id,connection:c.id})),"danger");del.disabled=!bridge.manage;secondary.append(del);}actions.append(more);card.append(actions);if(c.lastCheck)card.append(n("small","Last checked "+new Date(c.lastCheck.checkedAt).toLocaleString()+" · "+stateLabel(c)));else if(c.verifiedAt)card.append(n("small","Last verified "+new Date(c.verifiedAt).toLocaleString()));detail.append(card);
}
}
function newConnection(){
@@ -68,6 +79,7 @@ function mountConnectionManager(root,catalog,bridge,initial={}){
function previewGuide(){preview.replaceChildren();const method=provider.sources.find(s=>s.id===source.value).methods.find(m=>m.id===auth.value);if(method.fields.length)preview.append(n("p","Fields: "+method.fields.map(f=>f.label+(f.required?" *":"")).join(", ")));else preview.append(n("p","No provider tokens are stored locally for this source."));guide(method,preview)}source.addEventListener("change",changeAuth);auth.addEventListener("change",previewGuide);changeAuth();
const fields=n("div",undefined,"identity-fields");fields.append(label.label,sourceLabel,authLabel);const advanced=n("details");advanced.append(n("summary","Connection identifier"),id.label);detail.append(fields,advanced,preview,b("Create & connect",()=>change({action:"connection.create",user,provider:provider.id,connection:id.input.value,label:label.input.value,source:source.value,authMethod:auth.value},async()=>{await reload();if(source.value==="direct")await bridge.openSetup({user,provider:provider.id,connection:id.input.value});else{const created=snapshot.connections.find(c=>c.provider===provider.id&&c.id===id.input.value);if(created)external(created)}}),"primary"),b("Cancel",drawProvider));label.input.focus();
}
+ function shareConnection(c){detail.replaceChildren(n("h2","Share "+c.label),n("p","Creates a read-only direct alias. The owner keeps control of credential rotation."));const targets=snapshot.users.filter(row=>row.id!==user).map(row=>({id:row.id,text:row.label+" · "+row.id})),target=choicePicker("Target credential owner",targets,targets[0]?.id||"",()=>sync()),label=input("New alias label",c.label),make=input("", "","checkbox");make.label.className="identity-check";make.label.append(document.createTextNode("Make this owner’s default for this service"));const submit=b("Create shared alias",()=>change({action:"connection.share",user,provider:provider.id,connection:c.id,target:target.value,label:label.input.value,makeDefault:make.input.checked}),"primary"),sync=()=>{submit.disabled=!bridge.manage||!target.value||target.value===user||!label.input.value.trim()};label.input.addEventListener("input",sync);sync();detail.append(target.wrap,label.label,make.label,submit,b("Cancel",drawProvider));}
function external(c){
detail.replaceChildren(n("h2",c.label),n("p",user+" / "+provider.id+" / "+c.source+" / "+c.authMethod));const method=provider.sources.find(s=>s.id===c.source).methods.find(m=>m.id===c.authMethod);guide(method);
if(c.source==="native-mcp"){detail.append(n("p","Authorize in the provider's own MCP client. MSO will return this route, never substitute a stored API key."),b("Back",drawProvider));return}
diff --git a/lib/infra/dokploy.ts b/lib/infra/dokploy.ts
index 1e609cb0..e41bc403 100644
--- a/lib/infra/dokploy.ts
+++ b/lib/infra/dokploy.ts
@@ -3,7 +3,6 @@ import { safeProviderFetch } from "@/lib/host/ssrf";
import { readInfraProvider } from "./store";
import { obj, request, TIMEOUT_MS } from "./http";
import { redactText } from "@/lib/security/redact-text";
-
function dokployFetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> {
const requestInput = new Request(input, { ...init, redirect: "error" });
const host = new URL(requestInput.url).hostname.replace(/^\[|\]$/g, "").toLowerCase();
diff --git a/lib/infra/identity.ts b/lib/infra/identity.ts
index 074d1a93..c10b8ed5 100644
--- a/lib/infra/identity.ts
+++ b/lib/infra/identity.ts
@@ -7,7 +7,7 @@ export type ConnectionSelector = { user?: string; connection?: string; cwd?: str
export type ExternalIdentity = { toolkit?: string; connectedAccountId?: string; authConfigId?: string; brokerConnection?: string; remoteUserId?: string; status?: string; checkedAt?: number };
export type IntegrationConnection = {
id: string; uid: string; label: string; provider: string; source: ConnectionSource; authMethod: string;
- scope: string; revision: number; values: Record<string,string>; external?: ExternalIdentity;
+ scope: string; revision: number; values: Record<string,string>; /** Read-only alias of another direct connection. */ sharedFrom?: { user: string; connection: string; provider: string }; external?: ExternalIdentity;
createdAt: number; updatedAt: number; verifiedAt?: number;
lastCheck?: { revision: number; checkedAt: number; result: "verified" | "invalid" | "unavailable" | "unconfigured" }; lease?: {id:string;until:number};
};
@@ -64,3 +64,16 @@ export function metadataOnly(value: unknown, depth = 0): void {
}
export function assertNotBusy(c:IntegrationConnection){if(c.lease&&c.lease.until>Date.now())throw new IntegrationError("connection_busy",409);}
+
+/** Resolve a direct shared backing without following unbounded or cyclic references. */
+export function resolveSharedConnection(state:IntegrationState,user:string,c:IntegrationConnection):{user:string;connection:IntegrationConnection}{
+ let owner=user,current=c; const seen=new Set<string>();
+ for(let depth=0;current.sharedFrom;depth++){
+ if(depth>=8)throw new IntegrationError("shared_reference_depth",409);
+ const ref=current.sharedFrom,key=`${owner}:${current.provider}:${current.id}`;
+ if(seen.has(key)||ref.provider!==current.provider)throw new IntegrationError("invalid_shared_reference",409); seen.add(key);
+ const next=state.users[ref.user]?.connections[ref.provider]?.[ref.connection];
+ if(!next)throw new IntegrationError("shared_backing_not_found",409);if(next.source!=="direct")throw new IntegrationError("invalid_shared_reference",409); owner=ref.user;current=next;
+ }
+ return {user:owner,connection:current};
+}
diff --git a/lib/infra/portable/ui.ts b/lib/infra/portable/ui.ts
index 756c82f6..6ad5eb5d 100644
--- a/lib/infra/portable/ui.ts
+++ b/lib/infra/portable/ui.ts
@@ -29,7 +29,7 @@ function mountPortability(root,bridge){
const decrypt=field('Import passphrase (encrypted files only)','password'),prefix=field('User ID prefix (optional, for a separate copy)'),policy=el('select'),policyLabel=el('label','Conflicts');
decrypt.i.maxLength=1024;prefix.i.placeholder='imported-';prefix.i.maxLength=32;decrypt.l.hidden=true;
for(const [value,text]of [['skip','Preserve existing connections; skip conflicts'],['error','Stop when a conflict exists']]){const o=el('option',text);o.value=value;policy.append(o)}policyLabel.append(policy);
- const previewBox=el('pre');previewBox.style.whiteSpace='pre-wrap';previewBox.style.overflowWrap='anywhere';const importStatus=el('p');importStatus.setAttribute('role','status');
+ const previewBox=el('pre');const importStatus=el('p');importStatus.setAttribute('role','status');
const reviewed=field('I reviewed the preview and accept listed skips / omitted fields','checkbox');reviewed.i.checked=false;
function reset(){preview=null;previewBox.textContent='';apply.disabled=true;reviewed.i.checked=false;}
file.i.addEventListener('change',async()=>{reset();documentData=null;decrypt.i.value='';const selected=file.i.files?.[0];if(!selected)return;try{if(selected.size>2*1024*1024)throw Error('JSON file exceeds 2 MiB.');documentData=JSON.parse(await selected.text());decrypt.l.hidden=documentData.format!=='integration-bundle.encrypted';importStatus.textContent='File loaded locally. Choose Preview import.'}catch(e){importStatus.textContent=e.message}});
@@ -47,5 +47,5 @@ function mountPortability(root,bridge){
}
`;
export const PORTABILITY_STYLE=String.raw`
-.portable-transfer{max-width:1100px!important;margin:auto}.portable-transfer .transfer-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px}.portable-transfer section{min-width:0;border:1px solid var(--sep-strong,var(--line,#ddd));border-radius:12px;padding:20px;background:var(--field,var(--panel,#fff))}.portable-transfer h3{margin-top:0}.portable-transfer label{display:block;margin:14px 0 6px;font-weight:600;font-size:13px}.portable-transfer input,.portable-transfer select{margin-top:6px;min-width:0;max-width:100%}.portable-transfer .identity-check{display:flex;gap:9px;align-items:center;font-weight:400}.portable-transfer .identity-check input{width:18px;height:18px;margin:0;order:-1;flex:none}.portable-transfer button{min-height:40px;margin:8px 7px 8px 0}.portable-transfer pre{max-height:330px;overflow:auto;font-size:12px;line-height:1.6}.portable-transfer [role=status]{font-size:13px;overflow-wrap:anywhere}@media(max-width:700px){.portable-transfer .transfer-grid{grid-template-columns:1fr}.portable-transfer section{padding:15px}}
+.portable-transfer{max-width:1100px!important;margin:auto}.portable-transfer .transfer-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px}.portable-transfer section{min-width:0;border:1px solid var(--sep-strong);border-radius:12px;padding:20px;background:var(--field)}.portable-transfer h3{margin-top:0}.portable-transfer label{display:block;margin:14px 0 6px;font-weight:600;font-size:13px}.portable-transfer input,.portable-transfer select{margin-top:6px;min-width:0;max-width:100%}.portable-transfer .identity-check{display:flex;gap:9px;align-items:center;font-weight:400}.portable-transfer .identity-check input{width:18px;height:18px;margin:0;order:-1;flex:none}.portable-transfer button{min-height:40px;margin:8px 7px 8px 0}.portable-transfer pre{max-height:330px;overflow:auto;font-size:12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.portable-transfer [role=status]{font-size:13px;overflow-wrap:anywhere}@media(max-width:700px){.portable-transfer .transfer-grid{grid-template-columns:1fr}.portable-transfer section{padding:15px}}
`;
diff --git a/lib/mcp/integration-model-contract.test.ts b/lib/mcp/integration-model-contract.test.ts
index 9cd6f02e..1a204a0f 100644
--- a/lib/mcp/integration-model-contract.test.ts
+++ b/lib/mcp/integration-model-contract.test.ts
@@ -17,6 +17,9 @@ it("uses the same native metadata services through actual MCP calls and rejects
const metadata=await call(4,"integration_query",{view:"resolve",user:"alice",provider:"convex-cloud",connection:"mimin-production"});expect((metadata.result as any)?.structuredContent?.result).toMatchObject({user:"alice",id:"mimin-production",source:"direct",authMethod:"deployment"});
const inputRejected=await call(5,"integration_manage",{action:"user.create",user:"eve",confirm:true,token:"synthetic"});expect((await readIntegrationState()).users.eve).toBeUndefined();expect(inputRejected.error??(inputRejected.result as any)?.isError).toBeTruthy();
});
+it("keeps share/unshare in the same integration management contract without accepting secret values",async()=>{
+ const {INTEGRATION_TOOLS}=await import("./tools-integrations");const tool=INTEGRATION_TOOLS.find(entry=>entry.name==="integration_manage")!;const schema=tool.inputSchema as {properties?:Record<string,{enum?:string[]}>};const actions=schema.properties?.action?.enum??[];expect(actions).toContain("connection.share");expect(actions).toContain("connection.unshare");expect(schema.properties).toHaveProperty("target");expect(schema.properties).toHaveProperty("label");expect(schema.properties).toHaveProperty("key");expect(schema.properties).not.toHaveProperty("token");expect(schema.properties).not.toHaveProperty("apiKey");
+});
it("exposes the bounded Dokploy application operations through integration_execute without adding a generic request escape hatch",async()=>{
const {INTEGRATION_TOOLS}=await import("./tools-integrations");
const tool=INTEGRATION_TOOLS.find(entry=>entry.name==="integration_execute")!;
diff --git a/lib/mcp/tools-integrations.ts b/lib/mcp/tools-integrations.ts
index badba16b..395b5e56 100644
--- a/lib/mcp/tools-integrations.ts
+++ b/lib/mcp/tools-integrations.ts
@@ -12,10 +12,10 @@ export const INTEGRATION_TOOLS:McpTool[]=[
inputSchema:S({...BASE,view:{type:"string",enum:["snapshot","catalog","users","connections","which","resolve","request"]},source:{type:"string",enum:[...SOURCES]},authMethod:{type:"string",maxLength:64}}),outputSchema:OUTPUT,
meta:{ui:{visibility:["model","app"]},"openai/widgetAccessible":true},run:async a=>({result:await queryIntegrationAction(a)}),
},
- {name:"integration_manage",title:"Manage Named Integrations",scope:"write",annotations:{readOnlyHint:false,destructiveHint:true,idempotentHint:false,openWorldHint:true},audit:{action:"infra.write",targetArg:"user"},limit:{key:"integration.manage",max:30,windowMs:60000},
+ {name:"integration_manage",title:"Manage Integrations",scope:"write",annotations:{readOnlyHint:false,destructiveHint:true,idempotentHint:false,openWorldHint:true},audit:{action:"infra.write",targetArg:"user"},limit:{key:"integration.manage",max:30,windowMs:60000},
description:"Manage native credential users, directory bindings and named provider connections. Actions require confirm=true. Direct credential values are forbidden: use integration_setup_open with user/provider/connection. Composio authorization keeps only external IDs/status and returns its transient URL privately to the UI. Native MCP authorization stays provider-owned.",
chatgptDescription:"Manage.",
- inputSchema:S({...BASE,action:{type:"string",enum:[...INTEGRATION_ACTIONS,"connection.authorize","connection.import-convex-cli"]},confirm:{type:"boolean",const:true},target:{type:"string",maxLength:64},label:{type:"string",maxLength:120},path:{type:"string",maxLength:4096},source:{type:"string",enum:[...SOURCES]},authMethod:{type:"string",maxLength:64},copyCredentials:{type:"boolean",description:"Explicit opt-in when duplicating a user; default copies metadata only."},makeDefault:{type:"boolean"},key:{type:"string",maxLength:64},authConfigId:{type:"string",maxLength:64},brokerConnection:{type:"string",maxLength:64},createManaged:{type:"boolean"}},["action","confirm"]),outputSchema:OUTPUT,
+ inputSchema:S({...BASE,action:{type:"string",enum:[...INTEGRATION_ACTIONS,"connection.authorize","connection.import-convex-cli"]},confirm:{type:"boolean",const:true},target:{type:"string",maxLength:64},label:{type:"string",maxLength:120},path:{type:"string",maxLength:4096},source:{type:"string",enum:[...SOURCES]},authMethod:{type:"string",maxLength:64},copyCredentials:{type:"boolean",description:"Duplicate with credentials."},makeDefault:{type:"boolean"},key:{type:"string",maxLength:64},authConfigId:{type:"string",maxLength:64},brokerConnection:{type:"string",maxLength:64},createManaged:{type:"boolean"}},["action","confirm"]),outputSchema:OUTPUT,
meta:{ui:{visibility:["model","app"]},"openai/widgetAccessible":true},
run:async a=>{const out=await manageIntegrationAction(a);if("privateUrl" in out){const{privateUrl,...safe}=out;return mcpDirect([{type:"text",text:"Authorization link available in the private integration UI."}],false,{result:safe},{integrationAuthorization:{url:privateUrl}});}return{result:out};},
},
diff --git a/scripts/e2e/integrations.mjs b/scripts/e2e/integrations.mjs
index aef6ff4a..c4f30936 100644
--- a/scripts/e2e/integrations.mjs
+++ b/scripts/e2e/integrations.mjs
@@ -7,50 +7,61 @@ import path from "node:path";
const require = createRequire(import.meta.url);
const { chromium } = require(path.join(process.cwd(), "os-browser/node_modules/playwright"));
const html = execFileSync("bun", ["-e", 'import { integrationSetupPage } from "./lib/infra/setup-page"; console.log(integrationSetupPage().html)'], {encoding:"utf8"});
-const users=[{id:"studio",label:"Studio",isDefault:true},{id:"personal",label:"Personal"}];
-const fixture={id:"work",label:"Delivery GitHub",provider:"github",source:"direct",authMethod:"token",scope:"account",state:"verified",isDefault:true,fields:[{key:"apiKey",stored:true}],verifiedAt:Date.now()};
-const snapshot=user=>({version:2,user,users,connections:user==="studio"?[fixture]:[],bindings:[]});
+const users=[{id:"studio",label:"Studio",isDefault:true},{id:"personal",label:"Personal",isDefault:false}];
+const fixture={id:"work",label:"Delivery GitHub",provider:"github",source:"direct",authMethod:"token",scope:"account",state:"verified",isDefault:true,fields:[{key:"apiKey",label:"API key",stored:true}],verifiedAt:Date.now(),sharedFrom:null};
+const snapshot=user=>({version:2,user,users:users.map(row=>({...row,connectionCount:row.id==="studio"?1:0})),connections:user==="studio"?[fixture]:[],bindings:[]});
+function manage(body){
+ if(body.action==="user.create")users.push({id:body.user,label:body.label||body.user,isDefault:false});
+ if(body.action==="user.rename"){const row=users.find(x=>x.id===body.user);if(row){row.id=body.target;row.label=body.label||body.target}}
+ if(body.action==="user.duplicate")users.push({id:body.target,label:body.label||body.target,isDefault:false});
+ if(body.action==="user.default")for(const row of users)row.isDefault=row.id===body.user;
+ if(body.action==="user.delete"){const index=users.findIndex(x=>x.id===body.user);if(index>=0)users.splice(index,1)}
+ return {ok:true,action:body.action};
+}
const browser=await chromium.launch({executablePath:"/usr/bin/google-chrome",args:["--no-sandbox","--disable-dev-shm-usage"]});
let checks=0;
try{
const page=await browser.newPage();
+ const waitDelivery=async stage=>{try{await page.getByRole("heading",{name:"Delivery GitHub"}).waitFor({timeout:5000})}catch(error){console.error("Delivery GitHub missing at "+stage+"\n"+(await page.locator("body").innerText()).slice(0,2500));throw error}};
const errors=[];page.on("pageerror",error=>errors.push(error.message));
await page.route("https://mso.example.com/**",route=>{
const url=new URL(route.request().url());
if(url.pathname==="/integrations")return route.fulfill({contentType:"text/html",body:html});
if(url.pathname==="/api/auth/me")return route.fulfill({json:{role:"owner"}});
- if(url.pathname==="/api/v1/integrations"&&route.request().method()==="GET")return route.fulfill({json:snapshot(url.searchParams.get("user")||"studio")});
- if(url.pathname==="/api/v1/integrations")return route.fulfill({json:{ok:true,detail:"Connected to GitHub"}});
+ if(url.pathname==="/api/v1/integrations"&&route.request().method()==="GET")return route.fulfill({json:snapshot(url.searchParams.get("user")||users.find(row=>row.isDefault)?.id||users[0]?.id||null)});
+ if(url.pathname==="/api/v1/integrations"){
+ const body=route.request().postDataJSON();return route.fulfill({json:body.mode==="manage"?manage(body):{ok:true,detail:"Connected to GitHub"}});
+ }
return route.fulfill({status:404,json:{error:"unhandled_fixture"}});
});
await page.goto("https://mso.example.com/integrations");
- await page.getByRole("heading",{name:"Delivery GitHub"}).waitFor();
+ await waitDelivery("initial");
+ assert.equal(await page.getByRole("combobox",{name:"Credential owner"}).count(),0,"credential owner must not use a native select popup");checks++;
for(const width of [320,390,768,1440,1920]){
await page.setViewportSize({width,height:900});
for(const theme of ["light","dark"]){
await page.evaluate(theme=>document.documentElement.dataset.theme=theme,theme);
assert(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth+1),"no document overflow at "+width+" "+theme);checks++;
assert(await page.getByRole("button",{name:"Update credentials",exact:true}).isVisible());checks++;
+ for(const action of ["Users","Routing","Transfer"])assert(await page.getByRole("button",{name:action,exact:true}).isVisible(),action+" must stay discoverable");checks++;
}
}
await page.setViewportSize({width:1440,height:900});
await page.getByRole("button",{name:"Verify",exact:true}).click();
await page.getByRole("status").filter({hasText:"Verified: Connected to GitHub"}).waitFor();checks++;
- await page.getByRole("combobox",{name:"Credential owner"}).selectOption("personal");
- await page.getByRole("button",{name:"Add GitHub account",exact:true}).waitFor();
- assert.equal(await page.getByRole("heading",{name:"Delivery GitHub"}).count(),0);checks++;
- await page.getByRole("button",{name:"Add GitHub account",exact:true}).click();
- assert(await page.getByRole("textbox",{name:"Connection label",exact:true}).evaluate(el=>el===document.activeElement));checks++;
- await page.getByRole("textbox",{name:"Connection label",exact:true}).fill("Personal delivery");
- await page.getByText("Connection identifier",{exact:true}).click();
- assert.equal(await page.getByRole("textbox",{name:"Connection ID",exact:true}).inputValue(),"personal-delivery");checks++;
- await page.getByRole("button",{name:"Cancel",exact:true}).click();
- await page.getByRole("searchbox",{name:"Search services"}).fill("cloudflare");
- assert.equal(await page.getByRole("navigation",{name:"Services"}).getByRole("button",{includeHidden:true}).count(),14);
- assert.equal(await page.getByRole("navigation",{name:"Services"}).getByRole("button").filter({visible:true}).count(),1);checks++;
+ assert(await page.getByRole("button",{name:"Remove",exact:true}).isVisible(),"stored credential fields expose per-field removal");checks++;
+ await page.getByText("More",{exact:true}).click();await page.getByRole("button",{name:"Share",exact:true}).click();await page.getByRole("heading",{name:"Share Delivery GitHub"}).waitFor();assert(await page.getByRole("group",{name:"Target credential owner"}).getByRole("button").isVisible());assert(await page.getByRole("textbox",{name:"New alias label",exact:true}).isVisible());checks++;await page.getByRole("button",{name:"Cancel",exact:true}).click();
+ const owner=page.getByRole("group",{name:"Credential owner"}).getByRole("button");await owner.focus();await owner.press("ArrowDown");await page.getByRole("option",{name:/Studio/}).waitFor();await page.getByRole("option",{name:/Studio/}).press("ArrowDown");await page.getByRole("option",{name:/Personal/}).press("Enter");
+ await page.getByRole("button",{name:"Add GitHub account",exact:true}).waitFor();assert.equal(await page.getByRole("heading",{name:"Delivery GitHub"}).count(),0);checks++;
+ await owner.click();await page.getByRole("option",{name:/Studio/}).click();await waitDelivery("after owner switch back to Studio");checks++;
+ await page.getByRole("button",{name:"Users",exact:true}).click();await page.getByRole("textbox",{name:"New user ID",exact:true}).fill("client-a");await page.getByRole("textbox",{name:"Display label",exact:true}).fill("Client A");await page.getByRole("button",{name:"Create user",exact:true}).click();await page.getByRole("group",{name:"Credential owner"}).getByRole("button").filter({hasText:/Client A/}).waitFor();checks++;
+ await page.getByRole("button",{name:"Users",exact:true}).click();await page.getByRole("textbox",{name:"Target user ID",exact:true}).fill("client-main");await page.getByRole("textbox",{name:"New display label",exact:true}).fill("Client Main");await page.getByRole("button",{name:"Rename user",exact:true}).click();await page.getByRole("group",{name:"Credential owner"}).getByRole("button").filter({hasText:/Client Main/}).waitFor();checks++;
+ await page.getByRole("button",{name:"Users",exact:true}).click();await page.getByRole("textbox",{name:"Target user ID",exact:true}).fill("client-copy");await page.getByRole("textbox",{name:"New display label",exact:true}).fill("Client Copy");await page.getByRole("button",{name:"Duplicate user",exact:true}).click();await page.getByRole("group",{name:"Credential owner"}).getByRole("button").filter({hasText:/Client Copy/}).waitFor();checks++;
+ await page.getByRole("button",{name:"Users",exact:true}).click();await page.getByRole("button",{name:"Delete user",exact:true}).click();await page.getByRole("textbox",{name:"Confirmation",exact:true}).fill("client-copy");await page.getByRole("button",{name:"Confirm",exact:true}).click();await page.getByRole("group",{name:"Credential owner"}).getByRole("button").waitFor();assert.equal(users.some(row=>row.id==="client-copy"),false);checks++;
+ await owner.click();await page.getByRole("option",{name:/Studio/}).click();await waitDelivery("after user CRUD returns to Studio");
+ await page.getByRole("button",{name:"Add GitHub account",exact:true}).count();
+ await page.getByRole("searchbox",{name:"Search services"}).fill("cloudflare");assert.equal(await page.getByRole("navigation",{name:"Services"}).getByRole("button",{includeHidden:true}).count(),14);assert.equal(await page.getByRole("navigation",{name:"Services"}).getByRole("button").filter({visible:true}).count(),1);checks++;
await page.getByRole("searchbox",{name:"Search services"}).fill("");
- await page.getByRole("combobox",{name:"Credential owner"}).selectOption("studio");
- await page.getByRole("heading",{name:"Delivery GitHub"}).waitFor();
assert.deepEqual(errors,[]);checks++;
- console.log("Integrations browser: "+checks+" checks passed (320–1920 px, light/dark, owner isolation, search, setup, verification).");
+ console.log("Integrations browser: "+checks+" checks passed (320–1920 px, light/dark, semantic owner picker, user CRUD, search, setup, verification).");
}finally{await browser.close()}
diff --git a/scripts/e2e/release.mjs b/scripts/e2e/release.mjs
index 66e5b6d8..22a5a17f 100644
--- a/scripts/e2e/release.mjs
+++ b/scripts/e2e/release.mjs
@@ -68,7 +68,7 @@ try {
await page.locator('input[type="password"]').fill(fixture.password);
await page.getByRole("button", { name: "Unlock", exact: true }).click();
await expect(page).toHaveURL(fixture.base + "/integrations");
- await expect(page.getByLabel("Credential owner")).toHaveValue("fixture");
+ await expect(page.getByRole("group", { name: "Credential owner" }).getByRole("button")).toContainText("fixture");
await page.getByRole("button", { name: /^Self-hosted Convex(?: 1)?$/ }).click();
await page.getByRole("button", { name: "Verify", exact: true }).click();
await expect(page.locator(".connection-state")).toHaveText("Verified");