@learncard/learn-card-plugin 1.2.28 → 1.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,EAAE,EACF,iBAAiB,EACjB,gBAAgB,EAEnB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAqIxD,eAAO,MAAM,gBAAgB,cACd,SAAS,CAChB,GAAG,EACH,GAAG,EACH;IACI,gBAAgB,EAAE,CACd,UAAU,EAAE,EAAE,EACd,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,KAC9B,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACnC,CACJ,KACF,CAAC,CACA,UAAU,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACpC,UAAU,EAAE,EAAE,EACd,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,EAC/B,QAAQ,CAAC,EAAE,OAAO,KACjB,OAAO,CAAC,gBAAgB,EAAE,GAAG,iBAAiB,CAAC,CAkCnD,CAAC"}
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,EAAE,EACF,iBAAiB,EACjB,gBAAgB,EAEnB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AA0IxD,eAAO,MAAM,gBAAgB,cACd,SAAS,CAChB,GAAG,EACH,GAAG,EACH;IACI,gBAAgB,EAAE,CACd,UAAU,EAAE,EAAE,EACd,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,KAC9B,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACnC,CACJ,KACF,CAAC,CACA,UAAU,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACpC,UAAU,EAAE,EAAE,EACd,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,EAC/B,QAAQ,CAAC,EAAE,OAAO,KACjB,OAAO,CAAC,gBAAgB,EAAE,GAAG,iBAAiB,CAAC,CAkCnD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@learncard/learn-card-plugin",
3
- "version": "1.2.28",
3
+ "version": "1.2.30",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -51,9 +51,9 @@
51
51
  },
52
52
  "types": "./dist/index.d.ts",
53
53
  "dependencies": {
54
- "@learncard/core": "9.4.28",
55
- "@learncard/didkit-plugin": "^1.9.8",
56
- "@learncard/types": "5.18.0",
54
+ "@learncard/core": "9.4.30",
55
+ "@learncard/didkit-plugin": "^1.9.10",
56
+ "@learncard/types": "5.18.1",
57
57
  "date-fns": "^2.28.0"
58
58
  },
59
59
  "sideEffects": false
@@ -115,4 +115,25 @@ describe('verifyCredential prettify', () => {
115
115
  },
116
116
  ]);
117
117
  });
118
+
119
+ it('formats unchecked URL issuer authorization with a concise error label', async () => {
120
+ const warning =
121
+ 'Issuer authorization was not checked because the credential issuer is not a DID';
122
+
123
+ await expect(
124
+ prettify({
125
+ checks: ['proof'],
126
+ warnings: [warning],
127
+ errors: [],
128
+ })
129
+ ).resolves.toEqual(
130
+ expect.arrayContaining([
131
+ {
132
+ status: VerificationStatusEnum.Error,
133
+ check: 'Issuer Authorization',
134
+ message: warning,
135
+ },
136
+ ])
137
+ );
138
+ });
118
139
  });
package/src/verify.ts CHANGED
@@ -113,7 +113,12 @@ const transformErrorMessage = (
113
113
  return error;
114
114
  };
115
115
 
116
+ const NON_DID_ISSUER_WARNING =
117
+ 'Issuer authorization was not checked because the credential issuer is not a DID';
118
+
116
119
  const transformWarningCheck = (warning: string, _credential: VC): string => {
120
+ if (warning === NON_DID_ISSUER_WARNING) return 'Issuer Authorization';
121
+
117
122
  if (warning.includes('Boost Authenticity')) return 'Boost Authenticity';
118
123
 
119
124
  const prefix = warning.split(' warning')[0];