Skip to content

Commit c2454bb

Browse files
committed
fix(examples,tests): write connector input values as CEL envelopes
The showcase Slack flow's text and the DARK credential fixtures carried a single-brace token in connectorConfig.input, which registration and validate now refuse. Rewrite them as CEL value envelopes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzGExkj8nxREmV7FjX
1 parent 872f446 commit c2454bb

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

‎examples/app-showcase/src/automation/flows/index.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,10 @@ export const TaskCompletedSlackFlow = defineFlow({
349349
actionId: 'chat.postMessage',
350350
input: {
351351
channel: 'C0WINS000',
352-
text: '✅ Task done: {record.title}',
352+
// Each input value is a literal or a CEL value envelope evaluated
353+
// before dispatch (#27968); a `{…}` token in a string is refused.
354+
// `title` is a required field, so it is read unguarded.
355+
text: { dialect: 'cel', source: "'✅ Task done: ' + record.title" },
353356
},
354357
},
355358
},

‎packages/cli/test/flow-credential-literal-doors.e2e.test.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
* query parameter, a nested connector input); DARK is the same flow with
1616
* templates in those three positions — a `{{ var }}` hole at the http url and
1717
* header (text slots, where a single-brace token is refused since #19939), a
18-
* `{var}` token at the connector input — and must stay silent. Every
18+
* CEL value envelope computing the connector input's `auth` map (a value slot
19+
* since #27968, where a `{…}` token is refused) — and must stay silent. Every
1920
* value is a probe sentinel, not a credential.
2021
*
2122
* Integration tier: it spawns the source CLI (`packages/cli/vitest-tiers.ts`).
@@ -85,7 +86,11 @@ const stackOf = (literal: boolean) => ({
8586
connectorConfig: {
8687
connectorId: 'rest',
8788
actionId: 'request',
88-
input: { method: 'GET', path: '/p', auth: { clientSecret: literal ? SENTINELS[2] : '{api_token}' } },
89+
input: {
90+
method: 'GET',
91+
path: '/p',
92+
auth: literal ? { clientSecret: SENTINELS[2] } : { dialect: 'cel', source: "{'clientSecret': api_token}" },
93+
},
8994
},
9095
},
9196
{ id: 'end', type: 'end', label: 'End' },

‎packages/metadata-protocol/src/runtime-authoring-gate.flow-credential-literal.test.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ const SENTINELS = ['door-header-sentinel', 'door-url-sentinel', 'door-input-sent
2424
/**
2525
* One flow, three served positions. `literal: false` is the same flow with templates:
2626
* a `{{ var }}` hole at the http `url` and header — text slots, where a single-brace
27-
* token is refused at this door since #19939 — and a `{var}` token at the connector input.
27+
* token is refused at this door since #19939 — and, at the connector input, a CEL value
28+
* envelope computing the `auth` map: the input is a value slot since #27968, where a
29+
* `{…}` token is refused.
2830
*/
2931
const credentialFlow = (literal: boolean) => ({
3032
name: literal ? 'door_cred_lit' : 'door_cred_dark',
@@ -55,7 +57,11 @@ const credentialFlow = (literal: boolean) => ({
5557
connectorConfig: {
5658
connectorId: 'rest',
5759
actionId: 'request',
58-
input: { method: 'GET', path: '/p', auth: { clientSecret: literal ? SENTINELS[2] : '{api_token}' } },
60+
input: {
61+
method: 'GET',
62+
path: '/p',
63+
auth: literal ? { clientSecret: SENTINELS[2] } : { dialect: 'cel', source: "{'clientSecret': api_token}" },
64+
},
5965
},
6066
},
6167
{ id: 'end', type: 'end', label: 'End' },

0 commit comments

Comments
 (0)