Skip to content

Commit c0dac17

Browse files
committed
wip(dogfood): connector URL and nested-key door pins
Claude-Session: https://claude.ai/code/session_01Q4EjjP1K353tLKWRMajLsE Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6d544e6 commit c0dac17

2 files changed

Lines changed: 354 additions & 10 deletions

File tree

‎packages/qa/dogfood/test/connector-meta-door-undeclared-keys-withheld.dogfood.test.ts‎

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
// The connector metadata doors, booted on the showcase with its own connector
44
// plugins — keys a connector does not declare are never served:
55
//
6-
// - READ: a stored row carrying top-level keys the connector does not declare
7-
// (seeded through the system context, the only way such a row is written
8-
// now), an instance whose `retryConfig` and a descriptor whose `actions`
9-
// element carry an undeclared key (both accepted by the save door), are
6+
// - READ: a stored row carrying top-level keys the connector does not declare,
7+
// an instance whose `retryConfig` and a descriptor whose `actions` element
8+
// carry an undeclared key (each seeded through the system context, the only
9+
// way such a row is written now: the save door refuses all three), are
1010
// served with those keys withheld and every declared key as stored — to a
1111
// member and to an administrator, in the item, layered, published and list
1212
// reads, and on the published read of a package published twice (whose
@@ -154,12 +154,21 @@ describe('connector metadata doors: keys a connector does not declare are withhe
154154
}),
155155
}, { context: SYSTEM });
156156

157-
const retry = await stack.apiAs(admin, 'PUT', `/meta/connector/${RETRY}`, instance(RETRY, {
158-
retryConfig: { strategy: 'exponential_backoff', maxAttempts: 2, secret: PLACEHOLDERS.retry },
159-
}));
160-
expect(retry.status, await retry.clone().text()).toBe(200);
161-
const desc = await stack.apiAs(admin, 'PUT', `/meta/connector/${DESCRIPTOR}`, descriptor);
162-
expect(desc.status, await desc.clone().text()).toBe(200);
157+
// The nested rows: a clean save, then the system context writes the
158+
// undeclared nested key over it (the save door refuses it now).
159+
const seedOver = async (name: string, clean: Record<string, unknown>, seeded: Record<string, unknown>) => {
160+
const res = await stack.apiAs(admin, 'PUT', `/meta/connector/${name}`, clean);
161+
expect(res.status, await res.clone().text()).toBe(200);
162+
const [seedRow] = await stored(name);
163+
await ql.update('sys_metadata', { id: seedRow.id, metadata: JSON.stringify(seeded) }, { context: SYSTEM });
164+
};
165+
await seedOver(
166+
RETRY,
167+
instance(RETRY, { retryConfig: { strategy: 'exponential_backoff', maxAttempts: 2 } }),
168+
instance(RETRY, { retryConfig: { strategy: 'exponential_backoff', maxAttempts: 2, secret: PLACEHOLDERS.retry } }),
169+
);
170+
const { token: _token, ...cleanAction } = descriptor.actions[0]!;
171+
await seedOver(DESCRIPTOR, { ...descriptor, actions: [cleanAction, descriptor.actions[1]] }, descriptor);
163172
}, 180_000);
164173

165174
afterAll(async () => {

0 commit comments

Comments
 (0)