Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webauthn-p256

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webauthn-p256 - npm Package Compare versions

Comparing version 0.0.4-main.20240715T212154 to 0.0.4-main.20240716T231503

17

_cjs/credential.js

@@ -20,2 +20,3 @@ "use strict";

return {
credential,
id: credential.id,

@@ -31,3 +32,8 @@ publicKey: (0, publicKey_js_1.serializePublicKey)(publicKey, { compressed: true }),

function getCredentialCreationOptions(parameters) {
const { challenge = exports.createChallenge, excludeCredentialIds, name: name_, rp = {
const { attestation = 'none', authenticatorSelection = {
authenticatorAttachment: 'platform',
residentKey: 'preferred',
requireResidentKey: false,
userVerification: 'required',
}, challenge = exports.createChallenge, excludeCredentialIds, name: name_, rp = {
id: window.location.hostname,

@@ -39,9 +45,4 @@ name: window.document.title,

publicKey: {
attestation: 'none',
authenticatorSelection: {
authenticatorAttachment: 'platform',
residentKey: 'preferred',
requireResidentKey: false,
userVerification: 'required',
},
attestation,
authenticatorSelection,
challenge,

@@ -48,0 +49,0 @@ ...(excludeCredentialIds

@@ -26,2 +26,3 @@ import { keccak_256 } from '@noble/hashes/sha3';

return {
credential,
id: credential.id,

@@ -45,3 +46,8 @@ publicKey: serializePublicKey(publicKey, { compressed: true }),

export function getCredentialCreationOptions(parameters) {
const { challenge = createChallenge, excludeCredentialIds, name: name_, rp = {
const { attestation = 'none', authenticatorSelection = {
authenticatorAttachment: 'platform',
residentKey: 'preferred',
requireResidentKey: false,
userVerification: 'required',
}, challenge = createChallenge, excludeCredentialIds, name: name_, rp = {
id: window.location.hostname,

@@ -53,9 +59,4 @@ name: window.document.title,

publicKey: {
attestation: 'none',
authenticatorSelection: {
authenticatorAttachment: 'platform',
residentKey: 'preferred',
requireResidentKey: false,
userVerification: 'required',
},
attestation,
authenticatorSelection,
challenge,

@@ -62,0 +63,0 @@ ...(excludeCredentialIds

@@ -24,2 +24,13 @@ import type { Credential, OneOf, P256Credential, Prettify, PublicKeyCredentialCreationOptions } from './types.js';

/**
* A string specifying the relying party's preference for how the attestation statement
* (i.e., provision of verifiable evidence of the authenticity of the authenticator and its data)
* is conveyed during credential creation.
*/
attestation?: PublicKeyCredentialCreationOptions['attestation'] | undefined;
/**
* An object whose properties are criteria used to filter out the potential authenticators
* for the credential creation operation.
*/
authenticatorSelection?: PublicKeyCredentialCreationOptions['authenticatorSelection'] | undefined;
/**
* An `ArrayBuffer`, `TypedArray`, or `DataView` used as a cryptographic challenge.

@@ -26,0 +37,0 @@ */

export type Hex = `0x${string}`;
export type P256Credential = {
credential: PublicKeyCredential;
id: string;

@@ -4,0 +5,0 @@ publicKey: Hex;

@@ -33,2 +33,8 @@ import { describe, expect, test } from 'vitest'

{
"credential": {
"id": "m1-bMPuAqpWhCxHZQZTT6e-lSPntQbh3opIoGe7g4Qs",
"response": {
"getPublicKey": [Function],
},
},
"id": "m1-bMPuAqpWhCxHZQZTT6e-lSPntQbh3opIoGe7g4Qs",

@@ -35,0 +41,0 @@ "publicKey": "0xab891400140fc4f8e941ce0ff90e419de9470acaca613bbd717a4775435031a7d884318e919fd3b3e5a631d866d8a380b44063e70f0c381ee16e0652f7f97554",

@@ -62,2 +62,3 @@ import { keccak_256 } from '@noble/hashes/sha3'

return {
credential,
id: credential.id,

@@ -73,2 +74,15 @@ publicKey: serializePublicKey(publicKey, { compressed: true }),

/**
* A string specifying the relying party's preference for how the attestation statement
* (i.e., provision of verifiable evidence of the authenticity of the authenticator and its data)
* is conveyed during credential creation.
*/
attestation?: PublicKeyCredentialCreationOptions['attestation'] | undefined
/**
* An object whose properties are criteria used to filter out the potential authenticators
* for the credential creation operation.
*/
authenticatorSelection?:
| PublicKeyCredentialCreationOptions['authenticatorSelection']
| undefined
/**
* An `ArrayBuffer`, `TypedArray`, or `DataView` used as a cryptographic challenge.

@@ -127,2 +141,9 @@ */

const {
attestation = 'none',
authenticatorSelection = {
authenticatorAttachment: 'platform',
residentKey: 'preferred',
requireResidentKey: false,
userVerification: 'required',
},
challenge = createChallenge,

@@ -140,9 +161,4 @@ excludeCredentialIds,

publicKey: {
attestation: 'none',
authenticatorSelection: {
authenticatorAttachment: 'platform',
residentKey: 'preferred',
requireResidentKey: false,
userVerification: 'required',
},
attestation,
authenticatorSelection,
challenge,

@@ -149,0 +165,0 @@ ...(excludeCredentialIds

{
"name": "webauthn-p256",
"description": "P256 signature utilities for WebAuthn",
"version": "0.0.4-main.20240715T212154",
"version": "0.0.4-main.20240716T231503",
"type": "module",

@@ -6,0 +6,0 @@ "main": "./_cjs/index.js",

@@ -160,2 +160,4 @@ <br/>

| `name` | Name for the credential. | `string` |
| `attestation` | Attestation type for the credential. | `'none'` |
| `authenticatorSelection` | An object whose properties are criteria used to filter out the potential authenticators for the credential creation operation. | `AuthenticatorSelection` |
| `challenge` | Custom creation challenge for the credential. | `BufferSource` |

@@ -162,0 +164,0 @@ | `createFn` | Credential creation function. Useful for environments that do not support the WebAuthn API natively (i.e. React Native or testing environments). | `(options: CredentialCreationOptions) => Promise<Credential \| null>` |

export type Hex = `0x${string}`
export type P256Credential = {
credential: PublicKeyCredential
id: string

@@ -5,0 +6,0 @@ publicKey: Hex

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc