Open josephjclark opened 7 months ago
Many adaptors are copying this function from the new common http helpers:
import { makeBasicAuthHeader, } from '@openfn/language-common/util' const addBasicAuth = (configuration = {}, headers) => { const { username, password } = configuration; if (username && password) { Object.assign(headers, makeBasicAuthHeader(username, password)); } };
Instead of exporting makeBasicAuthHeader, we should export addBasicAuth. Maybe we add options for the user/pass keys on config, just in case.
makeBasicAuthHeader
addBasicAuth
the new common http options() helper makes this clean and easy - I wonder if this is the answer?
options()
Many adaptors are copying this function from the new common http helpers:
Instead of exporting
makeBasicAuthHeader
, we should exportaddBasicAuth
. Maybe we add options for the user/pass keys on config, just in case.