2020// row is never touched.
2121// - CARRY-FORWARD: a save of the served form keeps the stored values; an
2222// author's own edit of a served URL is stored as the author wrote it; a
23- // `retryConfig` the author removes is removed with its stored keys. A row
24- // stored with a credential part in a `providerConfig` URL keeps
25- // dispatching: the runtime materializes the stored row as it is, never
26- // re-judged by the entry's refinement.
23+ // `retryConfig` the author removes is removed with its stored keys.
2724//
2825// Every credential below is an obviously-fake placeholder, and every assertion
2926// on one is its absence from what a door served or stored, or its presence at
@@ -43,7 +40,6 @@ const PLACEHOLDERS = {
4340 urlQuery : 'TEST_PLACEHOLDER_CUN_URL_QUERY' ,
4441 nested : 'TEST_PLACEHOLDER_CUN_NESTED' ,
4542 authEndpoint : 'TEST_PLACEHOLDER_CUN_AUTH_ENDPOINT' ,
46- legacyQuery : 'TEST_PLACEHOLDER_CUN_LEGACY_QUERY' ,
4743 resolvedRef : 'TEST_PLACEHOLDER_CUN_RESOLVED_REFERENCE' ,
4844} as const ;
4945const NEVER_SERVED = Object . values ( PLACEHOLDERS ) . filter ( ( p ) => p !== PLACEHOLDERS . resolvedRef ) ;
@@ -55,7 +51,6 @@ const DESCRIPTOR = 'cun_descriptor';
5551const EXISTING = 'cun_existing' ;
5652const OAUTH_ROW = 'cun_oauth_stored' ;
5753const RETRY_ROW = 'cun_retry_stored' ;
58- const LEGACY_ROW = 'cun_legacy_url_stored' ;
5954
6055const rowsOf = ( r : any ) : any [ ] => ( Array . isArray ( r ) ? r : Array . isArray ( r ?. records ) ? r . records : Array . isArray ( r ?. value ) ? r . value : [ ] ) ;
6156const bodyOf = ( row : any ) : Record < string , any > =>
@@ -184,12 +179,6 @@ describe('connector metadata doors: an authored connector keeps no credential in
184179 instance ( RETRY_ROW , { retryConfig : { maxAttempts : 2 } } ) ,
185180 instance ( RETRY_ROW , { retryConfig : { maxAttempts : 2 , secret : PLACEHOLDERS . nested } } ) ,
186181 ) ;
187- // Saved disabled, so nothing materializes before the seeded form is the row.
188- await seedOver (
189- LEGACY_ROW ,
190- instance ( LEGACY_ROW , { enabled : false } ) ,
191- instance ( LEGACY_ROW , { providerConfig : { baseUrl : `${ upstreamUrl } /v1?region=eu&token=${ PLACEHOLDERS . legacyQuery } ` } } ) ,
192- ) ;
193182 } , 180_000 ) ;
194183
195184 afterAll ( async ( ) => {
@@ -342,29 +331,5 @@ describe('connector metadata doors: an authored connector keeps no credential in
342331 expect ( cleared . status , await cleared . clone ( ) . text ( ) ) . toBe ( 200 ) ;
343332 expect ( bodyOf ( ( await stored ( RETRY_ROW ) ) [ 0 ] ) ) . not . toHaveProperty ( 'retryConfig' ) ;
344333 } ) ;
345-
346- it ( 'a row stored with a credential part in its URL keeps dispatching: served without it, saved keeping it, materialized as stored' , async ( ) => {
347- const { text, item } = await read ( member , LEGACY_ROW ) ;
348- expect ( holdsAPlaceholder ( text ) ) . toBe ( false ) ;
349- expect ( item . providerConfig ) . toEqual ( { baseUrl : `${ upstreamUrl } /v1?region=eu` } ) ;
350-
351- const served = authorable ( ( await read ( admin , LEGACY_ROW ) ) . item ) ;
352- const res = await stack . apiAs ( admin , 'PUT' , `/meta/connector/${ LEGACY_ROW } ` , { ...served , label : 'CUN legacy (edited)' } ) ;
353- expect ( res . status , await res . clone ( ) . text ( ) ) . toBe ( 200 ) ;
354- const atRest = bodyOf ( ( await stored ( LEGACY_ROW ) ) [ 0 ] ) ;
355- expect ( atRest . label ) . toBe ( 'CUN legacy (edited)' ) ;
356- expect ( atRest . providerConfig . baseUrl ) . toBe ( `${ upstreamUrl } /v1?region=eu&token=${ PLACEHOLDERS . legacyQuery } ` ) ;
357-
358- await waitReady ( LEGACY_ROW ) ;
359- const handler = automation . resolveConnectorAction ( LEGACY_ROW , 'request' ) ;
360- expect ( handler , `${ LEGACY_ROW } is materialized with its request action` ) . toBeTypeOf ( 'function' ) ;
361- const before = received . length ;
362- const out = await handler ( { method : 'GET' , path : '/probe' } , { } ) ;
363- expect ( out ?. status , JSON . stringify ( out ) ) . toBe ( 200 ) ;
364- expect ( received . length ) . toBe ( before + 1 ) ;
365- const sent = new URL ( received [ received . length - 1 ] ! , 'http://upstream.invalid' ) ;
366- expect ( sent . pathname ) . toBe ( '/v1/probe' ) ;
367- expect ( sent . searchParams . get ( 'token' ) , 'the stored URL is the one dispatched' ) . toBe ( PLACEHOLDERS . legacyQuery ) ;
368- } ) ;
369334 } ) ;
370335} ) ;
0 commit comments