wallaby-cash 2.2.12 → 2.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/dist/generated/api.d.ts +3 -3
- package/dist/helpers/base64.base.d.ts +12 -0
- package/dist/helpers/base64.d.ts +6 -0
- package/dist/index.cjs.js +100 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +100 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +100 -12
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/authenticator.d.ts +3 -3
- package/dist/lib/auth/passkey.model.d.ts +10 -3
- package/dist/lib/auth/passkey.service.base.d.ts +76 -0
- package/dist/lib/auth/passkey.service.d.ts +1 -76
- package/dist/lib/utils/constants.d.ts +1 -1
- package/dist/lib/wallet/wallet-data.service.d.ts +1 -1
- package/dist/package.json +15 -3
- package/dist/types/auth.d.ts +152 -4
- package/package.json +15 -3
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
* React Native will use authenticator.native.ts instead due to the .native.ts extension.
|
|
8
8
|
*/
|
|
9
9
|
import * as WebAuthn from '@simplewebauthn/browser';
|
|
10
|
-
import { IAuthenticator } from './passkey.model';
|
|
10
|
+
import { IAuthenticator, StartAuthenticationOpts, StartRegistrationOpts } from './passkey.model';
|
|
11
11
|
export declare class Authenticator implements IAuthenticator {
|
|
12
12
|
constructor();
|
|
13
|
-
register({ optionsJSON }:
|
|
14
|
-
authenticate({ optionsJSON, useBrowserAutofill, skipUserVerification, }:
|
|
13
|
+
register({ optionsJSON }: StartRegistrationOpts): Promise<WebAuthn.RegistrationResponseJSON>;
|
|
14
|
+
authenticate({ optionsJSON, useBrowserAutofill, skipUserVerification, }: StartAuthenticationOpts & {
|
|
15
15
|
skipUserVerification?: boolean;
|
|
16
16
|
}): Promise<WebAuthn.AuthenticationResponseJSON>;
|
|
17
17
|
/**
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { AuthenticationResponseJSON, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, RegistrationResponseJSON } from '../../types';
|
|
2
|
+
export type StartRegistrationOpts = {
|
|
3
|
+
optionsJSON: PublicKeyCredentialCreationOptionsJSON;
|
|
4
|
+
};
|
|
5
|
+
export type StartAuthenticationOpts = {
|
|
6
|
+
optionsJSON: PublicKeyCredentialRequestOptionsJSON;
|
|
7
|
+
useBrowserAutofill?: boolean;
|
|
8
|
+
};
|
|
2
9
|
export interface IAuthenticator {
|
|
3
|
-
register: ({ optionsJSON }:
|
|
4
|
-
authenticate: ({ optionsJSON }:
|
|
10
|
+
register: ({ optionsJSON }: StartRegistrationOpts) => Promise<RegistrationResponseJSON> | void;
|
|
11
|
+
authenticate: ({ optionsJSON }: StartAuthenticationOpts) => Promise<AuthenticationResponseJSON> | void;
|
|
5
12
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { AsymmetricKeyPair, Encrypted, SignatureMessageResponse, AuthenticationResponse, RequestOptions, RequestRoute } from '../../types';
|
|
2
|
+
import { StorageService } from '../utils/storage.service';
|
|
3
|
+
import { AuthService } from './auth.service';
|
|
4
|
+
export declare class PasskeyService {
|
|
5
|
+
private cipher;
|
|
6
|
+
private localStorageService;
|
|
7
|
+
private userId;
|
|
8
|
+
private request;
|
|
9
|
+
private authenticator;
|
|
10
|
+
constructor(userId: string, storageService: StorageService, request: <T = any>(route: RequestRoute, options?: RequestOptions) => Promise<T>);
|
|
11
|
+
private preparePasskeyRequestOptions;
|
|
12
|
+
private preparePasskeyCreationOptions;
|
|
13
|
+
/**
|
|
14
|
+
* @description Adds a new passkey to the user's account on that device.
|
|
15
|
+
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
16
|
+
* @param { SignatureMessageResponse } challengeResponse
|
|
17
|
+
* @returns { AuthenticationResponse } The authentication response containing the access token and user information.
|
|
18
|
+
*/
|
|
19
|
+
addNewPasskey({ deviceKeyPair, getSignature, }: {
|
|
20
|
+
deviceKeyPair: AsymmetricKeyPair;
|
|
21
|
+
getSignature: AuthService['getSignature'];
|
|
22
|
+
}): Promise<AuthenticationResponse>;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @description Authenticates the user using a passkey.
|
|
26
|
+
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
27
|
+
* @param { SignatureMessageResponse } challengeResponse
|
|
28
|
+
* @returns { AuthResponse } The authentication response containing the access token and user information.
|
|
29
|
+
*/
|
|
30
|
+
authenticate({ deviceKeyPair, challengeResponse, }: {
|
|
31
|
+
deviceKeyPair: Pick<AsymmetricKeyPair, 'publicKey'> & {
|
|
32
|
+
encryptedDevicePrivateKey?: Encrypted;
|
|
33
|
+
decryptedPrivateKey?: string;
|
|
34
|
+
};
|
|
35
|
+
challengeResponse: SignatureMessageResponse;
|
|
36
|
+
}): Promise<AuthenticationResponse>;
|
|
37
|
+
private getDeviceSignature;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @description Registers a new passkey for the user.
|
|
41
|
+
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
42
|
+
* @param { SignatureMessageResponse } challengeResponse
|
|
43
|
+
* @returns { AuthenticationResponse } The authentication response containing the access token and user information.
|
|
44
|
+
*/
|
|
45
|
+
register({ deviceKeyPair, challengeResponse, }: {
|
|
46
|
+
deviceKeyPair: AsymmetricKeyPair;
|
|
47
|
+
challengeResponse: SignatureMessageResponse;
|
|
48
|
+
}): Promise<AuthenticationResponse>;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @description Checks if the device is compatible with the PRF extension.
|
|
52
|
+
* @returns {boolean} Returns true if the device is compatible with PRF extension, false otherwise.
|
|
53
|
+
*/
|
|
54
|
+
isDevicePrfCompatible(): Promise<any>;
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @description Retrieves the passkey credential stored on the device.
|
|
58
|
+
* @returns {Promise<AuthenticationResponseJSON | RegistrationResponseJSON>} The passkey credential stored on the device.
|
|
59
|
+
*/
|
|
60
|
+
publicKeyCredential(): Promise<any>;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @description Stores the encrypted device private key, public key, and authentication response in local storage.
|
|
64
|
+
* @param {AuthResponse} AuthenticationResponse
|
|
65
|
+
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
66
|
+
* @returns {Promise<void>}
|
|
67
|
+
*/
|
|
68
|
+
private handleStoringData;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @description Handles the creation of credentials from the PRF extension.
|
|
72
|
+
* @param {AuthenticationResponseJSON | RegistrationResponseJSON} passkeyCredential
|
|
73
|
+
* @returns {Promise<AsymmetricKeyPair>} The credentials key pair.
|
|
74
|
+
*/
|
|
75
|
+
private handleCredentialsCreationFromPrfExtension;
|
|
76
|
+
}
|
|
@@ -1,76 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { StorageService } from '../utils/storage.service';
|
|
3
|
-
import { AuthService } from './auth.service';
|
|
4
|
-
export declare class PasskeyService {
|
|
5
|
-
private cipher;
|
|
6
|
-
private localStorageService;
|
|
7
|
-
private userId;
|
|
8
|
-
private request;
|
|
9
|
-
private authenticator;
|
|
10
|
-
constructor(userId: string, storageService: StorageService, request: <T = any>(route: RequestRoute, options?: RequestOptions) => Promise<T>);
|
|
11
|
-
private preparePasskeyRequestOptions;
|
|
12
|
-
private preparePasskeyCreationOptions;
|
|
13
|
-
/**
|
|
14
|
-
* @description Adds a new passkey to the user's account on that device.
|
|
15
|
-
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
16
|
-
* @param { SignatureMessageResponse } challengeResponse
|
|
17
|
-
* @returns { AuthenticationResponse } The authentication response containing the access token and user information.
|
|
18
|
-
*/
|
|
19
|
-
addNewPasskey({ deviceKeyPair, getSignature, }: {
|
|
20
|
-
deviceKeyPair: AsymmetricKeyPair;
|
|
21
|
-
getSignature: AuthService['getSignature'];
|
|
22
|
-
}): Promise<AuthenticationResponse>;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* @description Authenticates the user using a passkey.
|
|
26
|
-
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
27
|
-
* @param { SignatureMessageResponse } challengeResponse
|
|
28
|
-
* @returns { AuthResponse } The authentication response containing the access token and user information.
|
|
29
|
-
*/
|
|
30
|
-
authenticate({ deviceKeyPair, challengeResponse, }: {
|
|
31
|
-
deviceKeyPair: Pick<AsymmetricKeyPair, 'publicKey'> & {
|
|
32
|
-
encryptedDevicePrivateKey?: Encrypted;
|
|
33
|
-
decryptedPrivateKey?: string;
|
|
34
|
-
};
|
|
35
|
-
challengeResponse: SignatureMessageResponse;
|
|
36
|
-
}): Promise<AuthenticationResponse>;
|
|
37
|
-
private getDeviceSignature;
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @description Registers a new passkey for the user.
|
|
41
|
-
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
42
|
-
* @param { SignatureMessageResponse } challengeResponse
|
|
43
|
-
* @returns { AuthenticationResponse } The authentication response containing the access token and user information.
|
|
44
|
-
*/
|
|
45
|
-
register({ deviceKeyPair, challengeResponse, }: {
|
|
46
|
-
deviceKeyPair: AsymmetricKeyPair;
|
|
47
|
-
challengeResponse: SignatureMessageResponse;
|
|
48
|
-
}): Promise<AuthenticationResponse>;
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
* @description Checks if the device is compatible with the PRF extension.
|
|
52
|
-
* @returns {boolean} Returns true if the device is compatible with PRF extension, false otherwise.
|
|
53
|
-
*/
|
|
54
|
-
isDevicePrfCompatible(): Promise<any>;
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
* @description Retrieves the passkey credential stored on the device.
|
|
58
|
-
* @returns {Promise<AuthenticationResponseJSON | RegistrationResponseJSON>} The passkey credential stored on the device.
|
|
59
|
-
*/
|
|
60
|
-
publicKeyCredential(): Promise<any>;
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* @description Stores the encrypted device private key, public key, and authentication response in local storage.
|
|
64
|
-
* @param {AuthResponse} AuthenticationResponse
|
|
65
|
-
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
66
|
-
* @returns {Promise<void>}
|
|
67
|
-
*/
|
|
68
|
-
private handleStoringData;
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* @description Handles the creation of credentials from the PRF extension.
|
|
72
|
-
* @param {AuthenticationResponseJSON | RegistrationResponseJSON} passkeyCredential
|
|
73
|
-
* @returns {Promise<AsymmetricKeyPair>} The credentials key pair.
|
|
74
|
-
*/
|
|
75
|
-
private handleCredentialsCreationFromPrfExtension;
|
|
76
|
-
}
|
|
1
|
+
export { PasskeyService } from './passkey.service.base';
|
|
@@ -27,7 +27,7 @@ export declare const MASTER_ENCRYPTION_KEY = "9fa9d3f3c77c20d3a50a08e5299644be29
|
|
|
27
27
|
In particular, RS256 is necessary for compatibility with Microsoft Windows platform authenticators.
|
|
28
28
|
ES256 is a widely supported algorithm and is compatible with most other platform authenticators and roaming authenticators.
|
|
29
29
|
Therefore a Relying Party that uses an algorithm identifier list that omits either of those values will see registration failures when users attempt to use incompatible authenticators.
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
https://chromium.googlesource.com/chromium/src/+/main/content/browser/webauth/pub_key_cred_params.md
|
|
32
32
|
*/
|
|
33
33
|
export declare const PUBLIC_KEY_CREDENTIAL_PARAM: {
|
|
@@ -18,7 +18,7 @@ export declare class WalletDataService extends Base {
|
|
|
18
18
|
* @param { string } address Wallet address
|
|
19
19
|
* @param { string } symbol Token symbol
|
|
20
20
|
* @param { BlockchainName } chainName the chain name enum. i.e. 'ETHEREUM', 'BITCOIN'
|
|
21
|
-
* @returns { TokenBalance }
|
|
21
|
+
* @returns { TokenBalance } Balance of the token
|
|
22
22
|
*/
|
|
23
23
|
getTokenBalance({ address, symbol, tokenStandard, chainName }: TokenBalanceRequest): Promise<TokenBalance>;
|
|
24
24
|
/**
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wallaby-cash",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.13",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git@github.com:WALLABY-WaaS/wallaby-sdk-js.git"
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"@rollup/plugin-replace": "^6.0.3",
|
|
69
69
|
"@rollup/plugin-terser": "^0.4.4",
|
|
70
70
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
71
|
+
"@simplewebauthn/browser": "^13.2.2",
|
|
71
72
|
"@size-limit/preset-small-lib": "^11.2.0",
|
|
72
73
|
"@types/crypto-js": "^4.2.2",
|
|
73
74
|
"@types/jest": "^29.5.0",
|
|
@@ -85,6 +86,7 @@
|
|
|
85
86
|
"nock": "^13.5.6",
|
|
86
87
|
"nyc": "^17.1.0",
|
|
87
88
|
"prettier": "^3.3.3",
|
|
89
|
+
"react-native-passkey": "^3.3.2",
|
|
88
90
|
"rimraf": "^5.0.7",
|
|
89
91
|
"rollup": "^4.18.0",
|
|
90
92
|
"rollup-plugin-copy": "^3.5.0",
|
|
@@ -99,7 +101,6 @@
|
|
|
99
101
|
"underscore": "^1.13.7"
|
|
100
102
|
},
|
|
101
103
|
"dependencies": {
|
|
102
|
-
"@simplewebauthn/browser": "^13.1.0",
|
|
103
104
|
"axios": "^1.7.7",
|
|
104
105
|
"crypto-js": "4.2.0",
|
|
105
106
|
"ethereum-cryptography": "^3.0.0",
|
|
@@ -108,9 +109,20 @@
|
|
|
108
109
|
"lodash": "^4.17.23",
|
|
109
110
|
"loglevel": "^1.9.2",
|
|
110
111
|
"loglevel-plugin-prefix": "^0.8.4",
|
|
111
|
-
"react-native-passkey": "^3.1.0",
|
|
112
112
|
"uuid": "^10.0.0"
|
|
113
113
|
},
|
|
114
|
+
"peerDependencies": {
|
|
115
|
+
"@simplewebauthn/browser": "^13.1.0",
|
|
116
|
+
"react-native-passkey": "^3.1.0"
|
|
117
|
+
},
|
|
118
|
+
"peerDependenciesMeta": {
|
|
119
|
+
"@simplewebauthn/browser": {
|
|
120
|
+
"optional": true
|
|
121
|
+
},
|
|
122
|
+
"react-native-passkey": {
|
|
123
|
+
"optional": true
|
|
124
|
+
}
|
|
125
|
+
},
|
|
114
126
|
"overrides": {
|
|
115
127
|
"diff": "^5.2.2",
|
|
116
128
|
"tar": "^7.5.7",
|
package/dist/types/auth.d.ts
CHANGED
|
@@ -1,6 +1,154 @@
|
|
|
1
|
-
import { AttestationFormat, AuthenticationExtensionsClientInputs, AuthenticatorAssertionResponseJSON, AuthenticatorTransportFuture, PublicKeyCredentialHint, PublicKeyCredentialDescriptorJSON, PublicKeyCredentialUserEntityJSON } from '@simplewebauthn/browser';
|
|
2
|
-
import * as WebAuthn from '@simplewebauthn/browser';
|
|
3
1
|
import { User, Base64URLString } from './common';
|
|
2
|
+
/**
|
|
3
|
+
* Local WebAuthn type definitions (duplicated from @simplewebauthn/browser to avoid dependency)
|
|
4
|
+
* These match the WebAuthn specification and @simplewebauthn/browser types
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Values for an attestation object's `fmt` field
|
|
8
|
+
* https://w3c.github.io/webauthn/#sctn-attestation-formats
|
|
9
|
+
*/
|
|
10
|
+
export type AttestationFormat = 'android-key' | 'android-safetynet' | 'apple' | 'fido-u2f' | 'none' | 'packed' | 'tpm';
|
|
11
|
+
/**
|
|
12
|
+
* Authenticator attachment hint
|
|
13
|
+
* https://w3c.github.io/webauthn/#enumdef-authenticatorattachment
|
|
14
|
+
*/
|
|
15
|
+
export type AuthenticatorAttachment = 'cross-platform' | 'platform';
|
|
16
|
+
/**
|
|
17
|
+
* Public key credential type
|
|
18
|
+
* https://w3c.github.io/webauthn/#enumdef-publickeycredentialtype
|
|
19
|
+
*/
|
|
20
|
+
export type PublicKeyCredentialType = 'public-key';
|
|
21
|
+
/**
|
|
22
|
+
* User verification requirement
|
|
23
|
+
* https://w3c.github.io/webauthn/#enumdef-userverificationrequirement
|
|
24
|
+
*/
|
|
25
|
+
export type UserVerificationRequirement = 'required' | 'preferred' | 'discouraged';
|
|
26
|
+
/**
|
|
27
|
+
* Attestation conveyance preference
|
|
28
|
+
* https://w3c.github.io/webauthn/#enumdef-attestationconveyancepreference
|
|
29
|
+
*/
|
|
30
|
+
export type AttestationConveyancePreference = 'none' | 'indirect' | 'direct' | 'enterprise';
|
|
31
|
+
/**
|
|
32
|
+
* COSE algorithm identifier
|
|
33
|
+
* https://www.iana.org/assignments/cose/cose.xhtml#algorithms
|
|
34
|
+
*/
|
|
35
|
+
export type COSEAlgorithmIdentifier = number;
|
|
36
|
+
/**
|
|
37
|
+
* Authenticator transport
|
|
38
|
+
* https://w3c.github.io/webauthn/#enumdef-authenticatortransport
|
|
39
|
+
*/
|
|
40
|
+
export type AuthenticatorTransport = 'usb' | 'nfc' | 'ble' | 'internal' | 'hybrid';
|
|
41
|
+
/**
|
|
42
|
+
* Future authenticator transport (includes newer transports)
|
|
43
|
+
*/
|
|
44
|
+
export type AuthenticatorTransportFuture = AuthenticatorTransport | 'cable' | 'smart-card';
|
|
45
|
+
/**
|
|
46
|
+
* Public key credential hint
|
|
47
|
+
* Categories of authenticators that Relying Parties can pass along to browsers
|
|
48
|
+
* https://w3c.github.io/webauthn/#enumdef-publickeycredentialhint
|
|
49
|
+
*/
|
|
50
|
+
export type PublicKeyCredentialHint = 'security-key' | 'client-device' | 'hybrid';
|
|
51
|
+
/**
|
|
52
|
+
* Buffer source (ArrayBuffer or ArrayBufferView)
|
|
53
|
+
*/
|
|
54
|
+
export type BufferSource = ArrayBuffer | ArrayBufferView;
|
|
55
|
+
/**
|
|
56
|
+
* Public Key Credential Descriptor JSON
|
|
57
|
+
* https://w3c.github.io/webauthn/#dictdef-publickeycredentialdescriptorjson
|
|
58
|
+
*/
|
|
59
|
+
export interface PublicKeyCredentialDescriptorJSON {
|
|
60
|
+
id: Base64URLString;
|
|
61
|
+
type: PublicKeyCredentialType;
|
|
62
|
+
transports?: AuthenticatorTransportFuture[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Public Key Credential User Entity JSON
|
|
66
|
+
* https://w3c.github.io/webauthn/#dictdef-publickeycredentialuserentityjson
|
|
67
|
+
*/
|
|
68
|
+
export interface PublicKeyCredentialUserEntityJSON {
|
|
69
|
+
id: Base64URLString;
|
|
70
|
+
name: string;
|
|
71
|
+
displayName: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Public Key Credential RP Entity
|
|
75
|
+
* https://w3c.github.io/webauthn/#dictdef-publickeycredentialrpentity
|
|
76
|
+
*/
|
|
77
|
+
export interface PublicKeyCredentialRpEntity {
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Public Key Credential Parameters
|
|
83
|
+
* https://w3c.github.io/webauthn/#dictdef-publickeycredentialparameters
|
|
84
|
+
*/
|
|
85
|
+
export interface PublicKeyCredentialParameters {
|
|
86
|
+
type: PublicKeyCredentialType;
|
|
87
|
+
alg: COSEAlgorithmIdentifier;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Resident Key Requirement
|
|
91
|
+
* https://w3c.github.io/webauthn/#enumdef-residentkeyrequirement
|
|
92
|
+
*/
|
|
93
|
+
export type ResidentKeyRequirement = 'required' | 'preferred' | 'discouraged';
|
|
94
|
+
/**
|
|
95
|
+
* Authenticator Selection Criteria
|
|
96
|
+
* https://w3c.github.io/webauthn/#dictdef-authenticatorselectioncriteria
|
|
97
|
+
*/
|
|
98
|
+
export interface AuthenticatorSelectionCriteria {
|
|
99
|
+
authenticatorAttachment?: AuthenticatorAttachment;
|
|
100
|
+
requireResidentKey?: boolean;
|
|
101
|
+
residentKey?: ResidentKeyRequirement;
|
|
102
|
+
userVerification?: UserVerificationRequirement;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Authenticator Response (base interface)
|
|
106
|
+
*/
|
|
107
|
+
export interface AuthenticatorResponse {
|
|
108
|
+
clientDataJSON: ArrayBuffer;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Authenticator Assertion Response
|
|
112
|
+
* https://w3c.github.io/webauthn/#dictdef-authenticatorassertionresponse
|
|
113
|
+
*/
|
|
114
|
+
export interface AuthenticatorAssertionResponse {
|
|
115
|
+
authenticatorData: ArrayBuffer;
|
|
116
|
+
signature: ArrayBuffer;
|
|
117
|
+
userHandle: ArrayBuffer | null;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Authenticator Assertion Response JSON
|
|
121
|
+
* Base64URL-encoded version for JSON transmission
|
|
122
|
+
*/
|
|
123
|
+
export interface AuthenticatorAssertionResponseJSON {
|
|
124
|
+
clientDataJSON: Base64URLString;
|
|
125
|
+
authenticatorData: Base64URLString;
|
|
126
|
+
signature: Base64URLString;
|
|
127
|
+
userHandle: Base64URLString | null;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Authentication Extensions Client Inputs
|
|
131
|
+
* https://w3c.github.io/webauthn/#dictdef-authenticationextensionsclientinputs
|
|
132
|
+
*/
|
|
133
|
+
export interface AuthenticationExtensionsClientInputs {
|
|
134
|
+
appid?: string;
|
|
135
|
+
credProps?: boolean;
|
|
136
|
+
hmacCreateSecret?: boolean;
|
|
137
|
+
minPinLength?: boolean;
|
|
138
|
+
[key: string]: unknown;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Authentication Extensions Client Outputs
|
|
142
|
+
* https://w3c.github.io/webauthn/#dictdef-authenticationextensionsclientoutputs
|
|
143
|
+
*/
|
|
144
|
+
export interface AuthenticationExtensionsClientOutputs {
|
|
145
|
+
appid?: boolean;
|
|
146
|
+
credProps?: {
|
|
147
|
+
rk?: boolean;
|
|
148
|
+
};
|
|
149
|
+
hmacCreateSecret?: boolean;
|
|
150
|
+
[key: string]: unknown;
|
|
151
|
+
}
|
|
4
152
|
/**
|
|
5
153
|
* A slightly-modified RegistrationCredential to simplify working with ArrayBuffers that
|
|
6
154
|
* are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
|
|
@@ -153,12 +301,12 @@ export type ExtendedAuthenticatorResponse = AuthenticatorResponse & {
|
|
|
153
301
|
authenticatorData: ArrayBuffer;
|
|
154
302
|
userHandle: ArrayBuffer;
|
|
155
303
|
};
|
|
156
|
-
export type ExtendedAuthenticationExtensionsClientOutputs =
|
|
304
|
+
export type ExtendedAuthenticationExtensionsClientOutputs = AuthenticationExtensionsClientOutputs & PRFExtension;
|
|
157
305
|
export type ExtendedAuthenticationExtensionsClientInputs = AuthenticationExtensionsClientInputs & {
|
|
158
306
|
prf: AuthenticationExtensionsPRFInputs;
|
|
159
307
|
};
|
|
160
308
|
export interface AuthenticationExtensionsPRFValues {
|
|
161
|
-
base64
|
|
309
|
+
base64?: Base64URLString;
|
|
162
310
|
first: BufferSource;
|
|
163
311
|
second?: BufferSource;
|
|
164
312
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wallaby-cash",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.13",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git@github.com:WALLABY-WaaS/wallaby-sdk-js.git"
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"@rollup/plugin-replace": "^6.0.3",
|
|
69
69
|
"@rollup/plugin-terser": "^0.4.4",
|
|
70
70
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
71
|
+
"@simplewebauthn/browser": "^13.2.2",
|
|
71
72
|
"@size-limit/preset-small-lib": "^11.2.0",
|
|
72
73
|
"@types/crypto-js": "^4.2.2",
|
|
73
74
|
"@types/jest": "^29.5.0",
|
|
@@ -85,6 +86,7 @@
|
|
|
85
86
|
"nock": "^13.5.6",
|
|
86
87
|
"nyc": "^17.1.0",
|
|
87
88
|
"prettier": "^3.3.3",
|
|
89
|
+
"react-native-passkey": "^3.3.2",
|
|
88
90
|
"rimraf": "^5.0.7",
|
|
89
91
|
"rollup": "^4.18.0",
|
|
90
92
|
"rollup-plugin-copy": "^3.5.0",
|
|
@@ -99,7 +101,6 @@
|
|
|
99
101
|
"underscore": "^1.13.7"
|
|
100
102
|
},
|
|
101
103
|
"dependencies": {
|
|
102
|
-
"@simplewebauthn/browser": "^13.1.0",
|
|
103
104
|
"axios": "^1.7.7",
|
|
104
105
|
"crypto-js": "4.2.0",
|
|
105
106
|
"ethereum-cryptography": "^3.0.0",
|
|
@@ -108,9 +109,20 @@
|
|
|
108
109
|
"lodash": "^4.17.23",
|
|
109
110
|
"loglevel": "^1.9.2",
|
|
110
111
|
"loglevel-plugin-prefix": "^0.8.4",
|
|
111
|
-
"react-native-passkey": "^3.1.0",
|
|
112
112
|
"uuid": "^10.0.0"
|
|
113
113
|
},
|
|
114
|
+
"peerDependencies": {
|
|
115
|
+
"@simplewebauthn/browser": "^13.1.0",
|
|
116
|
+
"react-native-passkey": "^3.1.0"
|
|
117
|
+
},
|
|
118
|
+
"peerDependenciesMeta": {
|
|
119
|
+
"@simplewebauthn/browser": {
|
|
120
|
+
"optional": true
|
|
121
|
+
},
|
|
122
|
+
"react-native-passkey": {
|
|
123
|
+
"optional": true
|
|
124
|
+
}
|
|
125
|
+
},
|
|
114
126
|
"overrides": {
|
|
115
127
|
"diff": "^5.2.2",
|
|
116
128
|
"tar": "^7.5.7",
|