Skip to content

Commit 49b1ec9

Browse files
authored
Clean up named value normalization follow-ups
1 parent f166d71 commit 49b1ec9

2 files changed

Lines changed: 0 additions & 110 deletions

File tree

fix-summary.txt

Lines changed: 0 additions & 53 deletions
This file was deleted.

tests/unit/services/resource-publisher.test.ts

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -295,63 +295,6 @@ describe('resource-publisher', () => {
295295
expect(query['token'][0]).toBe(`{{${authTokenName}}}`);
296296
});
297297

298-
it.skip('should canonicalize backend credential named value references from overrides', async () => {
299-
// TODO: Backend credentials can also use {{namedValue}} tokens (e.g., Authorization
300-
// headers, API keys). Currently only Logger credentials are normalized. This test
301-
// documents the gap and will pass once the normalization logic is extended to Backend.
302-
// See: .squad/decisions/inbox/testengineer-named-value-coverage.md
303-
const client = createMockClient();
304-
const store = createMockStore();
305-
const namedValueName = 'Backend-Auth-Token';
306-
store.readResource.mockResolvedValue({
307-
name: 'my-backend',
308-
properties: {
309-
url: 'https://api.example.com',
310-
protocol: 'http',
311-
credentials: {
312-
header: {
313-
Authorization: ['{{old-token}}'],
314-
},
315-
},
316-
},
317-
});
318-
store.listResources.mockResolvedValue([
319-
{ type: ResourceType.Backend, nameParts: ['my-backend'] },
320-
{ type: ResourceType.NamedValue, nameParts: [namedValueName] },
321-
]);
322-
323-
const configWithOverrides: PublishConfig = {
324-
...testConfig,
325-
overrides: {
326-
backends: {
327-
'my-backend': {
328-
credentials: {
329-
header: {
330-
Authorization: [`{{${namedValueName.toLowerCase()}}}`],
331-
},
332-
},
333-
},
334-
},
335-
},
336-
};
337-
338-
const descriptor: ResourceDescriptor = {
339-
type: ResourceType.Backend,
340-
nameParts: ['my-backend'],
341-
};
342-
343-
await publishResource(client, store, testContext, descriptor, configWithOverrides);
344-
345-
const putCall = client.putResource.mock.calls[0];
346-
const putJson = putCall[2] as Record<string, unknown>;
347-
const props = putJson.properties as Record<string, unknown>;
348-
const credentials = props.credentials as Record<string, unknown>;
349-
const header = credentials?.header as Record<string, unknown>;
350-
351-
// This assertion will pass once Backend normalization is implemented
352-
expect(header?.Authorization).toEqual([`{{${namedValueName}}}`]);
353-
});
354-
355298
it('should preserve opaque JSON properties', async () => {
356299
const client = createMockClient();
357300
const store = createMockStore();

0 commit comments

Comments
 (0)