{"_id":"@artifact-project/webauthn","_rev":"3-a2128f7534ae52c9684fc5136d68debf","name":"@artifact-project/webauthn","dist-tags":{"latest":"1.0.0-rc.2"},"versions":{"0.2.1":{"name":"@artifact-project/webauthn","version":"0.2.1","description":"WebAuthn — A set of tools for building an API and interacts with","keywords":["webauthn","security","authorization"],"author":{"name":"RubaXa","email":"ibn@rubaxa.org"},"license":"MIT","main":"webauthn.js","scripts":{"test":"jest --coverage","ts-build":"tsc","git-clean":"git clean -f","prepublish":"npm run test && npm run ts-build","postpublish":"npm run git-clean"},"devDependencies":{"@types/jest":"^24.0.15","jest":"^24.8.0","ts-jest":"^24.0.2","typescript":"^3.5.3"},"dependencies":{"@types/webappsec-credential-management":">=0.4.1"},"jest":{"transform":{"^.+\\.tsx?$":"ts-jest"},"testRegex":"\\.tests\\.ts$","transformIgnorePatterns":[],"setupFilesAfterEnv":["<rootDir>/__jest__/extensions.ts"],"moduleFileExtensions":["ts","tsx","js","json"]},"gitHead":"a25249c565aec1736a90acc746d32eb1409078e9","_id":"@artifact-project/webauthn@0.2.1","_nodeVersion":"11.1.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9rChJJsSZ6S6AeRWo0iheSy0yO9LHF/FYKEdZCipx3hx32enHTSlJmxo6gpftaw4DQczyDlqq0DQHD2E5srKTg==","shasum":"2e9fd28de45762757f5b13da051f6c0268a5284b","tarball":"https://registry.npmjs.org/@artifact-project/webauthn/-/webauthn-0.2.1.tgz","fileCount":6,"unpackedSize":21070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLDHaCRA9TVsSAnZWagAAYesQAI+eQS1CJbW9rp6wc1Qe\np7GSq0BGUtR+2QLc51GfoY+XXt9WkH6ofdavwzm5lJ3HaRl8C3MMV3IqphZ2\nK/vkeUDqWY7YGK4lA8ff0c7evfbomsZsRS+2YcNqQ/pWYGoCm/8Tdtd7S9Iy\nT63du9DggF+i0oLri1NsX2pAhlJzU/0rB/TP7ng3ZLY400zMAD0EJ+jmudSM\n60FR/CI1uMsaRLemuH824h1BprTiCCEE9q8rordkh0arnNSEOl2/p8PvXqP+\npNSjm14xYevdF6yBsVqsMLdelJtqb4a6mwN6bWv5vYv9byKozNZZ2dJCUZ3U\nlIf7T4tsoCDhBaU4XYfL1+aNUY0CfQa15hgkLLb1GAVLYJrC34WClZacrjHK\nOzxQVDVfA5bfbJMJuMtQfY6T4Lg6/ovlKD7K9JLtLWQ1RXVzGY/2D1+mSt9u\ntplCIzHwprmoGGmwaWiQ7eAig0mOmJAr+TVtySMaefvuuwzZlqW9yhdKg0PT\n3rk5mjKwVojX+6P6N3R1Zu36HVckmRQ90RuTzLAM2r6CSTVh4qfpjkKVbfXz\n6YxCmhO5hQ/8i9A2hrf3YKC/+Qm7xlU6p4A2TepUsol7ilVSnNcSRPdtOqoT\nQkI5wVZvEHqvs6twz87WPbLvNFu8KIWvXxebwGbHOWuYagd0z8RYb+i4q83S\nt7W2\r\n=YORf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEw9ZwprLBOt2/2f/uBlaG0xhqemtEgnIDCwrdZ8KLnjAiAuGz1TaX+yXjnuBB03DBZNfya5YU3mmH9SNSfU5fSslA=="}]},"maintainers":[{"name":"rubaxa","email":"ibnRubaXa@gmail.com"}],"_npmUser":{"name":"rubaxa","email":"ibnRubaXa@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webauthn_0.2.1_1563177433396_0.20501720528345135"},"_hasShrinkwrap":false},"1.0.0-rc.1":{"name":"@artifact-project/webauthn","version":"1.0.0-rc.1","description":"WebAuthn — A set of tools for building an API and interacts with","keywords":["webauthn","security","authorization"],"author":{"name":"RubaXa","email":"ibn@rubaxa.org"},"license":"MIT","main":"webauthn.js","scripts":{"test":"jest --coverage","start":"npm test -- --watchAll","build":"rollup --config && npm run dts-build","build-clean":"npm run ts-build-clean","git-clean":"git cliean -fd","dts-build":"dts-bundle-generator -o webauthn.d.ts webauthn.ts","dts-build-webauthn":"npm run dts-build-webauthn && npm run dts-build-allow","dts-build-allow":"dts-bundle-generator -o allow.d.ts allow.ts","prepublishOnly":"npm run test && npm run build","postpublish":"echo 'npm run git-clean?\n';"},"devDependencies":{"@types/jest":"^24.0.23","@types/node":"^12.12.14","dts-bundle-generator":"^3.3.1","jest":"^24.9.0","rimraf":"^3.0.0","rollup":"^1.27.5","rollup-plugin-replace":"^2.2.0","rollup-plugin-typescript2":"^0.25.2","rollup-plugin-uglify":"^6.0.3","ts-jest":"^24.2.0","typescript":"^3.7.2","uglify-js":"^3.7.1"},"dependencies":{"@types/webappsec-credential-management":"^0.5.1"},"jest":{"transform":{"^.+\\.tsx?$":"ts-jest"},"testRegex":"\\.tests\\.ts$","transformIgnorePatterns":[],"setupFilesAfterEnv":["<rootDir>/__jest__/extensions.ts"],"moduleFileExtensions":["ts","tsx","js","json"]},"gitHead":"ee5c0710817b245d6fb3bbb7e7ddca3e68cabe72","_id":"@artifact-project/webauthn@1.0.0-rc.1","_nodeVersion":"11.1.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-vXf7u7CARKfJ9JTXTSghlMyxGCLS9kqs/moXZX46CuWfVfCNyktYhTQitX7Jvg9Yx6PmlsIQjkocF8bCkJMp6Q==","shasum":"b70e79a52db0a122a43b12c0d83b73d3ad43a4c4","tarball":"https://registry.npmjs.org/@artifact-project/webauthn/-/webauthn-1.0.0-rc.1.tgz","fileCount":9,"unpackedSize":39607,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd4jP8CRA9TVsSAnZWagAA7IMP/00ASCCpFSQFPPg2dm0D\nW/haRf760H88vpIRlnabcwi82REtfLoi3r5tsfsPBXF7IRNrkrN3T5tsta2v\nDZTV+RJP461438kFVL65goHTPMJB9NQQYZdnHW8GsaWW9msiwq9XvqPiBoW4\nby6z6buekzA84kC4y/BIpdim+3BRWWrmy9NT0J+2IY2ze52KzUjO3RSsqmlE\nxMHbFCskm1SrumYEzQMPMqbY9k927eplflsKNXY1kQf2cov6i+dYGPt3Wb6H\n82ioEo3dYjb2kZcSUsYMJIFb9/jBpkMThV5BUeoUnk3D1DviGD1m6G2uqQlp\nQCQvqBikCyOmJiscKFp8QMgBi7Ji/Q/HL4s/NhGXiVCy248h0QTnMvg8FWIe\nlruecoArS6ZaNcDM21DI8zeaeuouRKNh8cIhQsut7YVME7zDlJy0lNOL6J3c\nrkgkbcqvPokatlwwyP1cPPCwi1h7W7ESuR3ADbE3D0+j6SmW2h2nXLrI2dPw\nUFXHXwznY7Q1LcK7ueKdlQMeswbc2f5mA9g3QOD+aX/HAwypczM87oGWsuUF\nwTFX1iiLXBU52eZgqcXAUatMMgrZaR8VeTHAwytnXKaJkLVsJi0WE7rro3gf\nUyaHx7IYlwsQQpHnuVY+pln5s2BylzV9UYk41fTOangzg3m7eDjQIXMrOHgY\nTAQH\r\n=i7jx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDD7Mdv9woEI8r8rOPYVPdp+zyV7VvUOCOSbsnU5Jvo0gIhAPQTZqLHH3Prl1kDUQ7Etn+9iy6L85DXmfFdgS1tBwyr"}]},"maintainers":[{"name":"rubaxa","email":"ibnRubaXa@gmail.com"}],"_npmUser":{"name":"rubaxa","email":"ibnRubaXa@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webauthn_1.0.0-rc.1_1575105532086_0.2814627239121652"},"_hasShrinkwrap":false},"1.0.0-rc.2":{"name":"@artifact-project/webauthn","version":"1.0.0-rc.2","description":"WebAuthn — A set of tools for building an API and interacts with","keywords":["webauthn","security","authorization"],"author":{"name":"RubaXa","email":"ibn@rubaxa.org"},"license":"MIT","main":"webauthn.js","scripts":{"test":"jest --coverage","start":"npm test -- --watchAll","build":"rollup --config && npm run dts-build","build-clean":"npm run ts-build-clean","git-clean":"git cliean -fd","dts-build":"dts-bundle-generator -o webauthn.d.ts webauthn.ts","dts-build-webauthn":"npm run dts-build-webauthn && npm run dts-build-allow","dts-build-allow":"dts-bundle-generator -o allow.d.ts allow.ts","prepublishOnly":"npm run test && npm run build","postpublish":"echo 'npm run git-clean?\n';"},"devDependencies":{"@rollup/plugin-replace":"^2.2.1","@types/jest":"^24.0.23","@types/node":"^12.12.14","dts-bundle-generator":"^3.3.1","jest":"^24.9.0","rimraf":"^3.0.0","rollup":"^1.27.5","rollup-plugin-replace":"^2.2.0","rollup-plugin-typescript2":"^0.25.2","rollup-plugin-uglify":"^6.0.3","ts-jest":"^24.2.0","typescript":"^3.7.2","uglify-js":"^3.7.1"},"dependencies":{"@types/webappsec-credential-management":"^0.5.1"},"jest":{"transform":{"^.+\\.tsx?$":"ts-jest"},"testRegex":"\\.tests\\.ts$","transformIgnorePatterns":[],"setupFilesAfterEnv":["<rootDir>/__jest__/extensions.ts"],"moduleFileExtensions":["ts","tsx","js","json"]},"gitHead":"96f06004fb5cdd3ce5dc91a7be0fb155481d3893","_id":"@artifact-project/webauthn@1.0.0-rc.2","_nodeVersion":"11.1.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-dZmGDso0ROlCNbTCTwZOvEiuBvZcLTsivJg6e5XwHCYvJqPclZDjUe5eAPZJbXfqkxgq3VHEnJmNQmbM9pzFXA==","shasum":"3f39c6baf971935ee43d22bc1ef683df5984e54a","tarball":"https://registry.npmjs.org/@artifact-project/webauthn/-/webauthn-1.0.0-rc.2.tgz","fileCount":9,"unpackedSize":47493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5fKdCRA9TVsSAnZWagAArzMP/022i2B5oEZGUtvTuF8l\n+7HiBd36JOnoja81c9p3qb7S0v8DKhIoDSLFbn+lqYU79+xoKrMID/ypFYez\ndaEBncYdpslPELBcDEV863wqEq7hIFoCyV+8WDl1i0cWhIEupoKjGYZOW2x8\nK0wbttA5YgsWkMoiE4xSwAS9aNGaboDUR2q2quYCxMU7v34x7XicwQYGjysf\nqMOR99A6Hs4HHoOelcptePmTekvR/+82R6vlb8du6FhAmKcpjpyiuOSBCmfN\npsVjD0yR1FQggh6t2QTRrwLDHMbVKPpTvuKXTrjbnNGs7WwuqZRo20rdcD48\nTFHGVUQXmJHlgdzbrdh82rjNnrsgUVPqmrXNfTUq8gOo5CyjbMgyIwjMn8Td\nS1G6FkYE6/BTPlm4DXA33fZEW9OI56P+uYarhP6aCy+VIBwoe6nV0tBUZU5z\n48AmX0W8AdS+GwQ83Ltd8IOZLmgVxmE6MV6/CqQ0GZ7sJ1ve2cYg5WU0O9zU\n4za/ewm34qMQ9ph4kqTsIm9FsHlk7Znu+Knqg84RuwCcRg0TnSpH+eRUIWMi\nNfIt9mQu+ubCK+D1PqFaF98N/ISt70j0UhPMBY5JiTiYAonZ3NpyMQZ7MZgk\naUyyAQf14FeYAjZnX7WezoP3MBtkxvRdMeEW9cxfFsXBD3KuIl9QQJ68XKq4\nE0/3\r\n=tp9U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtcf5bNJE5NUy9YTXwitnVXlxqrzFuQPt0JUL+BvHHfwIhAJ46SluwnUSepHRQ0nhtWUPfsaoqyUVWFC0dnI+2i4iH"}]},"maintainers":[{"name":"rubaxa","email":"ibnRubaXa@gmail.com"}],"_npmUser":{"name":"rubaxa","email":"ibnRubaXa@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webauthn_1.0.0-rc.2_1575350941201_0.12365962271707476"},"_hasShrinkwrap":false}},"time":{"created":"2019-07-15T07:57:13.245Z","0.2.1":"2019-07-15T07:57:13.616Z","modified":"2022-04-04T15:38:37.731Z","1.0.0-rc.1":"2019-11-30T09:18:52.262Z","1.0.0-rc.2":"2019-12-03T05:29:01.341Z"},"maintainers":[{"name":"rubaxa","email":"ibnRubaXa@gmail.com"}],"description":"WebAuthn — A set of tools for building an API and interacts with","keywords":["webauthn","security","authorization"],"author":{"name":"RubaXa","email":"ibn@rubaxa.org"},"license":"MIT","readme":"@artifact-project/webauthn 🔐\n-----------------------------\nA set of tools for building an API and interacts with [WebAuthn](https://webauthn.me/).\n\n```sh\nnpm i --save @artifact-project/webauthn\n```\n\n---\n\n### Features\n\n- Easy and Flexibility API 🧬\n- Supported IFrames (regardless of nesting) 💪🏻\n- Runtime logger & verbose mode ✴️\n- Fully testelably ✅\n\n---\n\n### Using in iframe\n\n##### In parent window\n```ts\nimport { allowFrom } from '@artifact-project/webauthn/allow';\nallowFrom(['mail.ru', '{o2,account}.mail.ru']);\n```\n\n##### Or embed the code in the parent window\n```html\n<html>\n  <head>\n    <script>\n      /* Replace this comment on the code from this file: ./node_modules/@artifact-project/webauthn/allow.js */\n      webauthn.allowFrom(['mail.ru', '{o2,account}.mail.ru']);\n    </script>\n  </head>\n  <body>...</body>\n</html>\n```\n\n##### Inside iframe\n```ts\nimport { allowFor } from '@artifact-project/webauthn';\nallowFor(['mail.ru', '*.mail.ru']);\n```\n\n---\n\n### Credential Create Request (aka Registration)\n\n- [navigation.credentials.create](https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/create)\n\n```ts\nimport {\n\tcredentials,\n\tcreateMultiPhaseRequest,\n\tfetchJSON,\n\tparseAsCredentialCreationOptionsAndExtra,\n\tencodeAttestationResponsePayload,\n} from '@artifact-project/webauthn';\n\nconst credentialCreateRequest = createMultiPhaseRequest<{login: params}>()\n\t.phase((params) => fetchJSON('/api/v1/webauthn/credentials/create', params)\n\t\t.then(res => res.body)\n\t\t.then(parseAsCredentialCreationOptionsAndExtra)\n\t)\n\t.phase(({options, extra}) => credentials.create(options).then(credential => ({\n\t\textra,\n\t\toptions,\n\t\tcredential,\n\t})))\n\t.phase(\n\t\t({extra, credential, options}) => fetchJSON('/api/v1/webauthn/credentials/create/confirm', {\n\t\t\t...extra,\n\t\t\tattestation: encodeAttestationResponsePayload(credential),\n\t\t}).then(res => ({\n\t\t\textra: res.body,\n\t\t\toptions,\n\t\t\tcredential,\n\t\t}))\n\t)\n;\n\ncredentialCreateRequest({\n\tlogin: 'ibn@rubaxa.org',\n}).then(console.log);\n// {\n//   extra: {id: \"...\", login: \"ibn@rubaxa.org\"},\n//   options: {...},\n//   credential: {...},\n// }\n```\n\n---\n\n### Credential Request (aka Login)\n\n- [navigation.credentials.get](https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/get)\n\n```ts\nimport {\n\tcredentials,\n\tcreateMultiPhaseRequest,\n\tfetchJSON,\n\tparseAsCredentialRequestOptionsAndExtra,\n\tencodeAssertionResponsePlayload,\n} from '@artifact-project/webauthn';\n\nconst credentialRequest = createMultiPhaseRequest<{login: params}>()\n\t.phase((params) => fetchJSON('/api/v1/webauthn/credentials/get', params)\n\t\t.then(res => res.body)\n\t\t.then(parseAsCredentialRequestOptionsAndExtra)\n\t)\n\t.phase(({options, extra}) => credentials.get(options).then(credential => ({\n\t\textra,\n\t\toptions,\n\t\tcredential,\n\t})))\n\t.phase(\n\t\t({extra, credential, options}) => fetchJSON('/api/v1/webauthn/credentials/get/confirm', {\n\t\t\t...extra,\n\t\t\tassertion: encodeAssertionResponsePlayload(credential),\n\t\t}).then(res => ({\n\t\t\textra: res.body,\n\t\t\toptions,\n\t\t\tcredential,\n\t\t}))\n\t)\n;\n\ncredentialRequest({\n\tlogin: 'ibn@rubaxa.org',\n}).then(console.log);\n// {\n//   extra: {token: \"...\", url: \"...\", expires: 123},\n//   options: {...},\n//   credential: {...},\n// }\n```\n\n---\n\n### API\n\n- **isCredentialsSupported**(): `boolean`\n- **getLogEntries**(): `Array<{msg: string; detail: object;}>`\n- **credentials**\n  - **create**(options?: `CredentialCreationOptions`): `Promise<Credential | null>`\n  - **get**(options?: `CredentialRequestOptions`): `Promise<Credential | null>`\n- **createPhaseRequest**`<P extends object>`(): `(params: P) => Promise<R>`\n- **fetchJSON**(url: `string`, params: `object`): `Response`\n- **Decode**\n  - **decodeBuffer**(value: `string`): `ArrayBuffer`\n  - **decodePublicKeyCredentialCreationOptions**(value: `object`): `PublicKeyCredentialCreationOptions`\n  - **decodePublicKeyCredentialRequestOptions**(value: `object`): `PublicKeyCredentialRequestOptions`\n  - **decodeCredentialCreationOptions**(value: `object`): `CredentialCreationOptions`\n  - **decodeCredentialRequestOptions**(value: `object`): `CredentialRequestOptions`\n  - **decodeAttestationResponsePayload**(credential: `object`): `PublicKeyCredentialWithAttestationResponse`\n  - **decodeAssertionResponsePlayload**(credential: `object`): `PublicKeyCredentialWithAssertionResponse`\n- **Encode**\n  - **encodeBuffer**(buffer: `ArrayBuffer`): `string`\n  - **encodeAttestationResponsePayload**(credential: `PublicKeyCredential`): `EncodedPublicKeyCredential`\n  - **encodeAssertionResponsePlayload**(credential: `PublicKeyCredential`): `EncodedPublicKeyCredential`\n\n---\n\n\n### Development\n\n - `npm i`\n - `npm test`, [code coverage](./coverage/lcov-report/index.html)\n","readmeFilename":"README.md"}