Comments (2)
Some of the browser tests are failing because Buffer.toString(<encoding>)
in the browser does not support base64url
encoding, although it does support base64
. I think this is because Babel polyfills using this package, which, as this issue points out, does not support base64url
. Maybe it has to do with the fact that the last release of this package was Nov 22, 2020, and the Node.js support for the base64url
encoding was added in August 2021.
from dwn-sdk-js.
> [email protected] test:browser
> cross-env BABEL_ENV=test karma start karma.conf.cjs
START:
30 03 2022 00:32:07.390:INFO [preprocessor.rollup]: Generating bundle for ./tests/interfaces/permissions/permission-tests.ts
30 03 2022 00:32:07.709:INFO [karma-server]: Karma v6.3.17 server started at http://localhost:9876/
30 03 2022 00:32:07.710:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
30 03 2022 00:32:07.713:INFO [launcher]: Starting browser ChromeHeadless
30 03 2022 00:32:08.126:INFO [Chrome Headless 99.0.4844.84 (Mac OS 10.15.7)]: Connected on socket hsphXG2iYbjYW9-6AAAB with id 15540964
Permission Tests
constructor
✖ throws an exception if expiration is in the past (skipped)
✖ throws an exception if expiration is before nbf (skipped)
toUnixEpochSeconds
✔ adds duration to the current time and returns that as a unix epoch timestamp
✖ converts a date to a unix epoch timestamp (skipped)
Message Tests
validateMessage
✖ throws exception if interface method isnt supported (skipped)
✖ throws exception if message is invalid relative to interface method (skipped)
verifyMessageSignature
✖ throws an exception if attestation property is missing (skipped)
✔ throws an exception if attestation payload is not a valid CID
✖ throws an exception if CID of descriptor !== attestation payload
✖ throws an exception if provided CID doesnt utilize cbor codec
✖ throws an exception if provided CID uses unsupported hashing algo
✖ throws an exception if DID could not be resolved
✖ throws an exception if appropriate key isnt present in DID Doc
✖ throws an exception if signature does not match
✖ resolves if signature is successfully verified
Finished in 0.031 secs / 0.015 secs @ 00:32:08 GMT-0500 (Central Daylight Time)
SUMMARY:
✔ 2 tests completed
ℹ 6 tests skipped
✖ 7 tests failed
FAILED TESTS:
Message Tests
verifyMessageSignature
✖ throws an exception if CID of descriptor !== attestation payload
Chrome Headless 99.0.4844.84 (Mac OS 10.15.7)
TypeError: Unknown encoding: base64url
at Uint8Array.slowToString (tests/message-tests.js:682:34)
at Uint8Array.toString (tests/message-tests.js:740:25)
at _callee2$ (tests/message-tests.ts:71:49 <- tests/message-tests.js:62116:55)
at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40 <- tests/message-tests.js:2101:42)
at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:294:22 <- tests/message-tests.js:2332:24)
at Generator.next (node_modules/regenerator-runtime/runtime.js:119:21 <- tests/message-tests.js:2157:23)
at asyncGeneratorStep (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:3:24 <- tests/message-tests.js:1978:26)
at _next (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:25:9 <- tests/message-tests.js:2000:11)
✖ throws an exception if provided CID doesnt utilize cbor codec
Chrome Headless 99.0.4844.84 (Mac OS 10.15.7)
TypeError: Unknown encoding: base64url
at Uint8Array.slowToString (tests/message-tests.js:682:34)
at Uint8Array.toString (tests/message-tests.js:740:25)
at _callee3$ (tests/message-tests.ts:120:49 <- tests/message-tests.js:62181:55)
at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40 <- tests/message-tests.js:2101:42)
at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:294:22 <- tests/message-tests.js:2332:24)
at Generator.next (node_modules/regenerator-runtime/runtime.js:119:21 <- tests/message-tests.js:2157:23)
at asyncGeneratorStep (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:3:24 <- tests/message-tests.js:1978:26)
at _next (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:25:9 <- tests/message-tests.js:2000:11)
✖ throws an exception if provided CID uses unsupported hashing algo
Chrome Headless 99.0.4844.84 (Mac OS 10.15.7)
TypeError: Unknown encoding: base64url
at Uint8Array.slowToString (tests/message-tests.js:682:34)
at Uint8Array.toString (tests/message-tests.js:740:25)
at _callee4$ (tests/message-tests.ts:154:49 <- tests/message-tests.js:62230:55)
at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40 <- tests/message-tests.js:2101:42)
at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:294:22 <- tests/message-tests.js:2332:24)
at Generator.next (node_modules/regenerator-runtime/runtime.js:119:21 <- tests/message-tests.js:2157:23)
at asyncGeneratorStep (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:3:24 <- tests/message-tests.js:1978:26)
at _next (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:25:9 <- tests/message-tests.js:2000:11)
✖ throws an exception if DID could not be resolved
Chrome Headless 99.0.4844.84 (Mac OS 10.15.7)
TypeError: Unknown encoding: base64url
at Uint8Array.slowToString (tests/message-tests.js:682:34)
at Uint8Array.toString (tests/message-tests.js:740:25)
at _callee5$ (tests/message-tests.ts:188:49 <- tests/message-tests.js:62280:55)
at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40 <- tests/message-tests.js:2101:42)
at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:294:22 <- tests/message-tests.js:2332:24)
at Generator.next (node_modules/regenerator-runtime/runtime.js:119:21 <- tests/message-tests.js:2157:23)
at asyncGeneratorStep (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:3:24 <- tests/message-tests.js:1978:26)
at _next (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:25:9 <- tests/message-tests.js:2000:11)
✖ throws an exception if appropriate key isnt present in DID Doc
Chrome Headless 99.0.4844.84 (Mac OS 10.15.7)
TypeError: Unknown encoding: base64url
at Uint8Array.slowToString (tests/message-tests.js:682:34)
at Uint8Array.toString (tests/message-tests.js:740:25)
at _callee6$ (tests/message-tests.ts:234:49 <- tests/message-tests.js:62342:55)
at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40 <- tests/message-tests.js:2101:42)
at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:294:22 <- tests/message-tests.js:2332:24)
at Generator.next (node_modules/regenerator-runtime/runtime.js:119:21 <- tests/message-tests.js:2157:23)
at asyncGeneratorStep (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:3:24 <- tests/message-tests.js:1978:26)
at _next (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:25:9 <- tests/message-tests.js:2000:11)
✖ throws an exception if signature does not match
Chrome Headless 99.0.4844.84 (Mac OS 10.15.7)
JOSENotSupported: Invalid or unsupported JWK "alg" (Algorithm) Parameter value
at generateKeyPair$1 (node_modules/jose/dist/browser/runtime/generate.js:127:19 <- tests/message-tests.js:36539:21)
at generateKeyPair (node_modules/jose/dist/browser/key/generate_key_pair.js:3:12 <- tests/message-tests.js:36545:14)
at _callee7$ (tests/message-tests.ts:283:32 <- tests/message-tests.js:62404:24)
at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40 <- tests/message-tests.js:2101:42)
at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:294:22 <- tests/message-tests.js:2332:24)
at Generator.next (node_modules/regenerator-runtime/runtime.js:119:21 <- tests/message-tests.js:2157:23)
at asyncGeneratorStep (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:3:24 <- tests/message-tests.js:1978:26)
at _next (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:25:9 <- tests/message-tests.js:2000:11)
✖ resolves if signature is successfully verified
Chrome Headless 99.0.4844.84 (Mac OS 10.15.7)
JOSENotSupported: Invalid or unsupported JWK "alg" (Algorithm) Parameter value
at generateKeyPair$1 (node_modules/jose/dist/browser/runtime/generate.js:127:19 <- tests/message-tests.js:36539:21)
at generateKeyPair (node_modules/jose/dist/browser/key/generate_key_pair.js:3:12 <- tests/message-tests.js:36545:14)
at _callee8$ (tests/message-tests.ts:340:32 <- tests/message-tests.js:62488:24)
at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40 <- tests/message-tests.js:2101:42)
at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:294:22 <- tests/message-tests.js:2332:24)
at Generator.next (node_modules/regenerator-runtime/runtime.js:119:21 <- tests/message-tests.js:2157:23)
at asyncGeneratorStep (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:3:24 <- tests/message-tests.js:1978:26)
at _next (node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:25:9 <- tests/message-tests.js:2000:11)
from dwn-sdk-js.
Related Issues (20)
- Replace built-in crypto library with `@web5/crypto`
- Change `update` verb in $actions to `coedit`, or something similar HOT 1
- JSON schema validation not called for `RecordsWrite`
- Update encryption scheme to support new `contextId` semantics
- Export all types that are referenced by all exported types
- Allow dataFormat to be modified HOT 1
- Investigate how descendent roles are handled
- Investigate upgrading `abstract-level` 2.0.0 HOT 1
- `RecordsWrite` with no data should return a 204 status code.
- Change the `can` property type in protocol definition schema to an array HOT 1
- Add `lowS: false` flag to secp256k1.ts `verify` HOT 1
- Revisit logic for deleting grant-authorized records when handling a permission revocation `RecordsWrite`
- `RecordsRead` should not fail if multiple values exist
- Implement a solution for Protocol versions HOT 1
- Consolidate HKDF implementation and usage with `web5-js`
- Confirm Protocol Role Security HOT 1
- Add general fail/persistence handling for restart-resilient features HOT 1
- RecordDelete is not being received in a subscription when it is expected
- Intermittent test failure in `resumable tasks` test HOT 1
- Add protocol-tagging index to `RecordsDelete` PermissionProtocol messages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dwn-sdk-js.