Skip to content

Commit 1c093ac

Browse files
committed
chore: upgrade react-native-keychain
1 parent 744f898 commit 1c093ac

File tree

14 files changed

+202
-206
lines changed

14 files changed

+202
-206
lines changed

__mocks__/@synonymdev/react-native-keychain/index.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
const mockKeychainPasswords = {};
2+
3+
const getGenericPassword = jest.fn(({ service }) => {
4+
return { password: mockKeychainPasswords[service] };
5+
});
6+
7+
const setGenericPassword = jest.fn((key, value) => {
8+
mockKeychainPasswords[key] = value;
9+
});
10+
11+
const keychainMock = {
12+
SECURITY_LEVEL: {
13+
SECURE_SOFTWARE: 'MOCK_SECURITY_LEVEL_SECURE_SOFTWARE',
14+
SECURE_HARDWARE: 'MOCK_SECURITY_LEVEL_SECURE_HARDWARE',
15+
ANY: 'MOCK_SECURITY_LEVEL_ANY',
16+
},
17+
ACCESSIBLE: {
18+
WHEN_UNLOCKED: 'MOCK_AccessibleWhenUnlocked',
19+
AFTER_FIRST_UNLOCK: 'MOCK_AccessibleAfterFirstUnlock',
20+
ALWAYS: 'MOCK_AccessibleAlways',
21+
WHEN_PASSCODE_SET_THIS_DEVICE_ONLY:
22+
'MOCK_AccessibleWhenPasscodeSetThisDeviceOnly',
23+
WHEN_UNLOCKED_THIS_DEVICE_ONLY: 'MOCK_AccessibleWhenUnlockedThisDeviceOnly',
24+
AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY:
25+
'MOCK_AccessibleAfterFirstUnlockThisDeviceOnly',
26+
},
27+
ACCESS_CONTROL: {
28+
USER_PRESENCE: 'MOCK_UserPresence',
29+
BIOMETRY_ANY: 'MOCK_BiometryAny',
30+
BIOMETRY_CURRENT_SET: 'MOCK_BiometryCurrentSet',
31+
DEVICE_PASSCODE: 'MOCK_DevicePasscode',
32+
APPLICATION_PASSWORD: 'MOCK_ApplicationPassword',
33+
BIOMETRY_ANY_OR_DEVICE_PASSCODE: 'MOCK_BiometryAnyOrDevicePasscode',
34+
BIOMETRY_CURRENT_SET_OR_DEVICE_PASSCODE:
35+
'MOCK_BiometryCurrentSetOrDevicePasscode',
36+
},
37+
AUTHENTICATION_TYPE: {
38+
DEVICE_PASSCODE_OR_BIOMETRICS:
39+
'MOCK_AuthenticationWithBiometricsDevicePasscode',
40+
BIOMETRICS: 'MOCK_AuthenticationWithBiometrics',
41+
},
42+
STORAGE_TYPE: {
43+
FB: 'MOCK_FacebookConceal',
44+
AES: 'MOCK_KeystoreAESCBC',
45+
RSA: 'MOCK_KeystoreRSAECB',
46+
KC: 'MOCK_keychain',
47+
},
48+
getGenericPassword,
49+
setGenericPassword,
50+
resetGenericPassword: jest.fn().mockResolvedValue(true),
51+
hasGenericPassword: jest.fn().mockResolvedValue(true),
52+
getAllGenericPasswordServices: jest
53+
.fn()
54+
.mockResolvedValue(['mockService1', 'mockService2']),
55+
setInternetCredentials: jest.fn().mockResolvedValue({
56+
service: 'mockService',
57+
storage: 'mockStorage',
58+
}),
59+
getInternetCredentials: jest.fn().mockResolvedValue({
60+
username: 'mockUser',
61+
password: 'mockPassword',
62+
service: 'mockService',
63+
storage: 'mockStorage',
64+
}),
65+
resetInternetCredentials: jest.fn().mockResolvedValue(true),
66+
getSupportedBiometryType: jest.fn().mockResolvedValue('MOCK_TouchID'),
67+
canImplyAuthentication: jest.fn().mockResolvedValue(true),
68+
getSecurityLevel: jest.fn().mockResolvedValue('MOCK_SECURE_SOFTWARE'),
69+
};
70+
71+
export default keychainMock;

ios/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ PODS:
17401740
- ReactCommon/turbomodule/bridging
17411741
- ReactCommon/turbomodule/core
17421742
- Yoga
1743-
- RNKeychain (9.1.1):
1743+
- RNKeychain (9.2.2):
17441744
- DoubleConversion
17451745
- glog
17461746
- hermes-engine
@@ -1987,7 +1987,7 @@ DEPENDENCIES:
19871987
- RNDeviceInfo (from `../node_modules/react-native-device-info`)
19881988
- RNFS (from `../node_modules/react-native-fs`)
19891989
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
1990-
- "RNKeychain (from `../node_modules/@synonymdev/react-native-keychain`)"
1990+
- RNKeychain (from `../node_modules/react-native-keychain`)
19911991
- RNLocalize (from `../node_modules/react-native-localize`)
19921992
- "RNNotifee (from `../node_modules/@notifee/react-native`)"
19931993
- RNPermissions (from `../node_modules/react-native-permissions`)
@@ -2178,7 +2178,7 @@ EXTERNAL SOURCES:
21782178
RNGestureHandler:
21792179
:path: "../node_modules/react-native-gesture-handler"
21802180
RNKeychain:
2181-
:path: "../node_modules/@synonymdev/react-native-keychain"
2181+
:path: "../node_modules/react-native-keychain"
21822182
RNLocalize:
21832183
:path: "../node_modules/react-native-localize"
21842184
RNNotifee:
@@ -2293,7 +2293,7 @@ SPEC CHECKSUMS:
22932293
RNDeviceInfo: b899ce37a403a4dea52b7cb85e16e49c04a5b88e
22942294
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
22952295
RNGestureHandler: e80cae4246813ee7f667a2552012a6b7da5550a1
2296-
RNKeychain: 3ac3a44294d0b18492667ff87e4c50829cb35505
2296+
RNKeychain: 4cfd0dc8634c2dd81a4607c8299ed424bfdee1a7
22972297
RNLocalize: dbea38dcb344bf80ff18a1757b1becf11f70cae4
22982298
RNNotifee: 8e2d3df3f0e9ce8f5d1fe4c967431138190b6175
22992299
RNPermissions: 2c0eec471f4de66d04d226c339898d10a6e123c4
@@ -2308,9 +2308,9 @@ SPEC CHECKSUMS:
23082308
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
23092309
sodium-react-native-direct: 8feb9a6d0d88ce65efa305d6cc774c11c62d9a15
23102310
SSZipArchive: c69881e8ac5521f0e622291387add5f60f30f3c4
2311-
Yoga: 2a45d7e59592db061217551fd3bbe2dd993817ae
2311+
Yoga: a1d7895431387402a674fd0d1c04ec85e87909b8
23122312
ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5
23132313

23142314
PODFILE CHECKSUM: cb153cb4a39e6c92c8b869eafab65a4bba7b869f
23152315

2316-
COCOAPODS: 1.15.2
2316+
COCOAPODS: 1.16.2

0 commit comments

Comments
 (0)