@heroku-cli/command
Version:
base class for Heroku CLI commands
23 lines (22 loc) • 805 B
JavaScript
/**
* Thin wrapper around credential-manager-core so tests can inject a mock
* (ESM module exports cannot be stubbed with sinon).
*/
import { getAuth as realGetAuth, removeAuth as realRemoveAuth, saveAuth as realSaveAuth, } from './credential-manager-core/index.js';
let provider = {
getAuth: realGetAuth,
removeAuth: realRemoveAuth,
saveAuth: realSaveAuth,
};
export function setCredentialManagerProvider(p) {
provider = p;
}
export async function getAuth(account, host, service) {
return provider.getAuth(account, host, service);
}
export async function removeAuth(account, hosts, service) {
return provider.removeAuth(account, hosts, service);
}
export async function saveAuth(account, token, hosts, service) {
return provider.saveAuth(account, token, hosts, service);
}