MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / renderAuthTemplate

Function renderAuthTemplate

packages/plugins/openapi/src/sdk/config.ts:94–105  ·  view source on GitHub ↗
(
  template: Authentication,
  values: Record<string, string | null>,
)

Source from the content-addressed store, hash-verified

92 * method with two distinct inputs (e.g. Datadog) fills each header from a
93 * different value. */
94export const renderAuthTemplate = (
95 template: Authentication,
96 values: Record<string, string | null>,
97): RenderedAuth => {
98 if (template.kind === "oauth2") {
99 return {
100 headers: { authorization: `Bearer ${values[TOKEN_VARIABLE] ?? ""}` },
101 queryParams: {},
102 };
103 }
104 return renderAuthPlacements(template.placements, values);
105};
106
107/** The distinct input variables a template references — the inputs a connection
108 * must supply. An oauth template needs `token`; an apiKey method needs every

Callers 3

invokeOpenApiBackedToolFunction · 0.90
checkHealthOpenApiFunction · 0.90

Calls 1

renderAuthPlacementsFunction · 0.90

Tested by

no test coverage detected