Giter VIP home page Giter VIP logo

Comments (2)

cwarny avatar cwarny commented on September 28, 2024 1

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.

mistermoe avatar mistermoe commented on September 28, 2024
> [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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.