Skip to content

Commit bcb4ed3

Browse files
authored
feat: pass proxy url to admission webhook (#2718)
1 parent 43e52a8 commit bcb4ed3

30 files changed

+92
-4
lines changed

controlplane/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"fastify-plugin": "^4.5.1",
7878
"fastify-raw-body": "^4.3.0",
7979
"graphql": "^16.9.0",
80+
"http-proxy-agent": "8.0.0",
8081
"https-proxy-agent": "8.0.0",
8182
"ioredis": "^5.4.1",
8283
"isomorphic-dompurify": "^2.33.0",

controlplane/src/core/bufservices/contract/createContract.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ export function createContract(
207207
disableResolvabilityValidation: req.disableResolvabilityValidation,
208208
},
209209
federatedGraphs: [{ ...contractGraph, contract }],
210+
webhookProxyUrl: opts.webhookProxyUrl,
210211
});
211212

212213
compositionErrors.push(...composition.compositionErrors);

controlplane/src/core/bufservices/contract/updateContract.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export function updateContract(
156156
disableResolvabilityValidation: req.disableResolvabilityValidation,
157157
ignoreExternalKeys,
158158
},
159+
webhookProxyUrl: opts.webhookProxyUrl,
159160
});
160161

161162
const compositionErrors: PlainMessage<CompositionError>[] = [];
@@ -187,6 +188,7 @@ export function updateContract(
187188
},
188189
},
189190
],
191+
webhookProxyUrl: opts.webhookProxyUrl,
190192
});
191193

192194
compositionErrors.push(...composition.compositionErrors);

controlplane/src/core/bufservices/feature-flag/createFeatureFlag.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export function createFeatureFlag(
216216
ignoreExternalKeys: ignoreExternalKeysFeature?.enabled ?? false,
217217
},
218218
federatedGraphs,
219+
webhookProxyUrl: opts.webhookProxyUrl,
219220
});
220221

221222
compositionErrors.push(...composition.compositionErrors);

controlplane/src/core/bufservices/feature-flag/deleteFeatureFlag.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export function deleteFeatureFlag(
149149
ignoreExternalKeys: ignoreExternalKeysFeature?.enabled ?? false,
150150
},
151151
federatedGraphs,
152+
webhookProxyUrl: opts.webhookProxyUrl,
152153
});
153154

154155
compositionErrors.push(...composition.compositionErrors);

controlplane/src/core/bufservices/feature-flag/enableFeatureFlag.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export function enableFeatureFlag(
132132
ignoreExternalKeys: ignoreExternalKeysFeature?.enabled ?? false,
133133
},
134134
federatedGraphs,
135+
webhookProxyUrl: opts.webhookProxyUrl,
135136
});
136137

137138
compositionErrors.push(...composition.compositionErrors);

controlplane/src/core/bufservices/feature-flag/updateFeatureFlag.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ export function updateFeatureFlag(
187187
ignoreExternalKeys: ignoreExternalKeysFeature?.enabled ?? false,
188188
},
189189
federatedGraphs: allFederatedGraphsToCompose,
190+
webhookProxyUrl: opts.webhookProxyUrl,
190191
});
191192

192193
compositionErrors.push(...composition.compositionErrors);

controlplane/src/core/bufservices/federated-graph/createFederatedGraph.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ export function createFederatedGraph(
237237
ignoreExternalKeys: ignoreExternalKeysFeature?.enabled ?? false,
238238
},
239239
federatedGraphs: [federatedGraph],
240+
webhookProxyUrl: opts.webhookProxyUrl,
240241
});
241242

242243
compositionErrors.push(...composition.compositionErrors);

controlplane/src/core/bufservices/federated-graph/migrateFromApollo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ export function migrateFromApollo(
166166
disableResolvabilityValidation: true,
167167
ignoreExternalKeys: ignoreExternalKeysFeature?.enabled ?? false,
168168
},
169+
webhookProxyUrl: opts.webhookProxyUrl,
169170
});
170171
});
171172

controlplane/src/core/bufservices/federated-graph/moveFederatedGraph.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ export function moveFederatedGraph(
126126
jwtSecret: opts.admissionWebhookJWTSecret,
127127
},
128128
opts.chClient!,
129+
undefined,
130+
opts.webhookProxyUrl,
129131
);
130132

131133
const allDeploymentErrors: PlainMessage<DeploymentError>[] = [];
@@ -164,6 +166,8 @@ export function moveFederatedGraph(
164166
jwtSecret: opts.admissionWebhookJWTSecret,
165167
},
166168
opts.chClient!,
169+
undefined,
170+
opts.webhookProxyUrl,
167171
);
168172

169173
allCompositionErrors.push(...contractErrors);

0 commit comments

Comments
 (0)