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

Function renderAuthTemplate

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

Source from the content-addressed store, hash-verified

88 * method with two distinct inputs (e.g. Datadog) fills each header from a
89 * different value. */
90export const renderAuthTemplate = (
91 template: Authentication,
92 values: Record<string, string | null>,
93): RenderedAuth => {
94 if (template.kind === "oauth2") {
95 return {
96 headers: { authorization: `Bearer ${values[TOKEN_VARIABLE] ?? ""}` },
97 queryParams: {},
98 };
99 }
100 return renderAuthPlacements(template.placements, values);
101};
102
103/** The distinct input variables a template references — the inputs a connection
104 * 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