( template: Authentication, values: Record<string, string | null>, )
| 92 | * method with two distinct inputs (e.g. Datadog) fills each header from a |
| 93 | * different value. */ |
| 94 | export const renderAuthTemplate = ( |
| 95 | template: Authentication, |
| 96 | values: Record<string, string | null>, |
| 97 | ): RenderedAuth => { |
| 98 | if (template.kind === "oauth2") { |
| 99 | return { |
| 100 | headers: { authorization: `Bearer ${values[TOKEN_VARIABLE] ?? ""}` }, |
| 101 | queryParams: {}, |
| 102 | }; |
| 103 | } |
| 104 | return renderAuthPlacements(template.placements, values); |
| 105 | }; |
| 106 | |
| 107 | /** The distinct input variables a template references — the inputs a connection |
| 108 | * must supply. An oauth template needs `token`; an apiKey method needs every |
no test coverage detected