@teleporthq/teleport-plugin-next-workflows 0.43.20 → 0.43.21
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/__tests__/auth-env-secret-preservation.test.ts +40 -14
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/workflow-project-plugin.d.ts.map +1 -1
- package/dist/cjs/workflow-project-plugin.js +21 -13
- package/dist/cjs/workflow-project-plugin.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/workflow-project-plugin.d.ts.map +1 -1
- package/dist/esm/workflow-project-plugin.js +21 -13
- package/dist/esm/workflow-project-plugin.js.map +1 -1
- package/package.json +2 -2
- package/src/workflow-project-plugin.ts +21 -13
|
@@ -60,20 +60,46 @@ describe('resolveAuthEnvValue', () => {
|
|
|
60
60
|
).toBe('')
|
|
61
61
|
})
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
// Regression: every CMS type in the platform exposes its base URL + access
|
|
64
|
+
// token through exactly two STABLE env keys — CMS_URL and CMS_ACCESS_TOKEN —
|
|
65
|
+
// regardless of how the underlying secret is named. Whenever the value is a
|
|
66
|
+
// `teleporthq.secrets.<name>` alias (env KEY != secret name), emptying it lost
|
|
67
|
+
// the mapping: the deploy worker's empty-value fallback looked up a secret
|
|
68
|
+
// named after the KEY (CMS_URL / CMS_ACCESS_TOKEN), which never exists — only
|
|
69
|
+
// the referenced name (STRAPI_URL, CONTENTFUL_API_TOKEN2, …) does. So the CMS
|
|
70
|
+
// base URL and/or token shipped blank and every CMS fetch on the deployed site
|
|
71
|
+
// failed (empty CMS_URL → hostless `/api/...`; empty token → 401). The list
|
|
72
|
+
// rendered in the GUI but was empty in the deployed project. These must all be
|
|
73
|
+
// PRESERVED so the worker resolves them via its `teleporthq.secrets.*` branch.
|
|
74
|
+
// Source of truth for the secret names: each integration's flow.ts
|
|
75
|
+
// getUniqueNameForSecret(...) + to-uidl-mapper provideBaseUrl/provideAccessToken.
|
|
76
|
+
describe('PRESERVES CMS alias placeholders for every CMS type', () => {
|
|
77
|
+
const cmsAliasCases: Array<[string, string, string]> = [
|
|
78
|
+
// [cmsType, env key, alias value emitted by the GUI mapper]
|
|
79
|
+
['contentful (token)', 'CMS_ACCESS_TOKEN', 'teleporthq.secrets.CONTENTFUL_API_TOKEN2'],
|
|
80
|
+
['strapi (url)', 'CMS_URL', 'teleporthq.secrets.STRAPI_URL'],
|
|
81
|
+
['strapi (token)', 'CMS_ACCESS_TOKEN', 'teleporthq.secrets.STRAPI_ACCESS_TOKEN'],
|
|
82
|
+
['flotiq (url)', 'CMS_URL', 'teleporthq.secrets.FLOTIQ_URL'],
|
|
83
|
+
['flotiq (token)', 'CMS_ACCESS_TOKEN', 'teleporthq.secrets.FLOTIQ_ACCESS_TOKEN'],
|
|
84
|
+
['caisy (token)', 'CMS_ACCESS_TOKEN', 'teleporthq.secrets.CAISY_ACCESS_TOKEN'],
|
|
85
|
+
['wordpress (url)', 'CMS_URL', 'teleporthq.secrets.WORDPRESS_URL'],
|
|
86
|
+
]
|
|
87
|
+
it.each(cmsAliasCases)('%s alias survives', (_label, key, value) => {
|
|
88
|
+
expect(resolveAuthEnvValue(key, value, oauthKeys)).toBe(value)
|
|
89
|
+
// Holds even with no preserveKeys argument (the CMS set is unconditional).
|
|
90
|
+
expect(resolveAuthEnvValue(key, value)).toBe(value)
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
// CMS_URL values that are NOT secret refs (Contentful delivery URL, caisy
|
|
94
|
+
// GraphQL URL) pass through untouched whether or not they're in the preserve
|
|
95
|
+
// set — listing CMS_URL is a harmless no-op for them.
|
|
96
|
+
const cmsPlainUrlCases: Array<[string, string]> = [
|
|
97
|
+
['contentful', 'https://cdn.contentful.com/spaces/0g5imrx0o9y5/environments/master'],
|
|
98
|
+
['caisy', 'https://cloud.caisy.io/api/v3/e/PROJECT_ID/graphql'],
|
|
99
|
+
]
|
|
100
|
+
it.each(cmsPlainUrlCases)('%s plain CMS_URL passes through untouched', (_label, url) => {
|
|
101
|
+
expect(resolveAuthEnvValue('CMS_URL', url, oauthKeys)).toBe(url)
|
|
102
|
+
})
|
|
77
103
|
})
|
|
78
104
|
|
|
79
105
|
it('keeps NEXTAUTH defaults and leaves non-auth behavior unchanged', () => {
|