Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,37 +33,37 @@
"zxcvbn": "^4.4.2"
},
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/core": "^7.12.10",
"@babel/eslint-parser": "^7.12.1",
"@babel/eslint-plugin": "^7.12.1",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/preset-react": "^7.12.1",
"@babel/register": "^7.12.1",
"@peculiar/webcrypto": "^1.1.3",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"@babel/register": "^7.12.10",
"@peculiar/webcrypto": "^1.1.4",
"@rails/webpacker": "^5.2.1",
"@testing-library/dom": "^7.28.0",
"@testing-library/react": "^11.2.1",
"@testing-library/react-hooks": "^3.4.2",
"@testing-library/user-event": "^12.2.2",
"@types/react": "^16.9.56",
"chai": "^3.5.0",
"dirty-chai": "^1.2.2",
"eslint": "^7.6.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"@testing-library/dom": "^7.29.0",
"@testing-library/react": "^11.2.2",
"@testing-library/react-hooks": "^3.7.0",
"@testing-library/user-event": "^12.6.0",
"@types/react": "^17.0.0",
"chai": "^4.2.0",
"dirty-chai": "^2.0.1",
"eslint": "^7.16.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"jsdom": "^16.2.2",
"mocha": "^8.1.3",
"jsdom": "^16.4.0",
"mocha": "^8.2.1",
"postcss-clean": "^1.1.0",
"prettier": "^2.0.5",
"prettier": "^2.2.1",
"react-test-renderer": "^17.0.1",
"sinon": "^9.0.2",
"source-map-loader": "^1.1.0",
"typescript": "^4.1.2",
"sinon": "^9.2.2",
"source-map-loader": "^1.1.3",
"typescript": "^4.1.3",
"webpack-dev-server": "^3.11.0"
}
}
13 changes: 5 additions & 8 deletions spec/javascripts/app/webauthn_spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { TextEncoder } from 'util';
import * as WebAuthn from '../../../app/javascript/app/webauthn';

describe('WebAuthn', () => {
Expand Down Expand Up @@ -70,13 +71,11 @@ describe('WebAuthn', () => {
},
excludeCredentials: [
{
// encodes to 'credential123'
id: Buffer.from([114, 183, 157, 122, 123, 98, 106, 93, 118]).buffer,
Copy link
Contributor Author

@aduth aduth Dec 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this was always broken, since the buffer here is not actually "credential123", it's "credential12":

window.btoa(String.fromCharCode(...new Uint8Array([114, 183, 157, 122, 123, 98, 106, 93, 118])))
// "credential12"

This is clearer anyways.

This became a failure in upgrading chai, likely related to release notes concerning deep equality revisions.

id: new TextEncoder().encode('credential123').buffer,
type: 'public-key',
},
{
// encodes to 'credential456'
id: Buffer.from([114, 183, 157, 122, 123, 98, 106, 94, 57]).buffer,
id: new TextEncoder().encode('credential456').buffer,
type: 'public-key',
},
],
Expand Down Expand Up @@ -151,13 +150,11 @@ describe('WebAuthn', () => {
rpId: 'example.test',
allowCredentials: [
{
// encodes to 'credential123'
id: Buffer.from([114, 183, 157, 122, 123, 98, 106, 93, 118]).buffer,
id: new TextEncoder().encode('credential123').buffer,
type: 'public-key',
},
{
// encodes to 'credential456'
id: Buffer.from([114, 183, 157, 122, 123, 98, 106, 94, 57]).buffer,
id: new TextEncoder().encode('credential456').buffer,
type: 'public-key',
},
],
Expand Down
Loading