react-native-keychain
Advanced tools
Comparing version 6.0.0 to 6.1.0
13
index.js
@@ -42,2 +42,4 @@ // @flow | ||
FINGERPRINT: 'Fingerprint', | ||
FACE: 'Face', | ||
IRIS: 'Iris', | ||
}); | ||
@@ -71,3 +73,3 @@ | ||
export type AuthenticationPrompt = { | ||
export type AuthenticationPrompt = {| | ||
title?: string, | ||
@@ -77,5 +79,5 @@ subtitle?: string, | ||
cancel?: string, | ||
}; | ||
|}; | ||
type BaseOptions = { | ||
type BaseOptions = {| | ||
accessControl?: SecAccessControl, | ||
@@ -89,3 +91,3 @@ accessGroup?: string, | ||
rules?: SecSecurityRules, | ||
}; | ||
|}; | ||
@@ -123,3 +125,3 @@ type NormalizedOptions = { | ||
function normalizeServiceOption(serviceOrOptions?: string | Options): Options { | ||
function normalizeServiceOption(serviceOrOptions?: string | Options) { | ||
if (typeof serviceOrOptions === 'string') { | ||
@@ -163,2 +165,3 @@ console.warn( | ||
// $FlowFixMe >=0.107.x – remove in next major, when authenticationPrompt as string is removed | ||
return options; | ||
@@ -165,0 +168,0 @@ } |
{ | ||
"name": "react-native-keychain", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "Keychain Access for React Native", | ||
@@ -44,5 +44,5 @@ "main": "index.js", | ||
"devDependencies": { | ||
"flow-bin": "0.105.2", | ||
"flow-bin": "^0.107.0", | ||
"react-native": "^0.61.2" | ||
} | ||
} |
@@ -18,3 +18,3 @@ <h1 align="center">react-native-keychain</h1> | ||
- [`setGenericPassword(username, password, [{ accessControl, accessible, accessGroup, service, securityLevel }])`](#setgenericpasswordusername-password--accesscontrol-accessible-accessgroup-service-securitylevel-) | ||
- [`getGenericPassword([{ authenticationPrompt, service }])`](#getgenericpassword-authenticationprompt-service-) | ||
- [`getGenericPassword([{ authenticationPrompt, service, accessControl }])`](#getgenericpassword-authenticationprompt-service-accessControl-) | ||
- [`resetGenericPassword([{ service }])`](#resetgenericpassword-service-) | ||
@@ -110,3 +110,3 @@ - [`setInternetCredentials(server, username, password, [{ accessControl, accessible, accessGroup, securityLevel }])`](#setinternetcredentialsserver-username-password--accesscontrol-accessible-accessgroup-securitylevel-) | ||
### `getGenericPassword([{ authenticationPrompt, service }])` | ||
### `getGenericPassword([{ authenticationPrompt, service, accessControl }])` | ||
@@ -166,3 +166,3 @@ Will retrieve the username/password combination from the secure storage. Resolves to `{ username, password, service, storage }` if an entry exists or `false` if it doesn't. It will reject only if an unexpected error is encountered like lacking entitlements or permission. | ||
| **`accessGroup`** | iOS only | In which App Group to share the keychain. Requires additional setup with entitlements. | _None_ | | ||
| **`authenticationPrompt`** | iOS only | What to prompt the user when unlocking the keychain with biometry or device password. | See [`authenticationPrompt` Properties](#authenticationprompt-properties) | | ||
| **`authenticationPrompt`** | All | What to prompt the user when unlocking the keychain with biometry or device password. | See [`authenticationPrompt` Properties](#authenticationprompt-properties) | | ||
| **`authenticationType`** | iOS only | Policies specifying which forms of authentication are acceptable. | `Keychain.AUTHENTICATION_TYPE.DEVICE_PASSCODE_OR_BIOMETRICS` | | ||
@@ -196,3 +196,3 @@ | **`service`** | All | Reverse domain name qualifier for the service associated with password. | _App bundle ID_ | | ||
> | ||
> Note #2: For Android we support only two states: `None` (default) and `Fingerprint` (use only biometric protected storage); | ||
> Note #2: For Android we support only two states: `None` (default) and `Fingerprint` (use only biometric protected storage); `Face` recognition fails with "User not authenticated" exception, see issue #318 | ||
@@ -232,7 +232,9 @@ Refs: | ||
| Key | Description | | ||
| ----------------- | --------------------------------------------------------------- | | ||
| **`TOUCH_ID`** | Device supports authentication with Touch ID. (iOS only) | | ||
| **`FACE_ID`** | Device supports authentication with Face ID. (iOS only) | | ||
| **`FINGERPRINT`** | Device supports authentication with Fingerprint. (Android only) | | ||
| Key | Description | | ||
| ----------------- | -------------------------------------------------------------------- | | ||
| **`TOUCH_ID`** | Device supports authentication with Touch ID. (iOS only) | | ||
| **`FACE_ID`** | Device supports authentication with Face ID. (iOS only) | | ||
| **`FINGERPRINT`** | Device supports authentication with Fingerprint. (Android only) | | ||
| **`FACE`** | Device supports authentication with Face Recognition. (Android only) | | ||
| **`IRIS`** | Device supports authentication with Iris Recognition. (Android only) | | ||
@@ -276,14 +278,14 @@ Refs: | ||
> Scenario #1: User has a new phone and run on it application with this module and store secret on device. | ||
> Several days later user configured biometrics on the device and run application again. When user will try to access the secret, library will detect security enhancement and will upgrade secret storage to the best possible. | ||
> 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. | ||
--- | ||
Q: What will happens if user disable/drop biometrics usage? | ||
Q: What will happen if user disables/drops biometric usage? | ||
A: User will lost ability to extract secret from storage. On re-enable biometrics access to the secret will be possible to access again. | ||
A: User will lose ability to extract secret from storage. On re-enable biometric access to the secret will be possible again. | ||
--- | ||
Q: Is it possible any automatic downgrading? | ||
Q: Is it possible to implement automatic downgrading? | ||
@@ -290,0 +292,0 @@ A: From security perspective any Automatic downgrading is treated as "a loss of the trust" point. |
@@ -51,2 +51,4 @@ declare module 'react-native-keychain' { | ||
FINGERPRINT = 'Fingerprint', | ||
FACE = 'Face', | ||
IRIS = 'Iris', | ||
} | ||
@@ -83,3 +85,2 @@ | ||
rules?: SECURITY_RULES; | ||
promptInfoOptions?: PromptInfoOptions; | ||
} | ||
@@ -86,0 +87,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
215534
37
448
534