|
|
@ -38,10 +38,10 @@ export class OvhApi{
|
|
|
|
path,
|
|
|
|
path,
|
|
|
|
body={},
|
|
|
|
body={},
|
|
|
|
getMethod=rest=>rest.get,
|
|
|
|
getMethod=rest=>rest.get,
|
|
|
|
header={accept: 'json'}
|
|
|
|
header={accept: 'json'},
|
|
|
|
|
|
|
|
timestamp = (Date.now()/1000).toFixed()
|
|
|
|
}){
|
|
|
|
}){
|
|
|
|
if (!this.credentials.consumerKey) await this.getConsumerKey();
|
|
|
|
if (!this.credentials.consumerKey) await this.getConsumerKey();
|
|
|
|
let timestamp = await this.getApiTime();
|
|
|
|
|
|
|
|
header['X-Ovh-Timestamp'] = timestamp;
|
|
|
|
header['X-Ovh-Timestamp'] = timestamp;
|
|
|
|
header['X-Ovh-Signature'] = await this.getSignature({
|
|
|
|
header['X-Ovh-Signature'] = await this.getSignature({
|
|
|
|
method: getMethod(this.methods),
|
|
|
|
method: getMethod(this.methods),
|
|
|
|