export const getServiceKey = async ({ console, fs, path }) => {
    let serviceKey;
    if (path.startsWith('{')) {
        console.debug('Getting service key from JSON string');
        serviceKey = JSON.parse(path);
    } else {
        console.debug('Getting service key from file ' + path);
        serviceKey = JSON.parse(await fs.readFile(path, 'utf8'));
    }
    if (serviceKey.hasOwnProperty('credentials')) {
        console.debug('Unwrapping service key credentials');
        serviceKey = serviceKey.credentials;
    }
    return serviceKey;
};
