capacitor-secure-storage-plugin 0.6.4-testing → 0.7.1

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 CHANGED
@@ -3,20 +3,19 @@
3
3
  Capacitor plugin for storing string values securly on iOS and Android.
4
4
 
5
5
  ## How to install
6
+
6
7
  For Capacitor v3
7
8
 
8
9
  ```
9
10
  npm install capacitor-secure-storage-plugin
10
11
  ```
11
12
 
12
-
13
13
  For Capacitor v2 - install with fixed version 0.5.1
14
14
 
15
15
  ```
16
16
  npm install capacitor-secure-storage-plugin@0.5.1
17
17
  ```
18
18
 
19
-
20
19
  ## Usage
21
20
 
22
21
  For Capacitor v3
@@ -73,9 +72,11 @@ public class MainActivity extends BridgeActivity {
73
72
 
74
73
  * **keys**(): Promise<{ value: string[] }>
75
74
  * **set**(options: { key: string; value: string }): Promise<{ value: boolean }>
75
+ - return true in case of success otherwise throws an error
76
76
  * **remove**(options: { key: string }): Promise<{ value: boolean }>
77
+ - return true in case of success otherwise throws an error
77
78
  * **clear**(): Promise<{ value: boolean }>
78
- - set, remove and clear return true in case of success and false in case of error
79
+ - return true in case of success otherwise throws an error
79
80
 
80
81
  - **getPlatform**(): Promise<{ value: string }>
81
82
  - returns which implementation is used - one of 'web', 'ios' or 'android'
@@ -13,7 +13,7 @@ public class SecureStoragePlugin: CAPPlugin {
13
13
  @objc func set(_ call: CAPPluginCall) {
14
14
  let key = call.getString("key") ?? ""
15
15
  let value = call.getString("value") ?? ""
16
- let saveSuccessful: Bool = keychainwrapper.set(value, forKey: key, withAccessibility: .always)
16
+ let saveSuccessful: Bool = keychainwrapper.set(value, forKey: key, withAccessibility: .afterFirstUnlock)
17
17
  if(saveSuccessful) {
18
18
  call.resolve([
19
19
  "value": saveSuccessful
@@ -34,7 +34,7 @@ public class SecureStoragePlugin: CAPPlugin {
34
34
  let syncValueSuccessful: Bool = keychainwrapper.set(
35
35
  KeychainWrapper.standard.string(forKey: key) ?? "",
36
36
  forKey: key,
37
- withAccessibility: .always
37
+ withAccessibility: .afterFirstUnlock
38
38
  )
39
39
  let removeValueSuccessful: Bool = KeychainWrapper.standard.removeObject(forKey: key)
40
40
  if (!syncValueSuccessful || !removeValueSuccessful) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-secure-storage-plugin",
3
- "version": "0.6.4-testing",
3
+ "version": "0.7.1",
4
4
  "description": "Securely store secrets such as usernames, passwords, tokens, certificates or other sensitive information (strings) on iOS & Android",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
package/CHANGELOG.md DELETED
@@ -1,39 +0,0 @@
1
- ## v0.6.2
2
-
3
- - fix keys() serialization error on Android
4
-
5
- ## v0.6.1
6
-
7
- - fix keys() serializable error on iOS
8
-
9
- ## v0.6.0
10
-
11
- - migrate to capacitor 3.0
12
- - for Capacitor 2.X.X install vesrion v0.5.1
13
-
14
- - `npm install capacitor-secure-storage-plugin@0.5.1`
15
-
16
- - import plugin in web project in Capacitor v3 is `import { SecureStoragePlugin } from 'capacitor-secure-storage-plugin';` directly, instead of import of Plugins from capacitor/core
17
-
18
- ## v0.5.1
19
-
20
- - fix Capacitor version to 2.X.X
21
-
22
- ## v0.5.0
23
-
24
- - added keys() method - warning: returns just keys saved from this version up
25
- - iOS: instead on standard keychain, wrapper service is used
26
- - migration is not needed, plugin saves new values to wrapped keychain and get method uses standard keychain as a fallback
27
-
28
- ## v0.4.0
29
-
30
- - rebased on Capacitor v2 plugin template
31
- - added getPlatform() method
32
-
33
- ## v0.3.2
34
-
35
- - update Capacitor dependencies
36
-
37
- ## v0.3.1
38
-
39
- - fix long string handling