@open-mercato/core 0.6.8-develop.7037.1.ea0277b01e → 0.6.8-develop.7038.1.ea954afd80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/dist/modules/integrations/api/[id]/credentials/route.js +6 -1
- package/dist/modules/integrations/api/[id]/credentials/route.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/[id]/page.js +38 -29
- package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +36 -9
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/credential-secret-fields.js +55 -0
- package/dist/modules/integrations/backend/integrations/credential-secret-fields.js.map +7 -0
- package/dist/modules/integrations/data/validators.js +11 -3
- package/dist/modules/integrations/data/validators.js.map +2 -2
- package/dist/modules/integrations/lib/credentials-masking.js +6 -2
- package/dist/modules/integrations/lib/credentials-masking.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/integrations/api/[id]/credentials/route.ts +6 -4
- package/src/modules/integrations/backend/integrations/[id]/page.tsx +61 -31
- package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +44 -9
- package/src/modules/integrations/backend/integrations/credential-secret-fields.ts +84 -0
- package/src/modules/integrations/data/validators.ts +12 -2
- package/src/modules/integrations/i18n/de.json +1 -0
- package/src/modules/integrations/i18n/en.json +1 -0
- package/src/modules/integrations/i18n/es.json +1 -0
- package/src/modules/integrations/i18n/ko.json +1 -0
- package/src/modules/integrations/i18n/pl.json +1 -0
- package/src/modules/integrations/lib/credentials-masking.ts +10 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -162,7 +162,12 @@ async function PUT(req, ctx) {
|
|
|
162
162
|
}
|
|
163
163
|
try {
|
|
164
164
|
const existing = await credentialsService.resolve(integration.id, scope);
|
|
165
|
-
const credentialsToSave = mergeMaskedSecretCredentials(
|
|
165
|
+
const credentialsToSave = mergeMaskedSecretCredentials(
|
|
166
|
+
schema,
|
|
167
|
+
payloadData.credentials,
|
|
168
|
+
existing ?? {},
|
|
169
|
+
payloadData.unchangedSecretFields
|
|
170
|
+
);
|
|
166
171
|
await credentialsService.save(integration.id, credentialsToSave, scope);
|
|
167
172
|
} catch (error) {
|
|
168
173
|
if (isCredentialsEncryptionUnavailableError(error)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/integrations/api/%5Bid%5D/credentials/route.ts"],
|
|
4
|
-
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { getIntegration } from '@open-mercato/shared/modules/integrations/types'\nimport { enforceCommandOptimisticLock } from '@open-mercato/shared/lib/crud/optimistic-lock-command'\nimport { isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport { emitIntegrationsEvent } from '../../../events'\nimport { saveCredentialsSchema } from '../../../data/validators'\nimport {\n isCredentialsEncryptionUnavailableError,\n type CredentialsService,\n} from '../../../lib/credentials-service'\nimport { collectCredentialUrlValidationErrors } from '../../../lib/credentials-field-validation'\nimport {\n maskSecretCredentials,\n mergeMaskedSecretCredentials,\n} from '../../../lib/credentials-masking'\nimport {\n resolveUserFeatures,\n runIntegrationMutationGuardAfterSuccess,\n runIntegrationMutationGuards,\n} from '../../guards'\nimport { organizationScopeRequiredResponse, resolveActiveOrganizationId } from '@open-mercato/shared/lib/auth/organizationScope'\n\nconst idParamsSchema = z.object({ id: z.string().min(1) })\n\nexport const metadata = {\n GET: { requireAuth: true, requireFeatures: ['integrations.credentials.manage'] },\n PUT: { requireAuth: true, requireFeatures: ['integrations.credentials.manage'] },\n}\n\nexport const openApi = {\n tags: ['Integrations'],\n summary: 'Get or save integration credentials',\n}\n\nfunction resolveParams(ctx: { params?: Promise<{ id?: string }> | { id?: string } }): Promise<{ id?: string } | undefined> | { id?: string } | undefined {\n if (!ctx.params) return undefined\n if (typeof (ctx.params as Promise<unknown>).then === 'function') {\n return ctx.params as Promise<{ id?: string }>\n }\n return ctx.params as { id?: string }\n}\n\nexport async function GET(req: Request, ctx: { params?: Promise<{ id?: string }> | { id?: string } }) {\n const auth = await getAuthFromRequest(req)\n if (!auth?.tenantId) {\n return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n }\n const organizationId = resolveActiveOrganizationId(auth)\n if (!organizationId) {\n return organizationScopeRequiredResponse()\n }\n\n const rawParams = await resolveParams(ctx)\n const parsedParams = idParamsSchema.safeParse(rawParams)\n if (!parsedParams.success) {\n return NextResponse.json({ error: 'Invalid integration id' }, { status: 400 })\n }\n\n const integration = getIntegration(parsedParams.data.id)\n if (!integration) {\n return NextResponse.json({ error: 'Integration not found' }, { status: 404 })\n }\n\n const container = await createRequestContainer()\n const credentialsService = container.resolve('integrationCredentialsService') as CredentialsService\n const scope = { organizationId: organizationId, tenantId: auth.tenantId }\n\n let values: Record<string, unknown> | null\n let updatedAt: Date | null\n try {\n values = await credentialsService.resolve(integration.id, scope)\n updatedAt = await credentialsService.resolveUpdatedAt(integration.id, scope)\n } catch (error) {\n if (isCredentialsEncryptionUnavailableError(error)) {\n return NextResponse.json({ error: 'Integration credentials encryption is unavailable' }, { status: 503 })\n }\n throw error\n }\n\n const schema = credentialsService.getSchema(integration.id)\n const { credentials, secretFieldsConfigured } = maskSecretCredentials(schema, values ?? {})\n\n return NextResponse.json({\n integrationId: integration.id,\n schema,\n credentials,\n secretFieldsConfigured,\n updatedAt: updatedAt?.toISOString() ?? null,\n })\n}\n\nexport async function PUT(req: Request, ctx: { params?: Promise<{ id?: string }> | { id?: string } }) {\n const auth = await getAuthFromRequest(req)\n if (!auth?.tenantId) {\n return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n }\n const organizationId = resolveActiveOrganizationId(auth)\n if (!organizationId) {\n return organizationScopeRequiredResponse()\n }\n\n const rawParams = await resolveParams(ctx)\n const parsedParams = idParamsSchema.safeParse(rawParams)\n if (!parsedParams.success) {\n return NextResponse.json({ error: 'Invalid integration id' }, { status: 400 })\n }\n\n const integration = getIntegration(parsedParams.data.id)\n if (!integration) {\n return NextResponse.json({ error: 'Integration not found' }, { status: 404 })\n }\n\n const payload = await req.json().catch(() => null)\n const parsedBody = saveCredentialsSchema.safeParse(payload)\n if (!parsedBody.success) {\n return NextResponse.json({ error: 'Invalid credentials payload', details: parsedBody.error.flatten() }, { status: 422 })\n }\n\n const container = await createRequestContainer()\n const guardResult = await runIntegrationMutationGuards(\n container,\n {\n tenantId: auth.tenantId,\n organizationId,\n userId: auth.sub ?? '',\n resourceKind: 'integrations.integration',\n resourceId: integration.id,\n operation: 'update',\n requestMethod: req.method,\n requestHeaders: req.headers,\n mutationPayload: parsedBody.data as Record<string, unknown>,\n },\n resolveUserFeatures(auth),\n )\n if (!guardResult.ok) {\n return NextResponse.json(guardResult.errorBody ?? { error: 'Operation blocked by guard' }, { status: guardResult.errorStatus ?? 422 })\n }\n\n let payloadData = parsedBody.data\n if (guardResult.modifiedPayload) {\n const mergedPayload = { ...parsedBody.data, ...guardResult.modifiedPayload }\n const reparsed = saveCredentialsSchema.safeParse(mergedPayload)\n if (!reparsed.success) {\n return NextResponse.json({ error: 'Invalid credentials payload after guard transform', details: reparsed.error.flatten() }, { status: 422 })\n }\n payloadData = reparsed.data\n }\n\n const credentialsService = container.resolve('integrationCredentialsService') as CredentialsService\n const scope = { organizationId: organizationId, tenantId: auth.tenantId }\n const schema = credentialsService.getSchema(integration.id)\n\n try {\n const currentUpdatedAt = await credentialsService.resolveUpdatedAt(integration.id, scope)\n enforceCommandOptimisticLock({\n resourceKind: 'integrations.integration',\n resourceId: integration.id,\n current: currentUpdatedAt,\n request: req,\n })\n } catch (error) {\n if (isCrudHttpError(error)) {\n return NextResponse.json(error.body, { status: error.status })\n }\n if (isCredentialsEncryptionUnavailableError(error)) {\n return NextResponse.json({ error: 'Integration credentials encryption is unavailable' }, { status: 503 })\n }\n throw error\n }\n\n const credentialFieldErrors = collectCredentialUrlValidationErrors(\n schema,\n payloadData.credentials,\n )\n if (Object.keys(credentialFieldErrors).length > 0) {\n return NextResponse.json(\n { error: 'Invalid credentials payload', details: { fieldErrors: credentialFieldErrors } },\n { status: 422 },\n )\n }\n\n try {\n
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAClB,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAC/B,SAAS,oCAAoC;AAC7C,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,OAEK;AACP,SAAS,4CAA4C;AACrD;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mCAAmC,mCAAmC;AAE/E,MAAM,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;AAElD,MAAM,WAAW;AAAA,EACtB,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,iCAAiC,EAAE;AAAA,EAC/E,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,iCAAiC,EAAE;AACjF;AAEO,MAAM,UAAU;AAAA,EACrB,MAAM,CAAC,cAAc;AAAA,EACrB,SAAS;AACX;AAEA,SAAS,cAAc,KAAkI;AACvJ,MAAI,CAAC,IAAI,OAAQ,QAAO;AACxB,MAAI,OAAQ,IAAI,OAA4B,SAAS,YAAY;AAC/D,WAAO,IAAI;AAAA,EACb;AACA,SAAO,IAAI;AACb;AAEA,eAAsB,IAAI,KAAc,KAA8D;AACpG,QAAM,OAAO,MAAM,mBAAmB,GAAG;AACzC,MAAI,CAAC,MAAM,UAAU;AACnB,WAAO,aAAa,KA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AAE,QAAQ,IAAI;AAAA,IAChB;AAAA,EACF;AAEA,MAAI;
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { getIntegration } from '@open-mercato/shared/modules/integrations/types'\nimport { enforceCommandOptimisticLock } from '@open-mercato/shared/lib/crud/optimistic-lock-command'\nimport { isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport { emitIntegrationsEvent } from '../../../events'\nimport { saveCredentialsSchema } from '../../../data/validators'\nimport {\n isCredentialsEncryptionUnavailableError,\n type CredentialsService,\n} from '../../../lib/credentials-service'\nimport { collectCredentialUrlValidationErrors } from '../../../lib/credentials-field-validation'\nimport {\n maskSecretCredentials,\n mergeMaskedSecretCredentials,\n} from '../../../lib/credentials-masking'\nimport {\n resolveUserFeatures,\n runIntegrationMutationGuardAfterSuccess,\n runIntegrationMutationGuards,\n} from '../../guards'\nimport { organizationScopeRequiredResponse, resolveActiveOrganizationId } from '@open-mercato/shared/lib/auth/organizationScope'\n\nconst idParamsSchema = z.object({ id: z.string().min(1) })\n\nexport const metadata = {\n GET: { requireAuth: true, requireFeatures: ['integrations.credentials.manage'] },\n PUT: { requireAuth: true, requireFeatures: ['integrations.credentials.manage'] },\n}\n\nexport const openApi = {\n tags: ['Integrations'],\n summary: 'Get or save integration credentials',\n}\n\nfunction resolveParams(ctx: { params?: Promise<{ id?: string }> | { id?: string } }): Promise<{ id?: string } | undefined> | { id?: string } | undefined {\n if (!ctx.params) return undefined\n if (typeof (ctx.params as Promise<unknown>).then === 'function') {\n return ctx.params as Promise<{ id?: string }>\n }\n return ctx.params as { id?: string }\n}\n\nexport async function GET(req: Request, ctx: { params?: Promise<{ id?: string }> | { id?: string } }) {\n const auth = await getAuthFromRequest(req)\n if (!auth?.tenantId) {\n return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n }\n const organizationId = resolveActiveOrganizationId(auth)\n if (!organizationId) {\n return organizationScopeRequiredResponse()\n }\n\n const rawParams = await resolveParams(ctx)\n const parsedParams = idParamsSchema.safeParse(rawParams)\n if (!parsedParams.success) {\n return NextResponse.json({ error: 'Invalid integration id' }, { status: 400 })\n }\n\n const integration = getIntegration(parsedParams.data.id)\n if (!integration) {\n return NextResponse.json({ error: 'Integration not found' }, { status: 404 })\n }\n\n const container = await createRequestContainer()\n const credentialsService = container.resolve('integrationCredentialsService') as CredentialsService\n const scope = { organizationId: organizationId, tenantId: auth.tenantId }\n\n let values: Record<string, unknown> | null\n let updatedAt: Date | null\n try {\n values = await credentialsService.resolve(integration.id, scope)\n updatedAt = await credentialsService.resolveUpdatedAt(integration.id, scope)\n } catch (error) {\n if (isCredentialsEncryptionUnavailableError(error)) {\n return NextResponse.json({ error: 'Integration credentials encryption is unavailable' }, { status: 503 })\n }\n throw error\n }\n\n const schema = credentialsService.getSchema(integration.id)\n const { credentials, secretFieldsConfigured } = maskSecretCredentials(schema, values ?? {})\n\n return NextResponse.json({\n integrationId: integration.id,\n schema,\n credentials,\n secretFieldsConfigured,\n updatedAt: updatedAt?.toISOString() ?? null,\n })\n}\n\nexport async function PUT(req: Request, ctx: { params?: Promise<{ id?: string }> | { id?: string } }) {\n const auth = await getAuthFromRequest(req)\n if (!auth?.tenantId) {\n return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n }\n const organizationId = resolveActiveOrganizationId(auth)\n if (!organizationId) {\n return organizationScopeRequiredResponse()\n }\n\n const rawParams = await resolveParams(ctx)\n const parsedParams = idParamsSchema.safeParse(rawParams)\n if (!parsedParams.success) {\n return NextResponse.json({ error: 'Invalid integration id' }, { status: 400 })\n }\n\n const integration = getIntegration(parsedParams.data.id)\n if (!integration) {\n return NextResponse.json({ error: 'Integration not found' }, { status: 404 })\n }\n\n const payload = await req.json().catch(() => null)\n const parsedBody = saveCredentialsSchema.safeParse(payload)\n if (!parsedBody.success) {\n return NextResponse.json({ error: 'Invalid credentials payload', details: parsedBody.error.flatten() }, { status: 422 })\n }\n\n const container = await createRequestContainer()\n const guardResult = await runIntegrationMutationGuards(\n container,\n {\n tenantId: auth.tenantId,\n organizationId,\n userId: auth.sub ?? '',\n resourceKind: 'integrations.integration',\n resourceId: integration.id,\n operation: 'update',\n requestMethod: req.method,\n requestHeaders: req.headers,\n mutationPayload: parsedBody.data as Record<string, unknown>,\n },\n resolveUserFeatures(auth),\n )\n if (!guardResult.ok) {\n return NextResponse.json(guardResult.errorBody ?? { error: 'Operation blocked by guard' }, { status: guardResult.errorStatus ?? 422 })\n }\n\n let payloadData = parsedBody.data\n if (guardResult.modifiedPayload) {\n const mergedPayload = { ...parsedBody.data, ...guardResult.modifiedPayload }\n const reparsed = saveCredentialsSchema.safeParse(mergedPayload)\n if (!reparsed.success) {\n return NextResponse.json({ error: 'Invalid credentials payload after guard transform', details: reparsed.error.flatten() }, { status: 422 })\n }\n payloadData = reparsed.data\n }\n\n const credentialsService = container.resolve('integrationCredentialsService') as CredentialsService\n const scope = { organizationId: organizationId, tenantId: auth.tenantId }\n const schema = credentialsService.getSchema(integration.id)\n\n try {\n const currentUpdatedAt = await credentialsService.resolveUpdatedAt(integration.id, scope)\n enforceCommandOptimisticLock({\n resourceKind: 'integrations.integration',\n resourceId: integration.id,\n current: currentUpdatedAt,\n request: req,\n })\n } catch (error) {\n if (isCrudHttpError(error)) {\n return NextResponse.json(error.body, { status: error.status })\n }\n if (isCredentialsEncryptionUnavailableError(error)) {\n return NextResponse.json({ error: 'Integration credentials encryption is unavailable' }, { status: 503 })\n }\n throw error\n }\n\n const credentialFieldErrors = collectCredentialUrlValidationErrors(\n schema,\n payloadData.credentials,\n )\n if (Object.keys(credentialFieldErrors).length > 0) {\n return NextResponse.json(\n { error: 'Invalid credentials payload', details: { fieldErrors: credentialFieldErrors } },\n { status: 422 },\n )\n }\n\n try {\n const existing = await credentialsService.resolve(integration.id, scope)\n const credentialsToSave = mergeMaskedSecretCredentials(\n schema,\n payloadData.credentials,\n existing ?? {},\n payloadData.unchangedSecretFields,\n )\n await credentialsService.save(integration.id, credentialsToSave, scope)\n } catch (error) {\n if (isCredentialsEncryptionUnavailableError(error)) {\n return NextResponse.json({ error: 'Integration credentials encryption is unavailable' }, { status: 503 })\n }\n throw error\n }\n\n await emitIntegrationsEvent('integrations.credentials.updated', {\n integrationId: integration.id,\n tenantId: auth.tenantId,\n organizationId,\n userId: auth.sub,\n })\n\n await runIntegrationMutationGuardAfterSuccess(guardResult.afterSuccessCallbacks, {\n tenantId: auth.tenantId,\n organizationId,\n userId: auth.sub ?? '',\n resourceKind: 'integrations.integration',\n resourceId: integration.id,\n operation: 'update',\n requestMethod: req.method,\n requestHeaders: req.headers,\n })\n\n return NextResponse.json({ ok: true })\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAClB,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAC/B,SAAS,oCAAoC;AAC7C,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,OAEK;AACP,SAAS,4CAA4C;AACrD;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mCAAmC,mCAAmC;AAE/E,MAAM,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;AAElD,MAAM,WAAW;AAAA,EACtB,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,iCAAiC,EAAE;AAAA,EAC/E,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,iCAAiC,EAAE;AACjF;AAEO,MAAM,UAAU;AAAA,EACrB,MAAM,CAAC,cAAc;AAAA,EACrB,SAAS;AACX;AAEA,SAAS,cAAc,KAAkI;AACvJ,MAAI,CAAC,IAAI,OAAQ,Q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AAM;AAAA,EACR;AAEA,QAAM,wBAAwB;AAAA,IAC5B;AAAA,IACA,YAAY;AAAA,EACd;AACA,MAAI,OAAO,KAAK,qBAAqB,EAAE,SAAS,GAAG;AACjD,WAAO,aAAa;AAAA,MAClB,EAAE,OAAO,+BAA+B,SAAS,EAAE,aAAa,sBAAsB,EAAE;AAAA,MACxF,EAAE,QAAQ,IAAI;AAAA,IAChB;AAAA,EACF;AAEA,MAAI;AACF,UAAM,WAAW,MAAM,mBAAmB,QAAQ,YAAY,IAAI,KAAK;AACvE,UAAM,oBAAoB;AAAA,MACxB;AAAA,MACA,YAAY;AAAA,MACZ,YAAY,CAAC;AAAA,MACb,YAAY;AAAA,IACd;AACA,UAAM,mBAAmB,KAAK,YAAY,IAAI,mBAAmB,KAAK;AAAA,EACxE,SAAS,OAAO;AACd,QAAI,wCAAwC,KAAK,GAAG;AAClD,aAAO,aAAa,KAAK,EAAE,OAAO,oDAAoD,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,IAC1G;AACA,UAAM;AAAA,EACR;AAEA,QAAM,sBAAsB,oCAAoC;AAAA,IAC9D,eAAe,YAAY;AAAA,IAC3B,UAAU,KAAK;AAAA,IACf;AAAA,IACA,QAAQ,KAAK;AAAA,EACf,CAAC;AAED,QAAM,wCAAwC,YAAY,uBAAuB;AAAA,IAC7E,UAAU,KAAK;AAAA,IACf;AAAA,IACA,QAAQ,KAAK,OAAO;AAAA,IACpB,cAAc;AAAA,IACd,YAAY,YAAY;AAAA,IACxB,WAAW;AAAA,IACX,eAAe,IAAI;AAAA,IACnB,gBAAgB,IAAI;AAAA,EACtB,CAAC;AAEH,SAAO,aAAa,KAAK,EAAE,IAAI,KAAK,CAAC;AACvC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -46,6 +46,10 @@ import {
|
|
|
46
46
|
refreshIntegrationDetailPanels,
|
|
47
47
|
refreshIntegrationRunActivityPanels
|
|
48
48
|
} from "../detail-page-refresh.js";
|
|
49
|
+
import {
|
|
50
|
+
buildCredentialEditValues,
|
|
51
|
+
buildIntegrationCredentialSavePayload
|
|
52
|
+
} from "../credential-secret-fields.js";
|
|
49
53
|
import { isValidCredentialUrl } from "../../../lib/credentials-field-validation.js";
|
|
50
54
|
const UNSUPPORTED_CREDENTIAL_FIELD_TYPES = /* @__PURE__ */ new Set(["oauth", "ssh_keypair"]);
|
|
51
55
|
function isEditableCredentialField(field) {
|
|
@@ -170,17 +174,22 @@ function resolvePathnameId(pathname) {
|
|
|
170
174
|
if (!integrationId || integrationId === "integrations" || integrationId === "bundle") return void 0;
|
|
171
175
|
return decodeURIComponent(integrationId);
|
|
172
176
|
}
|
|
173
|
-
function buildCredentialFields(credFields) {
|
|
177
|
+
function buildCredentialFields(credFields, secretFieldsConfigured, t) {
|
|
174
178
|
return credFields.map((field) => {
|
|
179
|
+
const baseDescription = field.helpDetails ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
180
|
+
field.helpText ? /* @__PURE__ */ jsx("div", { children: field.helpText }) : null,
|
|
181
|
+
/* @__PURE__ */ jsx(WebhookSetupGuide, { guide: field.helpDetails })
|
|
182
|
+
] }) : field.helpText;
|
|
183
|
+
const description = field.type === "secret" && secretFieldsConfigured[field.key] ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
184
|
+
baseDescription ? /* @__PURE__ */ jsx("div", { children: baseDescription }) : null,
|
|
185
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("integrations.detail.credentials.secretConfigured") })
|
|
186
|
+
] }) : baseDescription;
|
|
175
187
|
const shared = {
|
|
176
188
|
id: field.key,
|
|
177
189
|
label: field.label,
|
|
178
|
-
description
|
|
179
|
-
field.helpText ? /* @__PURE__ */ jsx("div", { children: field.helpText }) : null,
|
|
180
|
-
/* @__PURE__ */ jsx(WebhookSetupGuide, { guide: field.helpDetails, buttonLabel: "Show details" })
|
|
181
|
-
] }) : field.helpText,
|
|
190
|
+
description,
|
|
182
191
|
placeholder: field.placeholder,
|
|
183
|
-
required: field.required,
|
|
192
|
+
required: field.required && !(field.type === "secret" && secretFieldsConfigured[field.key]),
|
|
184
193
|
visibleWhen: field.visibleWhen
|
|
185
194
|
};
|
|
186
195
|
if (field.type === "secret") {
|
|
@@ -194,7 +203,8 @@ function buildCredentialFields(credFields) {
|
|
|
194
203
|
placeholder: field.placeholder,
|
|
195
204
|
value: typeof value === "string" ? value : "",
|
|
196
205
|
onChange: (event) => setValue(event.target.value),
|
|
197
|
-
disabled
|
|
206
|
+
disabled,
|
|
207
|
+
autoComplete: "new-password"
|
|
198
208
|
}
|
|
199
209
|
)
|
|
200
210
|
};
|
|
@@ -280,6 +290,7 @@ function IntegrationDetailPage({ params }) {
|
|
|
280
290
|
const [error, setError] = React.useState(null);
|
|
281
291
|
const [isNotFound, setIsNotFound] = React.useState(false);
|
|
282
292
|
const [credValues, setCredValues] = React.useState({});
|
|
293
|
+
const [secretFieldsConfigured, setSecretFieldsConfigured] = React.useState({});
|
|
283
294
|
const [credentialsUpdatedAt, setCredentialsUpdatedAt] = React.useState(null);
|
|
284
295
|
const [credentialsFormKey, setCredentialsFormKey] = React.useState(0);
|
|
285
296
|
const [isSavingCredentials, setIsSavingCredentials] = React.useState(false);
|
|
@@ -341,6 +352,7 @@ function IntegrationDetailPage({ params }) {
|
|
|
341
352
|
);
|
|
342
353
|
if (call.ok && call.result) {
|
|
343
354
|
setCredentialsUpdatedAt(call.result.updatedAt ?? null);
|
|
355
|
+
setSecretFieldsConfigured(call.result.secretFieldsConfigured ?? {});
|
|
344
356
|
}
|
|
345
357
|
if (call.ok && call.result?.credentials) {
|
|
346
358
|
const next = { ...call.result.credentials };
|
|
@@ -546,34 +558,27 @@ function IntegrationDetailPage({ params }) {
|
|
|
546
558
|
if (!currentIntegrationId) return;
|
|
547
559
|
setIsSavingCredentials(true);
|
|
548
560
|
try {
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
if (sanitizedValues.authMode === "ambient") {
|
|
557
|
-
delete sanitizedValues.accessKeyId;
|
|
558
|
-
delete sanitizedValues.secretAccessKey;
|
|
559
|
-
delete sanitizedValues.sessionToken;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
561
|
+
const credentialFields = detail?.integration.credentials?.fields ?? detail?.bundle?.credentials?.fields ?? [];
|
|
562
|
+
const savePayload = buildIntegrationCredentialSavePayload(
|
|
563
|
+
currentIntegrationId,
|
|
564
|
+
values,
|
|
565
|
+
credentialFields,
|
|
566
|
+
secretFieldsConfigured
|
|
567
|
+
);
|
|
562
568
|
const call = await runMutationWithContext({
|
|
563
569
|
actionId: "save-credentials",
|
|
564
570
|
tabId: "credentials",
|
|
565
|
-
mutationPayload: { integrationId: currentIntegrationId,
|
|
571
|
+
mutationPayload: { integrationId: currentIntegrationId, ...savePayload },
|
|
566
572
|
operation: () => withScopedApiRequestHeaders(
|
|
567
573
|
buildOptimisticLockHeader(credentialsUpdatedAt),
|
|
568
574
|
() => apiCall(`/api/integrations/${encodeURIComponent(currentIntegrationId)}/credentials`, {
|
|
569
575
|
method: "PUT",
|
|
570
576
|
headers: { "Content-Type": "application/json" },
|
|
571
|
-
body: JSON.stringify(
|
|
577
|
+
body: JSON.stringify(savePayload)
|
|
572
578
|
}, { fallback: null })
|
|
573
579
|
)
|
|
574
580
|
});
|
|
575
581
|
if (call.ok) {
|
|
576
|
-
setCredValues(sanitizedValues);
|
|
577
582
|
setCredentialsFormKey((current) => current + 1);
|
|
578
583
|
flash(t("integrations.detail.credentials.saved"), "success");
|
|
579
584
|
void loadCredentials();
|
|
@@ -586,7 +591,7 @@ function IntegrationDetailPage({ params }) {
|
|
|
586
591
|
} finally {
|
|
587
592
|
setIsSavingCredentials(false);
|
|
588
593
|
}
|
|
589
|
-
}, [credentialsUpdatedAt, loadCredentials, resolveCurrentIntegrationId, runMutationWithContext, t]);
|
|
594
|
+
}, [credentialsUpdatedAt, detail, loadCredentials, resolveCurrentIntegrationId, runMutationWithContext, secretFieldsConfigured, t]);
|
|
590
595
|
const handleVersionChange = React.useCallback(async (version) => {
|
|
591
596
|
const currentIntegrationId = resolveCurrentIntegrationId();
|
|
592
597
|
if (!currentIntegrationId) return;
|
|
@@ -661,8 +666,12 @@ function IntegrationDetailPage({ params }) {
|
|
|
661
666
|
[detail?.bundle?.credentials?.fields, detail?.integration.credentials?.fields]
|
|
662
667
|
);
|
|
663
668
|
const credentialFormFields = React.useMemo(
|
|
664
|
-
() => buildCredentialFields(editableCredentialFields),
|
|
665
|
-
[editableCredentialFields]
|
|
669
|
+
() => buildCredentialFields(editableCredentialFields, secretFieldsConfigured, t),
|
|
670
|
+
[editableCredentialFields, secretFieldsConfigured, t]
|
|
671
|
+
);
|
|
672
|
+
const credentialFormValues = React.useMemo(
|
|
673
|
+
() => buildCredentialEditValues(credValues, secretFieldsConfigured),
|
|
674
|
+
[credValues, secretFieldsConfigured]
|
|
666
675
|
);
|
|
667
676
|
const credentialSchema = React.useMemo(() => z.object({}).passthrough().superRefine((rawValues, ctx) => {
|
|
668
677
|
const values = rawValues;
|
|
@@ -698,7 +707,7 @@ function IntegrationDetailPage({ params }) {
|
|
|
698
707
|
return;
|
|
699
708
|
}
|
|
700
709
|
const normalizedValue = typeof value === "string" ? value : "";
|
|
701
|
-
if (field.required && normalizedValue.trim().length === 0) {
|
|
710
|
+
if (field.required && normalizedValue.trim().length === 0 && !(field.type === "secret" && secretFieldsConfigured[field.key])) {
|
|
702
711
|
ctx.addIssue({
|
|
703
712
|
code: z.ZodIssueCode.custom,
|
|
704
713
|
path: [field.key],
|
|
@@ -727,7 +736,7 @@ function IntegrationDetailPage({ params }) {
|
|
|
727
736
|
});
|
|
728
737
|
}
|
|
729
738
|
});
|
|
730
|
-
}), [editableCredentialFields, t]);
|
|
739
|
+
}), [editableCredentialFields, secretFieldsConfigured, t]);
|
|
731
740
|
const latestHealthLog = React.useMemo(() => logs.find(isHealthLog) ?? null, [logs]);
|
|
732
741
|
const latestOperationalLog = React.useMemo(
|
|
733
742
|
() => logs.find((log) => typeof log.payload?.operationalStatus === "string" || typeof log.payload?.summary === "string") ?? null,
|
|
@@ -939,7 +948,7 @@ function IntegrationDetailPage({ params }) {
|
|
|
939
948
|
entityId: "integrations.integration",
|
|
940
949
|
schema: credentialSchema,
|
|
941
950
|
fields: credentialFormFields,
|
|
942
|
-
initialValues:
|
|
951
|
+
initialValues: credentialFormValues,
|
|
943
952
|
onSubmit: handleSaveCredentials,
|
|
944
953
|
embedded: true,
|
|
945
954
|
hideFooterActions: true
|