webauthn-p256
Advanced tools
Comparing version 0.0.9 to 0.0.10-main.20240813T214019
@@ -28,2 +28,3 @@ "use strict"; | ||
}, | ||
raw: credential, | ||
}; | ||
@@ -30,0 +31,0 @@ } |
@@ -29,3 +29,3 @@ "use strict"; | ||
function base64ToBase64Url(base64) { | ||
return base64.replaceAll('+', '-').replaceAll('/', '_'); | ||
return base64.replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/, ''); | ||
} | ||
@@ -32,0 +32,0 @@ exports.base64ToBase64Url = base64ToBase64Url; |
@@ -40,2 +40,3 @@ import { numberToBytesBE } from '@noble/curves/abstract/utils'; | ||
}, | ||
raw: credential, | ||
}; | ||
@@ -42,0 +43,0 @@ } |
@@ -21,3 +21,3 @@ import { bytesToHex as bytesToHex_noble, hexToBytes as hexToBytes_noble, } from '@noble/hashes/utils'; | ||
export function base64ToBase64Url(base64) { | ||
return base64.replaceAll('+', '-').replaceAll('/', '_'); | ||
return base64.replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/, ''); | ||
} | ||
@@ -24,0 +24,0 @@ export function base64ToUtf8(base64) { |
@@ -14,2 +14,3 @@ import type { Credential, Hex, Signature, WebAuthnData } from './types.js'; | ||
webauthn: WebAuthnData; | ||
raw: PublicKeyCredential; | ||
}; | ||
@@ -16,0 +17,0 @@ /** |
# webauthn-p256 | ||
## 0.0.10 | ||
### Patch Changes | ||
- [`54bd0dc`](https://github.com/wevm/webauthn-p256/commit/54bd0dce24736f9a3f97e07671baa18313fb8970) Thanks [@jxom](https://github.com/jxom)! - Added `raw` to `sign`. | ||
## 0.0.9 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "webauthn-p256", | ||
"description": "P256 signature utilities for WebAuthn", | ||
"version": "0.0.9", | ||
"version": "0.0.10-main.20240813T214019", | ||
"type": "module", | ||
@@ -36,2 +36,2 @@ "main": "./_cjs/index.js", | ||
"keywords": [] | ||
} | ||
} |
255
sign.test.ts
@@ -18,2 +18,3 @@ import { describe, expect, test } from 'vitest' | ||
return Promise.resolve({ | ||
id: 'm1-bMPuAqpWhCxHZQZTT6e-lSPntQbh3opIoGe7g4Qs', | ||
response: { | ||
@@ -52,2 +53,256 @@ authenticatorData: [ | ||
{ | ||
"raw": { | ||
"id": "m1-bMPuAqpWhCxHZQZTT6e-lSPntQbh3opIoGe7g4Qs", | ||
"response": { | ||
"authenticatorData": [ | ||
73, | ||
150, | ||
13, | ||
229, | ||
136, | ||
14, | ||
140, | ||
104, | ||
116, | ||
52, | ||
23, | ||
15, | ||
100, | ||
118, | ||
96, | ||
91, | ||
143, | ||
228, | ||
174, | ||
185, | ||
162, | ||
134, | ||
50, | ||
199, | ||
153, | ||
92, | ||
243, | ||
186, | ||
131, | ||
29, | ||
151, | ||
99, | ||
5, | ||
0, | ||
0, | ||
0, | ||
0, | ||
], | ||
"clientDataJSON": [ | ||
123, | ||
34, | ||
116, | ||
121, | ||
112, | ||
101, | ||
34, | ||
58, | ||
34, | ||
119, | ||
101, | ||
98, | ||
97, | ||
117, | ||
116, | ||
104, | ||
110, | ||
46, | ||
103, | ||
101, | ||
116, | ||
34, | ||
44, | ||
34, | ||
99, | ||
104, | ||
97, | ||
108, | ||
108, | ||
101, | ||
110, | ||
103, | ||
101, | ||
34, | ||
58, | ||
34, | ||
57, | ||
106, | ||
69, | ||
70, | ||
105, | ||
106, | ||
117, | ||
104, | ||
69, | ||
87, | ||
114, | ||
77, | ||
52, | ||
83, | ||
79, | ||
87, | ||
45, | ||
116, | ||
67, | ||
104, | ||
74, | ||
98, | ||
85, | ||
69, | ||
72, | ||
69, | ||
80, | ||
52, | ||
52, | ||
86, | ||
99, | ||
106, | ||
99, | ||
74, | ||
45, | ||
66, | ||
113, | ||
111, | ||
49, | ||
102, | ||
84, | ||
77, | ||
56, | ||
34, | ||
44, | ||
34, | ||
111, | ||
114, | ||
105, | ||
103, | ||
105, | ||
110, | ||
34, | ||
58, | ||
34, | ||
104, | ||
116, | ||
116, | ||
112, | ||
58, | ||
47, | ||
47, | ||
108, | ||
111, | ||
99, | ||
97, | ||
108, | ||
104, | ||
111, | ||
115, | ||
116, | ||
58, | ||
53, | ||
49, | ||
55, | ||
51, | ||
34, | ||
44, | ||
34, | ||
99, | ||
114, | ||
111, | ||
115, | ||
115, | ||
79, | ||
114, | ||
105, | ||
103, | ||
105, | ||
110, | ||
34, | ||
58, | ||
102, | ||
97, | ||
108, | ||
115, | ||
101, | ||
125, | ||
], | ||
"signature": [ | ||
48, | ||
70, | ||
2, | ||
33, | ||
0, | ||
146, | ||
61, | ||
150, | ||
57, | ||
188, | ||
182, | ||
119, | ||
250, | ||
23, | ||
162, | ||
103, | ||
56, | ||
232, | ||
200, | ||
162, | ||
77, | ||
88, | ||
37, | ||
145, | ||
151, | ||
40, | ||
59, | ||
42, | ||
63, | ||
46, | ||
225, | ||
53, | ||
221, | ||
74, | ||
128, | ||
13, | ||
165, | ||
2, | ||
33, | ||
0, | ||
128, | ||
39, | ||
38, | ||
71, | ||
180, | ||
153, | ||
30, | ||
232, | ||
243, | ||
94, | ||
159, | ||
66, | ||
42, | ||
246, | ||
56, | ||
195, | ||
195, | ||
139, | ||
40, | ||
163, | ||
26, | ||
34, | ||
125, | ||
244, | ||
171, | ||
166, | ||
7, | ||
178, | ||
169, | ||
246, | ||
142, | ||
198, | ||
], | ||
}, | ||
}, | ||
"signature": "0x923d9639bcb677fa17a26738e8c8a24d58259197283b2a3f2ee135dd4a800da57fd8d9b74b66e1180ca160bdd509c73bf95bd20a8cf520904813c310526c968b", | ||
@@ -54,0 +309,0 @@ "webauthn": { |
@@ -28,2 +28,3 @@ import { numberToBytesBE } from '@noble/curves/abstract/utils' | ||
webauthn: WebAuthnData | ||
raw: PublicKeyCredential | ||
} | ||
@@ -81,2 +82,3 @@ | ||
}, | ||
raw: credential, | ||
} | ||
@@ -83,0 +85,0 @@ } catch (error) { |
@@ -31,3 +31,3 @@ import { | ||
export function base64ToBase64Url(base64: string): string { | ||
return base64.replaceAll('+', '-').replaceAll('/', '_') | ||
return base64.replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/, '') | ||
} | ||
@@ -34,0 +34,0 @@ |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
195266
3375