@@ -187,49 +187,32 @@ async function collectAmbientProviderApiKeyServiceEnvVars(params: {
187187 durableEnvironment : Record < string , string | undefined > ;
188188 authProfileEnvironment : Record < string , string | undefined > ;
189189 existingEnvironment ?: Record < string , string | undefined > ;
190- existingEnvironmentValueSources ?: Record <
191- string ,
192- GatewayServiceEnvironmentValueSource | undefined
193- > ;
194190 platform : NodeJS . Platform ;
195191} ) : Promise < Record < string , string > > {
196192 if ( params . platform !== "linux" ) {
197193 return { } ;
198194 }
199- const existingManagedKeys = readManagedServiceEnvKeysFromEnvironment ( params . existingEnvironment ) ;
200- const existingManagedFileEnvironment = Object . fromEntries (
201- Object . entries ( params . existingEnvironment ?? { } ) . filter (
202- ( [ key , value ] ) =>
203- existingManagedKeys . has ( key . toUpperCase ( ) ) &&
204- readEnvironmentValueSource ( params . existingEnvironmentValueSources , key ) === "file" &&
205- value ?. trim ( ) ,
206- ) ,
207- ) ;
208195 const ownedKeys = new Set (
209196 [
210197 ...Object . keys ( params . durableEnvironment ) ,
211198 ...Object . keys ( params . authProfileEnvironment ) ,
212- ...Object . keys ( params . existingEnvironment ?? { } ) . filter (
213- ( key ) => ! Object . hasOwn ( existingManagedFileEnvironment , key ) ,
214- ) ,
199+ ...Object . keys ( params . existingEnvironment ?? { } ) ,
215200 ] . map ( ( key ) => key . toUpperCase ( ) ) ,
216201 ) ;
217202 const candidates = new Map (
218- Object . entries ( { ...params . env , ...existingManagedFileEnvironment } ) . flatMap (
219- ( [ rawKey , rawValue ] ) => {
220- const key = normalizeEnvVarKey ( rawKey , { portable : true } ) ?. toUpperCase ( ) ;
221- const value = rawValue ?. trim ( ) ;
222- return key &&
223- key . endsWith ( "_API_KEY" ) &&
224- ! key . endsWith ( "_ADMIN_API_KEY" ) &&
225- ! ownedKeys . has ( key ) &&
226- value &&
227- ! isDangerousHostEnvVarName ( key ) &&
228- ! isDangerousHostEnvOverrideVarName ( key )
229- ? [ [ key , value ] as const ]
230- : [ ] ;
231- } ,
232- ) ,
203+ Object . entries ( params . env ) . flatMap ( ( [ rawKey , rawValue ] ) => {
204+ const key = normalizeEnvVarKey ( rawKey , { portable : true } ) ?. toUpperCase ( ) ;
205+ const value = rawValue ?. trim ( ) ;
206+ return key &&
207+ key . endsWith ( "_API_KEY" ) &&
208+ ! key . endsWith ( "_ADMIN_API_KEY" ) &&
209+ ! ownedKeys . has ( key ) &&
210+ value &&
211+ ! isDangerousHostEnvVarName ( key ) &&
212+ ! isDangerousHostEnvOverrideVarName ( key )
213+ ? [ [ key , value ] as const ]
214+ : [ ] ;
215+ } ) ,
233216 ) ;
234217 if ( candidates . size === 0 ) {
235218 return { } ;
@@ -730,7 +713,6 @@ async function buildGatewayInstallEnvironment(params: {
730713 durableEnvironment,
731714 authProfileEnvironment,
732715 existingEnvironment : params . existingEnvironment ,
733- existingEnvironmentValueSources : params . existingEnvironmentValueSources ,
734716 platform : params . platform ,
735717 } ) ;
736718 const stateDirDotEnvRenderEnvironment = omitEnvironmentEntriesShadowedBy (
0 commit comments