Skip to content

Commit

Permalink
Merge pull request #2652 from SelfKeyFoundation/release
Browse files Browse the repository at this point in the history
Release 1.9.17
  • Loading branch information
andregoncalves authored Nov 26, 2021
2 parents 09bc9a6 + 9bbd11f commit 59f7254
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 35 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "selfkey-identity-wallet",
"productName": "SelfKey Identity Wallet",
"version": "1.9.16",
"version": "1.9.17",
"description": "The Official SelfKey Identity Wallet for Desktop",
"browser": [
"chrome"
Expand Down
72 changes: 51 additions & 21 deletions src/main/platform/relying-party.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ export class RelyingPartyRest {
static getAuthorizationHeader(token) {
return `Bearer ${token}`;
}
static isSecure(url) {
if (
url.startsWith('https://credentials.keyfi.com') ||
url.startsWith('https://korporatio.instance.kyc-chain.com')
) {
return false;
}
return true;
}
static async getChallenge(ctx) {
let url = ctx.getEndpoint(CHALLENGE_ENDPOINT_NAME);
const did = ctx.supportsDID()
Expand All @@ -133,7 +142,8 @@ export class RelyingPartyRest {
return request.get({
url,
headers: { 'User-Agent': this.userAgent, Origin: ctx.getOrigin() },
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}
static postChallengeReply(ctx, challenge, signature, keyId) {
Expand All @@ -154,7 +164,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}
static getUserToken(ctx, meta) {
Expand All @@ -173,7 +184,8 @@ export class RelyingPartyRest {
Origin: ctx.getOrigin()
},
qs,
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}
static async uploadUserFile(ctx, doc) {
Expand All @@ -196,7 +208,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}
static async createUser(ctx, attributes, documents = [], meta = {}) {
Expand All @@ -211,7 +224,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}
let formData = documents.reduce((acc, curr) => {
Expand Down Expand Up @@ -252,7 +266,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}
static getKYCTemplate(ctx, id) {
Expand All @@ -265,7 +280,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}

Expand Down Expand Up @@ -295,7 +311,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
})
);
}
Expand All @@ -312,7 +329,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}

Expand Down Expand Up @@ -341,7 +359,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}

Expand All @@ -359,7 +378,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}
static updateKYCApplicationPayment(ctx, applicationId, transactionHash) {
Expand All @@ -375,7 +395,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}

Expand All @@ -389,7 +410,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
return chatResponse;
}
Expand All @@ -406,7 +428,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}

Expand All @@ -429,7 +452,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}

Expand All @@ -445,7 +469,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
return applications;
} catch (error) {
Expand All @@ -467,7 +492,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
return user;
} catch (error) {
Expand All @@ -489,7 +515,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}

Expand All @@ -504,7 +531,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}

Expand All @@ -528,7 +556,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}
static getAccessToken(ctx) {
Expand All @@ -541,7 +570,8 @@ export class RelyingPartyRest {
'User-Agent': this.userAgent,
Origin: ctx.getOrigin()
},
json: true
json: true,
rejectUnauthorized: this.isSecure(url)
});
}
}
Expand Down
Loading

0 comments on commit 59f7254

Please sign in to comment.