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