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

Function renderAuthTemplate

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

Source from the content-addressed store, hash-verified

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