react-native-keychain
Advanced tools
Comparing version 7.0.0 to 8.0.0
12
index.js
@@ -6,3 +6,7 @@ // @flow | ||
export const SECURITY_LEVEL = Object.freeze({ | ||
export const SECURITY_LEVEL: { | ||
ANY: string, | ||
SECURE_SOFTWARE: string, | ||
SECURE_HARDWARE: string, | ||
} = Object.freeze({ | ||
ANY: RNKeychainManager && RNKeychainManager.SECURITY_LEVEL_ANY, | ||
@@ -98,6 +102,6 @@ SECURE_SOFTWARE: | ||
export type Options = { | ||
export type Options = $Shape<{| | ||
authenticationPrompt?: string | AuthenticationPrompt, | ||
...BaseOptions, | ||
}; | ||
|}>; | ||
@@ -218,3 +222,3 @@ export type Result = {| | ||
*/ | ||
export async function getAllGenericPasswordServices(): Promise<string[]> { | ||
export function getAllGenericPasswordServices(): Promise<string[]> { | ||
return RNKeychainManager.getAllGenericPasswordServices(); | ||
@@ -221,0 +225,0 @@ } |
{ | ||
"name": "react-native-keychain", | ||
"version": "7.0.0", | ||
"version": "8.0.0", | ||
"description": "Keychain Access for React Native", | ||
@@ -49,7 +49,7 @@ "main": "index.js", | ||
"eslint": "^7.2.0", | ||
"flow-bin": "^0.122.0", | ||
"flow-bin": "^0.158.0", | ||
"prettier": "^2.2.1", | ||
"react-native": "^0.63.3", | ||
"react-native": "^0.66.0", | ||
"typescript": "^4.2.2" | ||
} | ||
} |
@@ -271,18 +271,13 @@ <h1 align="center">react-native-keychain</h1> | ||
| Key | Description | | ||
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `NONE` | No rules. Be dummy, developer control everything | | ||
| `AUTOMATIC_UPGRADE` | Upgrade secret to the best available storage as soon as it is available and user request secret extraction. Upgrade not applied till we request the secret. | | ||
| Key | Description | | ||
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `NONE` | No rules. Be dummy, developer control everything | | ||
| `AUTOMATIC_UPGRADE` | Upgrade secret to the best available storage as soon as it is available and user request secret extraction. Upgrade not applied till we request the secret. This rule only applies to secrets stored with FacebookConseal. | | ||
## Important Behavior | ||
### Rule 1: Automatic Security Level Upgrade | ||
### Rule 1: Automatic Security Level | ||
As a rule library try to apply the best possible encryption and access method for storing secrets. | ||
As a rule the library will try to apply the best possible encryption for storing secrets. Once the secret is stored however its does not try to upgrade it unless FacebookConseal was used and the option 'SECURITY_RULES' is set to 'AUTOMATIC_UPGRADE' | ||
What does it mean in practical use case? | ||
> Scenario #1: User has a new phone and run on it an application with this module and store secret on device. | ||
> Several days later user configures biometrics on the device and run application again. When the user will try to access the secret, the library will detect security enhancement and will upgrade secret storage to the best possible. | ||
--- | ||
@@ -303,5 +298,5 @@ | ||
Q: How to disable automatic upgrade? | ||
Q: How to enable automatic upgrade for FacebookConseal? | ||
A: Do call `getGenericPassword({ ...otherProps, rules: "none" })` with extra property `rules` set to `none` string value. | ||
A: Do call `getGenericPassword({ ...otherProps, rules: "AUTOMATIC_UPGRADE" })` with extra property `rules` set to `AUTOMATIC_UPGRADE` string value. | ||
@@ -308,0 +303,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
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
203968
460
569