Skip to content

Commit 897c0e2

Browse files
committed
update passport iam
1 parent 1529d0c commit 897c0e2

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

packages/common/src/services/passport/credentialVerifier.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export class PassportVerifierWithExpiration {
4040
// const { expirationDate, proof } = credential;
4141
const { proof } = credential;
4242

43+
console.log("proof", proof);
44+
4345
// check that the credential is still valid (not expired)
4446
// if (new Date(expirationDate) > new Date()) {
4547
try {
@@ -51,6 +53,9 @@ export class PassportVerifierWithExpiration {
5153
)
5254
) as { checks: string[]; warnings: string[]; errors: string[] };
5355

56+
console.log("verify", verify);
57+
console.log("verify.errors", verify.errors.length === 0);
58+
5459
// did we get any errors when we attempted to verify?
5560
return verify.errors.length === 0;
5661
} catch (e) {

packages/common/src/services/passport/passportCredentials.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { VerifiableCredential } from "@gitcoinco/passport-sdk-types";
55
import { debounce } from "ts-debounce";
66
import { PassportVerifierWithExpiration } from "./credentialVerifier";
77

8-
const IAM_SERVER =
9-
process.env.REACT_APP_PASSPORT_IAM_SERVER ||
10-
"did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC";
8+
const IAM_SERVER = [
9+
"did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC",
10+
"did:ethr:0xd6f8d6ca86aa01e551a311d670a0d1bd8577e5fb",
11+
];
1112

1213
const verifier = new PassportVerifierWithExpiration();
1314

@@ -24,7 +25,7 @@ export async function validateCredential(
2425
handle.toLowerCase();
2526
const validCredential = await verifier.verifyCredential(credential);
2627

27-
const validIssuer = IAM_SERVER === credential.issuer;
28+
const validIssuer = IAM_SERVER.includes(credential.issuer);
2829

2930
return validCredentialProvider && validCredential && validIssuer;
3031
}

packages/round-manager/src/features/round/ViewApplicationPage.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ import { convertApplications } from "../api/utils";
7474

7575
type Status = "done" | "current" | "rejected" | "approved" | undefined;
7676

77-
export const IAM_SERVER =
78-
"did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC";
77+
export const IAM_SERVER = [
78+
"did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC",
79+
"did:ethr:0xd6f8d6ca86aa01e551a311d670a0d1bd8577e5fb",
80+
];
7981

8082
const verifier = new PassportVerifierWithExpiration();
8183

@@ -927,7 +929,9 @@ async function isVerified(
927929
application: GrantApplication | undefined
928930
) {
929931
const vcHasValidProof = await verifier.verifyCredential(verifiableCredential);
930-
const vcIssuedByValidIAMServer = verifiableCredential.issuer === IAM_SERVER;
932+
const vcIssuedByValidIAMServer = IAM_SERVER.includes(
933+
verifiableCredential.issuer
934+
);
931935
const providerMatchesProject = vcProviderMatchesProject(
932936
provider,
933937
verifiableCredential,

0 commit comments

Comments
 (0)