History

Share secret-backed credential values (#454)

Rhys Sullivan committed 6 months ago

Commit 9639a681 parent 899a99e17 files · +768 −954Browse files

Showing the changes to packages/plugins/openapi/src/api (1 of 17 files). Show all

Unified · Split

packages/plugins/openapi/src/api/group.ts+1−9
@@ -1,6 +1,6 @@
1import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "@effect/platform";1import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "@effect/platform";
2import { Schema } from "effect";2import { Schema } from "effect";
3import { ScopeId } from "@executor/sdk";3import { ScopeId, SecretBackedValue } from "@executor/sdk";
4import { InternalError } from "@executor/api";4import { InternalError } from "@executor/api";
5 5
6import { OpenApiParseError, OpenApiExtractionError, OpenApiOAuthError } from "../sdk/errors";6import { OpenApiParseError, OpenApiExtractionError, OpenApiOAuthError } from "../sdk/errors";
@@ -21,14 +21,6 @@ const scopeIdParam = HttpApiSchema.param("scopeId", ScopeId); · 14 unmodified lines
21const namespaceParam = HttpApiSchema.param("namespace", Schema.String);21const namespaceParam = HttpApiSchema.param("namespace", Schema.String);
22const sourceScopeIdParam = HttpApiSchema.param("sourceScopeId", ScopeId);22const sourceScopeIdParam = HttpApiSchema.param("sourceScopeId", ScopeId);
23 23
24const SecretBackedValue = Schema.Union(
25 Schema.String,
26 Schema.Struct({
27 secretId: Schema.String,
28 prefix: Schema.optional(Schema.String),
29 }),
30);
31
32const SpecFetchCredentialsPayload = Schema.Struct({24const SpecFetchCredentialsPayload = Schema.Struct({
33 headers: Schema.optional(Schema.Record({ key: Schema.String, value: SecretBackedValue })),25 headers: Schema.optional(Schema.Record({ key: Schema.String, value: SecretBackedValue })),
34 queryParams: Schema.optional(Schema.Record({ key: Schema.String, value: SecretBackedValue })),26 queryParams: Schema.optional(Schema.Record({ key: Schema.String, value: SecretBackedValue })),