Skip to content

Commit

Permalink
Merge pull request #4 from singpass/release/0.0.7
Browse files Browse the repository at this point in the history
Fix snyk finding and test stub data
  • Loading branch information
yuejun92 authored Aug 22, 2023
2 parents 1bddb42 + 4c924d9 commit 0e268d4
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 74 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.0.7 22 Aug 2023:

- Fix test stub data
- Update npm @cypress/request to @3.0.0

## 0.0.6 12 Jul 2023:

- Fix getRevokeStatus function to parseInt for statusListIndex if it is a String
Expand Down
87 changes: 70 additions & 17 deletions __tests__/stub/invalidVP.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,99 @@
{
"@context": ["https://www.w3.org/2018/credentials/v1"],
"id": "http://example.org/presentations/3731",
"id": "did:key:z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx#vp-15cfeb06-c893-4a88-b2fd-2c6122db69d7",
"type": ["VerifiablePresentation"],
"holder": "did:key:z6MkviRLMhsi2VDtFJENiMcbAb8zPBJGDz83catMyN7S2rgb",
"holder": "did:key:z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx",
"verifiableCredential": [
{
"@context": [
"https://w3id.org/security/bbs/v1",
"https://www.w3.org/2018/credentials/v1",
"https://stg.issuer.myinfo.gov.sg/myinfo/schema/ageover/v1",
"https://stg.issuer.myinfo.gov.sg/myinfo/schema/age/v1",
"https://w3id.org/vc/status-list/2021/v1"
],
"id": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/credentials/f5f19f68-3810-463f-8cdb-141aa48e4d4d",
"type": ["VerifiableCredential", "AgeOverCredential"],
"id": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/credentials/b2086515-619c-427c-b707-84f238764eac",
"type": ["VerifiableCredential", "AgeCredential"],
"issuer": "did:web:stg.issuer.myinfo.gov.sg:myinfo202304-01",
"credentialSubject": {
"AtLeast18YearsOld": "N",
"type": ["AgeOver"],
"id": "did:key:z6MkmbvZd3XHsdti7ofTQkw1tDi9y9rEM6n1pkDDraQ9xrYW"
"AtLeast18YearsOld": true,
"AtLeast21YearsOld": true,
"type": ["Age"],
"id": "did:key:z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx"
},
"name": "Age",
"description": "Age Over Indicators",
"expirationDate": "2025-08-21T06:51:34Z",
"credentialStatus": {
"id": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/status/1#9646",
"id": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/status/1#10267",
"type": "StatusList2021Entry",
"statusListIndex": "9646",
"statusListIndex": "10267",
"statusListCredential": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/status/1"
},
"issuanceDate": "2023-07-12T06:04:47Z",
"issuanceDate": "2023-08-21T07:05:15Z",
"proof": {
"created": "2023-07-12T06:04:47Z",
"created": "2023-08-21T07:05:15Z",
"proofPurpose": "assertionMethod",
"verificationMethod": "did:web:stg.issuer.myinfo.gov.sg:myinfo202304-01#21402a47-6416-4b95-b180-dff0e1f44d67",
"type": "BbsBlsSignatureProof2020",
"nonce": "jFH5GUADdg8igfuB6d4akCjIjPu815MNV2aBdzvdBhA=n",
"proofValue": "ABAA/7+L2u2nQCsPXmYde/7kDY494twd2AzECtzE+td28DrFC5o/ApGVGOZKdmR2lT8Vnwik1AeKnjME1DL9V6ZoLxqwRpKf0t/7Jj1zB2TX3S0a/lgdOrYNjF/mIKlZweHgr4UGqTqtK1sJMp/b0yR+znBOgVpyjOkdd1pMjP9P120/T3WAPuXrO0CYhuoFIZOwPQm5EAAAB0jT9KXaW4htzP3hTtoPbelCNMn8bt+7e+dnB1b0OQG97xYMwPFj+w8651uKxhu8nRUAAAAAgoEcB2TFKbGSCk3RwPXMcXMVeg84mKHnWmzBTJ86vYWoBXEJaI19y0ji3YKk4Dt8M4LzY2y9cR9RJzHxY0RKcwKWTGdXvYsQpsGMZ5wdbo19njWISewU/M8GSOAnYFFwbTlLz+tJDMJIe+k7IcoNJxeIAAAADEsYkRDoARh2XqfvsOF+H0fT+I+SEn8s5J7TsCdtRwQHcGV/MrFBM63XQkexbXyfzOcAcQnTCc8v23tjjfD/dL50L7SMB37/h20GBZ9H0YnZpE+TMK4LwiFkd1UXQST1swan"
"nonce": "KIr/YTYd9HGtHoHe4Nms3PjhxtjiW+xhVYrTcDgOqoc=",
"proofValue": "ABMH//+jbjXQAjbCiOj5Oh6lxFnP45WC4N675Xe8abpOzdN5h1zhxkFlNbas965ep5fqHIG3JGWmlaAe7jL9RqNHNSi5vPaOcnjIu0zHZA4dT9z98viovnPQG8GRoQWNCQllxS+lzW0ucRHG9ruNApHzOv+ESkoPU4/tBbZtm9HPQ8u00N/edXHC7HtkVSJzXSfFwe4AAAB0s+hWBhiH7v3AMi36Is6MvOHz55ZK5l9c8cjbkBqAXl0qt+mh5IACj7wlAeMgCNc8AAAAAhyzTjmFL9cRSLUkXsBAAGbdpZrQqDC1ehc35uonjj8SQv/JgYhlzO/c3e9JMWMj1GuMESzO/H2Slq22d/jFxwyPgKGEQ4I7S7sDrELuIsj3oINYz2e10uOBfDeSPCeAxGhcyG3Myy1mxRFwH50beHUAAAACPPmYj1uOXKtJAlu+FIt3J6q3ibYJ9+rcFXVPapwI8lQqPF7cpSwAE6A9kZbazXH46NkUV1KKec4Uz2l2wLagAg=="
}
},
{
"@context": [
"https://w3id.org/security/bbs/v1",
"https://www.w3.org/2018/credentials/v1",
"https://stg.issuer.myinfo.gov.sg/myinfo/schema/personal/v1",
"https://w3id.org/vc/status-list/2021/v1"
],
"id": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/credentials/0ba368dd-f58a-4455-846f-365382ade416",
"type": ["VerifiableCredential", "PersonalCredential"],
"issuer": "did:web:stg.issuer.myinfo.gov.sg:myinfo202304-01",
"credentialSubject": {
"uinfin": "S8703396A",
"name": "User S8703396A",
"aliasname": "",
"hanyupinyinname": "",
"hanyupinyinaliasname": "",
"marriedname": "",
"sex": "MALE",
"race": "AMERICAN",
"dob": "1990-04-19",
"residentialstatus": "CITIZEN",
"nationality": "GUINEAN",
"birthcountry": "UNITED STATES",
"regadd": {
"country": "SINGAPORE",
"postal": "609774"
},
"type": ["Personal"],
"id": "did:key:z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx"
},
"name": "Personal",
"description": "Basic Details of Personal Profile1",
"expirationDate": "2025-08-21T06:51:34Z",
"credentialStatus": {
"id": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/status/1#10268",
"type": "StatusList2021Entry",
"statusListIndex": "10268",
"statusListCredential": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/status/1"
},
"issuanceDate": "2023-08-21T07:05:20Z",
"proof": {
"created": "2023-08-21T07:05:20Z",
"proofPurpose": "assertionMethod",
"verificationMethod": "did:web:stg.issuer.myinfo.gov.sg:myinfo202304-01#21402a47-6416-4b95-b180-dff0e1f44d67",
"type": "BbsBlsSignatureProof2020",
"nonce": "MfQWYAz9Ha+3ygEUmhlOkmdnAHyiskxvTI7Fc2fT2ac=",
"proofValue": "ACoAp//8fP+Y9rrEm2me6HlQOHtU7A1g6cR6Bvx31BXV4fbHtYFhhN1fTszqrlGwvERxYUTW8+eMJxa+7lmdfO3qXchUAQDHM/yiw8Tmy6bi4xnr/2WJCgmf/2GXWSEiOHrRRD0xgD2qlej+qs/X9v+VJ1vJxQMYaXUmTel5Zl9IZ8M3/F/oJ9tY+41MBa1gNkF/wKljshwAAAB0qkEdjkws3IUCtxdrNszurU0fzkoL2ataW/reLCMLHjtEqAuFEPO4JHOCPfYdlm0DAAAAAkp9+vIiTC4uvkIEIHHhVf2KZk1jtbo+U0poBHlOwzoNESJH1Q+70PdcEjIEWVfUGEBz0rAQinE6ueI6OQ10AjSRJvL/zjzpfzX7nLvXsK8UfmHkR2HHCaVF6kSRSsdkzNNycBdlenGE1Wy7jTac7NUAAAAMYJ2Y1euh+HilfjQjgl3gMKHAQBUmUg6Dy6TUaBYab8UP1/LGyOwRWveiPZcJJadp5sIeZsfrAZZ2hSVL6DMDoWsLqKn2BkKJpUhSgaMtPcwdE7PhGst/GPWk/kTgJzNfHnI5w3xFUM0mvhM8guSKY+xK9Bs/rTXTItiM/+k8K9ZS3jmsE3JhgKs+xmLQYX29AeVUJGHOLhWE2yqXnCUE/lJ2te5o2FvDh9VPm/4EwpZY4R0SF1esqW0MlCjle657Q6AvK+sGO73ECxxilTP3SCXnLFSMrn/2ov1c6mA9iL5Yo/p8CwP731mTLd+3vUVZTreK87WVmlQuAMQA5Lm3PyPGDEeAIBlbpdVyZs6w8hlOAYzMHXj5wyrNNf5Pbz/lXNxtZhH99jAdGyL+SQU0RiUiz7mV9kTlcLRQxqocQhhwevc1PkF8O2Y8gdLlGXR+NiHEOX39hvY0E2BccpnnmzOnTNUZOGCORU7CsZDz1YdkKCrFpFy7w6blF5D99saq"
}
}
],
"proof": {
"type": "Ed25519Signature2018",
"created": "2023-07-12T07:29:48Z",
"created": "2023-08-22T06:47:00Z",
"proofPurpose": "assertionMethod",
"verificationMethod": "did:key:z6MkviRLMhsi2VDtFJENiMcbAb8zPBJGDz83catMyN7S2rgb#z6MkviRLMhsi2VDtFJENiMcbAb8zPBJGDz83catMyN7S2rgb",
"jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFZERTQSJ9..6MVcOV40KpeAJk_rm9R3YogNM4ae1CjYBEvIpdzshF_meCS_HnZ_JGLkDo96USAy712J-vMKRYUjIGOMX1s_AA"
"verificationMethod": "did:key:z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx#z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx",
"jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFZERTQSJ9..pTydH1ytitQ_FiblmcgsqZC0vxjNp-GpQNbruCO9d9dPC1xUGYoWjitAv0St8zyJgmJ_aFcvXnGuAANIaZJGCw"
}
}
16 changes: 8 additions & 8 deletions __tests__/stub/resultPresentation2018.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
"proof": {
"@context": "https://w3id.org/security/v2",
"type": "Ed25519Signature2018",
"created": "2023-07-12T09:13:45Z",
"jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFZERTQSJ9..-9UOZ1jVRQBq9xPqY6FjPCR_ORMXCSohGV6-rH2WPnIrSAXlPQmAMoDCyvVGg_DvOm_HnBlRKbxKtzseFyJqAw",
"created": "2023-08-22T06:47:00Z",
"jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFZERTQSJ9..pTydH1ytitQ_FiblmcgsqZC0vxjNp-GpQNbruCO9d9dPC1xUGYoWjitAv0St8zyJgmJ_aFcvXnGuAANIaZJGCw",
"proofPurpose": "assertionMethod",
"verificationMethod": "did:key:z6MkjKd2Kxfec5tG8zzDyLdQjE5veLboL3uaxJHFp2NdA1gi#z6MkjKd2Kxfec5tG8zzDyLdQjE5veLboL3uaxJHFp2NdA1gi"
"verificationMethod": "did:key:z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx#z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx"
},
"verified": true,
"purposeResult": {
"valid": true,
"controller": {
"@context": "https://w3id.org/security/v2",
"id": "did:key:z6MkjKd2Kxfec5tG8zzDyLdQjE5veLboL3uaxJHFp2NdA1gi",
"id": "did:key:z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx",
"assertionMethod": [
"did:key:z6MkjKd2Kxfec5tG8zzDyLdQjE5veLboL3uaxJHFp2NdA1gi#z6MkjKd2Kxfec5tG8zzDyLdQjE5veLboL3uaxJHFp2NdA1gi"
"did:key:z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx#z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx"
],
"verificationMethod": {
"id": "did:key:z6MkjKd2Kxfec5tG8zzDyLdQjE5veLboL3uaxJHFp2NdA1gi#z6MkjKd2Kxfec5tG8zzDyLdQjE5veLboL3uaxJHFp2NdA1gi",
"type": "Ed25519VerificationKey2018",
"controller": "did:key:z6MkjKd2Kxfec5tG8zzDyLdQjE5veLboL3uaxJHFp2NdA1gi",
"publicKeyBase58": "5sMyjiRDGYPo2W9XHmfZt8XvpmKwvAfEGHNKykQcEnuL"
"controller": "did:key:z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx",
"id": "did:key:z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx#z6MkfJVf63AcEoiL9CJJ2r76eZL3dS9QugWk5cDWCYp9raYx",
"publicKeyBase58": "rEcVnvAuGDs2hTbMH9FoTn3orsZVoGPPbJaNGr8wMma"
}
}
}
Expand Down
39 changes: 20 additions & 19 deletions __tests__/stub/signedSelectiveDisclosedVC.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@
"@context": [
"https://w3id.org/security/bbs/v1",
"https://www.w3.org/2018/credentials/v1",
"https://stg.issuer.myinfo.gov.sg/myinfo/schema/ageover/v1",
"https://stg.issuer.myinfo.gov.sg/myinfo/schema/age/v1",
"https://w3id.org/vc/status-list/2021/v1"
],
"id": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/credentials/a8a0545b-768f-40eb-87e8-346476bf6dfd",
"type": ["AgeOverCredential", "VerifiableCredential"],
"description": "Sample of Age Over Credential",
"name": "Age Over Credential",
"id": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/credentials/78f3b60c-7411-41eb-9345-24167d9a93c4",
"type": ["VerifiableCredential", "AgeCredential"],
"issuer": "did:web:stg.issuer.myinfo.gov.sg:myinfo202304-01",
"credentialSubject": {
"AtLeast18YearsOld": true,
"AtLeast21YearsOld": true,
"type": ["Age"],
"id": "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL"
},
"name": "Age",
"description": "Age Over Indicators",
"expirationDate": "1970-01-21T06:54:46Z",
"credentialStatus": {
"id": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/status/1#9579",
"id": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/status/1#10271",
"type": "StatusList2021Entry",
"statusListCredential": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/status/1",
"statusListIndex": "9579"
"statusListIndex": "10271",
"statusListCredential": "https://stg.issuer.myinfo.gov.sg/myinfo202304-01/status/1"
},
"credentialSubject": {
"id": "did:key:z6MkndAHigYrXNpape7jgaC7jHiWwxzB3chuKUGXJg2b5RSj",
"type": "AgeOver",
"AtLeast21YearsOld": "Y"
},
"issuanceDate": "2023-07-11T07:02:08Z",
"issuer": "did:web:stg.issuer.myinfo.gov.sg:myinfo202304-01",
"issuanceDate": "2023-08-21T07:49:35Z",
"proof": {
"type": "BbsBlsSignatureProof2020",
"created": "2023-07-11T07:02:08Z",
"nonce": "iD6nH/oIk8gcg9NCe7eRFN6gmqbt0ctZx4RI0TGK4UJkr1RLHnq5Wa1B6mT4vzDFTLs=",
"type": "BbsBlsSignature2020",
"created": "2023-08-21T07:49:35Z",
"proofPurpose": "assertionMethod",
"proofValue": "ABID/9+Br8GZYx2dh+QUvv1UTklrlqmFTS8c6kUtrrPWXZdAfqqv5qGs/aZDfGLkcs2Q5sCI6OKIdJzq7yDh8anKd4p1NO+L2LTHpV1El4Ng5SGxCbUxvCyAgaJa7Y8fgVlBFxSz+pz64ccisqCcRJEk3bS+4wLZ0evpsDMGZXbE4StMoDdHX4zOlGhoEPup329Hc8YAAAB0g/3iHtBeFCRgiww4JZ8gr3jEPnZTwYN7zSUfblPJGJFtEJ9cPA5RiiavNTuIK2WxAAAAAkqYiv29pCFxd2UQY+hFOs1hN053fIFadTyN5r2/Jb66VItDhtzI+piZ+TCzwiVPbMir935IRyrTDoHsA5MqvlCQTBtJ6tQpu+CXbVeqwK0JLRiFdxUlCh8tYm4MmWPZxxDSWPoSvW8HHg7IWswbwJkAAAADDnpdbKIwCgOxaMsr1cfkOit6Ohacg50iMkCwdxxRmtMYm9S4qWIZSvJxvQNHabukpqF7AHirvveODHRwaxXWc0bZm6PNyAotr6BRh1jDZE5ryNgW79ZuA3MfUT7q5ozf",
"proofValue": "tm69iIYQ5R6uRALgYcDcmMiG6rSwkvYUnAf0aHk90w31YksGOJHkHMGZcRUp3oSaYUHlKfzccE4m7waZyoLEkBLFiK2g54Q2i+CdtYBgDdkUDsoULSBMcH1MwGHwdjfXpldFNFrHFx/IAvLVniyeMQ==",
"verificationMethod": "did:web:stg.issuer.myinfo.gov.sg:myinfo202304-01#21402a47-6416-4b95-b180-dff0e1f44d67"
}
}
Loading

0 comments on commit 0e268d4

Please sign in to comment.