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

Function renderAuthTemplate

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

Source from the content-addressed store, hash-verified

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