@ylveracode/veracode-cli
Version:
a NodeJS based API wrapper for utilizing the Veracode APIs
18 lines (14 loc) • 587 B
text/typescript
import * as path from 'path';
import * as os from 'os';
import ConfigParser from 'configparser';
export function getLocalAuthorization (authProfile:string|undefined) {
if (!authProfile || authProfile===undefined) {
authProfile = 'default';
}
let veracodeCredsFile = path.join(os.homedir(), '.veracode', 'credentials');
let config = new ConfigParser();
config.read(veracodeCredsFile);
let id = config.get(authProfile, 'veracode_api_key_id');
let secret = config.get(authProfile, 'veracode_api_key_secret');
return {API_ID:id,SECRET:secret};
}