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): clarify DOKU credential fields

Rahman673d5cf612b6
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 78445bbc..7781912e 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -4,6 +4,12 @@
Newest first. `docs/PROGRESS.md` is the source of truth for *why* a change was made;
this is the *what*, and it is what Settings → About shows as “What's new”.
+## 2026-09-26
+
+**Added**
+
+- `integrations` clarify DOKU credential fields
+
## 2026-09-25
**Added**
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index d705e513..cfb29c30 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,3 +1,28 @@
+## 2026-09-26 — Make DOKU credential fields self-explanatory
+
+The native DOKU setup form now puts the official source beside each credential
+label instead of forcing the operator to interpret one generic help panel. Payment
+Client ID and Payment Secret Key link directly to the Sandbox and Production API
+Key surfaces; Payment Environment links to the environment guide and Sandbox
+registration. Safe, clearly synthetic placeholders show the expected shape without
+resembling a stored credential.
+
+Payment Environment is now explicit product language rather than an implied DOKU
+secret: it is the operator choice `sandbox` when the Client ID + Secret Key come
+from DOKU Sandbox/testing, or `production` when they come from the live DOKU
+Dashboard. The REST Secret Key remains distinct from the DOKU MCP API Key.
+
+The form renderer gains reusable per-field HTTPS reference links, so the same
+pattern can be applied to other integrations without duplicating provider-specific
+markup. Secret storage, masking, verification, and blank-to-keep behavior are
+unchanged.
+
+Verification: DOKU/setup regressions pass 23/23; TypeScript and zero-warning
+focused ESLint pass; the isolated Next.js production build, bundle budget,
+mandatory release E2E, native Integrations responsive shell journey, native Google
+Integrations regression, shell status checks, and deferred shell-performance gates
+all pass.
+
## 2026-09-25 — Native Google Integrations foundation
Native Google OAuth app configuration, Search Console and Google Analytics 4 now
diff --git a/lib/infra/additional-doctor.test.ts b/lib/infra/additional-doctor.test.ts
index e99f647b..a1538beb 100644
--- a/lib/infra/additional-doctor.test.ts
+++ b/lib/infra/additional-doctor.test.ts
@@ -17,7 +17,14 @@ describe("additional native credential providers", () => {
expect(setupFields("convex-cloud", "personal").map(f => f.key)).toEqual(["personalToken"]);
expect(setupFields("convex-cloud", "deployment").map(f => f.key)).toEqual(["deployKey", "deploymentName"]);
expect(() => setupFields("convex-cloud", "organization")).toThrow();
- expect(setupFields("doku","payment").map(f=>f.key)).toEqual(["paymentClientId","paymentSecretKey","paymentEnvironment"]);
+ const dokuPayment = setupFields("doku","payment");
+ expect(dokuPayment.map(f=>f.key)).toEqual(["paymentClientId","paymentSecretKey","paymentEnvironment"]);
+ expect(dokuPayment.map(f=>f.placeholder)).toEqual(["MCH-0001-xxxxxxxxxxxxxxx","SK-EXAMPLE-DO-NOT-USE","sandbox"]);
+ for (const field of dokuPayment) {
+ expect(field.links?.length).toBeGreaterThan(0);
+ for (const item of field.links ?? []) expect(item.url).toMatch(/^https:\/\//);
+ }
+ expect(dokuPayment.find(f=>f.key==="paymentEnvironment")?.description).toContain("You do not copy this");
expect(setupFields("doku", "mcp").map(f => f.key)).toEqual(["mcpClientId", "mcpApiKey", "environment"]);
expect(() => setupFields("doku", "direct")).toThrow();
});
diff --git a/lib/infra/additional-providers.ts b/lib/infra/additional-providers.ts
index 9191a476..436438e3 100644
--- a/lib/infra/additional-providers.ts
+++ b/lib/infra/additional-providers.ts
@@ -3,7 +3,9 @@ type AdditionalField = {
label: string;
secret: boolean;
required: boolean;
+ placeholder?: string;
description: string;
+ links?: readonly { label: string; url: string }[];
};
type AdditionalProvider = {
@@ -113,12 +115,51 @@ export const ADDITIONAL_PROVIDERS = {
],
},
doku: { id:"doku", title:"DOKU", description:"Verify DOKU Payment REST or DOKU MCP merchant credentials without copying secrets into project configuration.", feature:false, fields:[
- {key:"paymentClientId",label:"Payment Client ID",secret:true,required:false,description:"DOKU Back Office Client ID used by the signed Non-SNAP payment API."},
- {key:"paymentSecretKey",label:"Payment Secret Key",secret:true,required:false,description:"DOKU Back Office HMAC Secret Key for signed payment API requests. This is not the MCP API Key."},
- {key:"paymentEnvironment",label:"Payment Environment",secret:false,required:false,description:"Exactly sandbox or production for the signed payment API."},
- {key:"mcpClientId",label:"MCP Client ID",secret:true,required:false,description:"DOKU-issued Client ID for MCP access in the selected environment."},
- {key:"mcpApiKey",label:"MCP API Key",secret:true,required:false,description:"DOKU-issued MCP API Key. It is distinct from the REST payment HMAC Secret Key."},
- {key:"environment",label:"MCP Environment",secret:false,required:false,description:"Exactly sandbox or production. MSO derives the official DOKU MCP endpoint from this value."},
+ {
+ key:"paymentClientId",label:"Payment Client ID",secret:true,required:false,
+ placeholder:"MCH-0001-xxxxxxxxxxxxxxx",
+ description:"Client ID from DOKU Back Office for the same environment selected below. DOKU documents MCH-… as a common Non-SNAP merchant Client-Id shape.",
+ links:[
+ {label:"Sandbox API Keys",url:"https://sandbox.doku.com/bo/developer/api-keys"},
+ {label:"Production API Keys",url:"https://dashboard.doku.com/bo/developer/api-keys"},
+ ],
+ },
+ {
+ key:"paymentSecretKey",label:"Payment Secret Key",secret:true,required:false,
+ placeholder:"SK-EXAMPLE-DO-NOT-USE",
+ description:"Secret Key from the same DOKU Back Office/environment as the Client ID. Used only for HMAC signing; this is not the MCP API Key.",
+ links:[
+ {label:"Sandbox API Keys",url:"https://sandbox.doku.com/bo/developer/api-keys"},
+ {label:"Production API Keys",url:"https://dashboard.doku.com/bo/developer/api-keys"},
+ ],
+ },
+ {
+ key:"paymentEnvironment",label:"Payment Environment",secret:false,required:false,
+ placeholder:"sandbox",
+ description:"You do not copy this from a credential field. Enter sandbox when using Sandbox Client ID + Secret Key (testing), or production when using Production credentials (real payments).",
+ links:[
+ {label:"Environment guide",url:"https://developers.doku.com/accept-payments/doku-checkout/integration-guide/backend-integration"},
+ {label:"Sandbox signup",url:"https://sandbox.doku.com/bo/sandbox-registration"},
+ ],
+ },
+ {
+ key:"mcpClientId",label:"MCP Client ID",secret:true,required:false,
+ placeholder:"BRN-EXAMPLE-000000000000",
+ description:"DOKU-issued Client ID for MCP access in the selected environment.",
+ links:[{label:"DOKU MCP guide",url:"https://developers.doku.com/accept-payments/doku-mcp-server"}],
+ },
+ {
+ key:"mcpApiKey",label:"MCP API Key",secret:true,required:false,
+ placeholder:"DOKU-MCP-API-KEY-EXAMPLE",
+ description:"DOKU-issued MCP API Key. It is distinct from the REST payment HMAC Secret Key.",
+ links:[{label:"DOKU MCP guide",url:"https://developers.doku.com/accept-payments/doku-mcp-server"}],
+ },
+ {
+ key:"environment",label:"MCP Environment",secret:false,required:false,
+ placeholder:"sandbox",
+ description:"Enter sandbox for the DOKU sandbox MCP endpoint or production for live access. MSO derives the official endpoint from this value.",
+ links:[{label:"DOKU MCP guide",url:"https://developers.doku.com/accept-payments/doku-mcp-server"}],
+ },
] },
"openai-app": {
id: "openai-app",
diff --git a/lib/infra/setup-hub.test.ts b/lib/infra/setup-hub.test.ts
index c62d15e6..84b8911f 100644
--- a/lib/infra/setup-hub.test.ts
+++ b/lib/infra/setup-hub.test.ts
@@ -12,6 +12,6 @@ it("derives the complete native setup catalog from the same provider registry",
it("keeps guidance before login and preserves explicit role/expiry recovery", () => {
const page = integrationSetupPage();
expect(() => new Function(inlineScripts(page.html)[0])).not.toThrow();
- for (const marker of ['"/api/auth/me"', 'owner=auth.role==="owner"', '"visibilitychange"', 'How to get this credential', 'mountConnectionManager']) expect(page.html).toContain(marker);
+ for (const marker of ['"/api/auth/me"', 'owner=auth.role==="owner"', '"visibilitychange"', 'How to get this credential', 'mountConnectionManager', 'field-source', 'Array.isArray(f.links)']) expect(page.html).toContain(marker);
expect(CONNECTION_MANAGER_SCRIPT).not.toContain('localStorage'); expect(page.csp).toContain("form-action 'none'");
});
diff --git a/lib/infra/setup-ui.ts b/lib/infra/setup-ui.ts
index a3cd949d..f34195a3 100644
--- a/lib/infra/setup-ui.ts
+++ b/lib/infra/setup-ui.ts
@@ -5,7 +5,7 @@ export const INTEGRATION_FORM_STYLE = String.raw`
[hidden]{display:none!important}
.integration{max-width:var(--settings-content-width);margin:auto;font:var(--type-small)/var(--line-body) var(--font-body);color:var(--foreground)}
.integration h2{font:var(--weight-bold) var(--type-title)/var(--line-title) var(--font-display);margin:0 0 var(--space-2)}.integration p{color:var(--muted-foreground);margin:var(--space-2) 0 var(--space-3)}
-.integration .setup-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--space-5)}.integration label{display:block;font-weight:var(--weight-strong);margin-bottom:var(--space-1)}
+.integration .setup-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--space-5)}.integration label{display:flex;align-items:baseline;gap:var(--space-2);flex-wrap:wrap;font-weight:var(--weight-strong);margin-bottom:var(--space-1)}.integration label .field-source{font-size:var(--type-caption);font-weight:var(--weight-medium)}
.integration input,.integration select{width:100%;min-width:0;min-height:var(--control-size);border:var(--stroke) solid var(--input);border-radius:var(--radius-control);background:var(--secondary);color:var(--foreground);padding:var(--space-2) var(--space-3);font:var(--type-body)/var(--line-body) var(--font-body)}
.integration .input-row{display:flex;gap:var(--space-2)}.integration .input-row input{flex:1;width:0}.integration button{font-size:var(--type-small);min-height:var(--control-size);white-space:normal}.integration .field{margin-bottom:var(--space-4);min-width:0}.integration small{display:block;margin-top:var(--space-1);color:var(--muted-foreground);overflow-wrap:anywhere}
.integration details{border:var(--stroke) solid var(--border);border-radius:var(--radius-panel);padding:var(--space-3);background:var(--settings-card);margin:var(--space-3) 0}.integration summary{cursor:pointer;font-weight:var(--weight-strong)}.integration li{margin:var(--space-2) 0}.integration a{color:var(--settings-action-text);text-underline-offset:var(--space-1);overflow-wrap:anywhere}.integration .setup-status{min-height:var(--control-size);overflow-wrap:anywhere}.integration button:disabled{cursor:not-allowed;opacity:var(--settings-disabled-opacity)}
@@ -23,18 +23,21 @@ function mountIntegrationForm(root,setup,access){
const heading=integrationNode("h2",setup.title+" · "+(setup.label||setup.connection||"connection")),tag=integrationNode("span",setup.method+" · single-use session");tag.className="setup-tag";
root.append(tag,heading,integrationNode("p",[setup.user,setup.connection,setup.source,setup.scope].filter(Boolean).join(" → ")),integrationNode("p","Credentials go directly to your MSO server. They are not sent to ChatGPT or saved in browser storage."));
const grid=integrationNode("div"),form=integrationNode("form"),aside=integrationNode("aside");grid.className="setup-grid";form.autocomplete="off";form.setAttribute("action","#");
+ let status=null;
+ function link(url,label){const a=integrationNode("a",label);try{const u=new URL(url);if(u.protocol!=="https:")return integrationNode("span",label);a.href=u.href}catch{return integrationNode("span",label)}a.target="_blank";a.rel="noopener noreferrer";if(typeof access.openLink==="function")a.addEventListener("click",e=>{e.preventDefault();Promise.resolve(access.openLink(a.href)).catch(()=>{if(status)status.textContent="The host could not open this reference. Open the provider dashboard in your browser."})});return a}
const inputs=[];
for(const f of setup.fields){
- const wrap=integrationNode("div"),label=integrationNode("label",f.label+(f.required&&!f.stored?" *":"")),row=integrationNode("div"),input=integrationNode("input");
+ const wrap=integrationNode("div"),label=integrationNode("label"),row=integrationNode("div"),input=integrationNode("input");
+ label.append(document.createTextNode(f.label+(f.required&&!f.stored?" *":"")));
+ for(const item of Array.isArray(f.links)?f.links:[]){const source=link(item.url,item.label||"Official source");source.className="field-source";label.append(source)}
wrap.className="field";row.className="input-row";input.id="setup-"+f.key;label.htmlFor=input.id;input.type=f.secret?"password":"text";input.autocomplete="off";input.spellcheck=false;input.maxLength=4096;input.required=f.required&&!f.stored;input.placeholder=f.stored?"Already stored — leave blank to keep":(f.placeholder||"");
row.append(input);inputs.push({key:f.key,input});
if(f.secret){const toggle=integrationNode("button","Show");toggle.type="button";toggle.setAttribute("aria-label","Show or hide "+f.label);toggle.addEventListener("click",()=>{input.type=input.type==="password"?"text":"password";toggle.textContent=input.type==="password"?"Show":"Hide"});row.append(toggle)}
wrap.append(label,row,integrationNode("small",f.description));form.append(wrap);
}
const configurationOnly=setup.provider==="google-oauth-app";
- const save=integrationNode("button",configurationOnly?"Save OAuth app configuration":"Validate & save"),status=integrationNode("p");save.type="button";save.className="primary";status.className="setup-status";status.setAttribute("role","status");status.setAttribute("aria-live","polite");form.append(save,status);
+ const save=integrationNode("button",configurationOnly?"Save OAuth app configuration":"Validate & save");status=integrationNode("p");save.type="button";save.className="primary";status.className="setup-status";status.setAttribute("role","status");status.setAttribute("aria-live","polite");form.append(save,status);
const guide=integrationNode("details"),summary=integrationNode("summary","How to get this credential"),steps=integrationNode("ol");guide.open=true;guide.append(summary);
- function link(url,label){const a=integrationNode("a",label);try{const u=new URL(url);if(u.protocol!=="https:")return integrationNode("span",label);a.href=u.href}catch{return integrationNode("span",label)}a.target="_blank";a.rel="noopener noreferrer";if(typeof access.openLink==="function")a.addEventListener("click",e=>{e.preventDefault();Promise.resolve(access.openLink(a.href)).catch(()=>{status.textContent="The host could not open this reference. Open the provider dashboard in your browser."})});return a}
if(configurationOnly&&setup.redirectUri)guide.append(integrationNode("p","Register this exact authorized redirect URI in Google Cloud:"),integrationNode("small",setup.redirectUri));
guide.append(link(setup.guidance.url,"Open official provider dashboard"));for(const text of setup.guidance.steps)steps.append(integrationNode("li",text));guide.append(steps,link(setup.guidance.reference,"Official documentation"));
const storage=integrationNode("details");storage.append(integrationNode("summary","Storage and privacy"),integrationNode("p",setup.store),integrationNode("p","The form expires after 10 minutes and closes after a successful save. Existing keys are never displayed. Blank fields keep existing values. If a key was shared publicly, revoke it at its provider."));
diff --git a/lib/infra/types.ts b/lib/infra/types.ts
index cef0e065..1b466fe1 100644
--- a/lib/infra/types.ts
+++ b/lib/infra/types.ts
@@ -4,7 +4,13 @@ export type InfraProviderId = (typeof INFRA_PROVIDER_IDS)[number];
export type InfraProviderValues = Record<string, string>;
export type LegacyInfraStore = { providers?: Partial<Record<InfraProviderId, InfraProviderValues>> };
export type InfraField = {
- key: string; label: string; secret: boolean; required: boolean; placeholder?: string; description: string;
+ key: string;
+ label: string;
+ secret: boolean;
+ required: boolean;
+ placeholder?: string;
+ description: string;
+ links?: readonly { label: string; url: string }[];
};
export type InfraProviderDefinition = {
id: InfraProviderId; title: string; description: string; feature: boolean; fields: InfraField[];