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

Function renderAuthTemplate

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

Source from the content-addressed store, hash-verified

105 * method with two distinct inputs (e.g. Datadog) fills each header from a
106 * different value. */
107export const renderAuthTemplate = (
108 template: Authentication,
109 values: Record<string, string | null>,
110): RenderedAuth => {
111 if (template.kind === "oauth2") {
112 return {
113 headers: { authorization: `Bearer ${values[TOKEN_VARIABLE] ?? ""}` },
114 queryParams: {},
115 };
116 }
117 return renderAuthPlacements(template.placements, values);
118};
119
120/** The distinct input variables a template references — the inputs a connection
121 * 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