( template: Authentication, values: Record<string, string | null>, )
| 105 | * method with two distinct inputs (e.g. Datadog) fills each header from a |
| 106 | * different value. */ |
| 107 | export 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 |
no test coverage detected