History

remove legacy compatibility codepaths

Rhys Sullivan committed 7 months ago

Commit ddd3aaa1 parent e2977a021 files · +111 −1158Browse files

Showing the changes to plugins/openapi (1 of 21 files). Show all

Unified · Split

plugins/openapi/sdk/index.ts+0−46
@@ -19,7 +19,6 @@ import { · 18 unmodified lines
1919 } from "@executor/platform-sdk/plugins";
2020 import {
2121 createPluginLocalConfigEntrySchema,
22− decodeCurrentOrLegacyLocalConfigAuth,
2322 pluginLocalConfigSourceFromConfig,
2423 runtimeEffectError,
2524 SecretMaterialResolverService,
@@ -163,26 +162,6 @@ const decodeOpenApiCurrentLocalConfigOption = Schema.decodeUnknownOption( · 137 unmodified lines
163162 }),
164163 );
165164
166−const decodeOpenApiLegacyLocalConfigOption = Schema.decodeUnknownOption(
167− Schema.Struct({
168− kind: Schema.Literal("openapi"),
169− name: Schema.optional(Schema.String),
170− namespace: Schema.optional(Schema.String),
171− enabled: Schema.optional(Schema.Boolean),
172− connection: Schema.Struct({
173− endpoint: Schema.optional(Schema.NullOr(Schema.String)),
174− auth: Schema.optional(Schema.Unknown),
175− }),
176− binding: Schema.Struct({
177− specUrl: Schema.String,
178− defaultHeaders: Schema.optional(
179− Schema.NullOr(Schema.Record({ key: Schema.String, value: Schema.String })),
180− ),
181− }),
182− config: Schema.optional(Schema.Unknown),
183− }),
184−);
185−
186165 const createStoredSourceData = (
187166 input: OpenApiConnectInput,
188167 ): OpenApiStoredSourceData => ({
@@ -224,31 +203,6 @@ const openApiStoredSourceDataFromLocalConfig = (input: { · 35 unmodified lines
224203 });
225204 }
226205
227− const legacy = decodeOpenApiLegacyLocalConfigOption(input.config);
228− if (Option.isSome(legacy)) {
229− return normalizeStoredSourceData({
230− specUrl: legacy.value.binding.specUrl.trim(),
231− baseUrl: legacy.value.connection.endpoint?.trim() || null,
232− auth: decodeCurrentOrLegacyLocalConfigAuth({
233− auth: legacy.value.connection.auth,
234− authSchema: OpenApiConnectionAuthSchema,
235− loadedConfig: input.loadedConfig,
236− onLegacySecretRef: (tokenSecretRef) => ({
237− kind: "bearer",
238− tokenSecretRef,
239− headerName: null,
240− prefix: null,
241− }),
242− fallback: {
243− kind: "none",
244− },
245− }),
246− defaultHeaders: legacy.value.binding.defaultHeaders ?? null,
247− etag: null,
248− lastSyncAt: null,
249− });
250− }
251−
252206 throw new Error("Unsupported OpenAPI local source config.");
253207 };
254208