nitro-keychain 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/README.md +15 -2
- package/nitro.json +21 -0
- package/package.json +36 -4
- package/src/enums.ts +62 -0
- package/src/index.ts +2 -0
- package/src/types.ts +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dorian Mazur
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# nitro-keychain
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Secure credential storage (**iOS Keychain** & **Android Keystore**) built for [NitroUI](https://github.com/margelo/nitro-ui) using Nitro `HybridObject` bindings.
|
|
4
|
+
|
|
5
|
+
> **Status:** Early work in progress (`0.0.1`). Initial TypeScript types and Nitro module metadata are included; Swift (iOS) and Kotlin (Android) native implementations are under active development.
|
|
6
|
+
|
|
7
|
+
## Planned features
|
|
8
|
+
|
|
9
|
+
- Generic and internet credential storage (`setGenericPassword`, `getGenericPassword`, `resetGenericPassword`, `hasGenericPassword`)
|
|
10
|
+
- iOS Keychain (`Security.framework` + `LocalAuthentication`) via SwiftPM
|
|
11
|
+
- Android Keystore + DataStore + `BiometricPrompt` via Kotlin & `NitroActivityInitializer`
|
|
12
|
+
- Biometry & security-level inspection (`getSupportedBiometryType`, `getSecurityLevel`)
|
|
13
|
+
|
|
14
|
+
## License
|
|
15
|
+
|
|
16
|
+
MIT
|
package/nitro.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://nitro.margelo.com/nitro.schema.json",
|
|
3
|
+
"environment": "bare",
|
|
4
|
+
"cxxNamespace": [
|
|
5
|
+
"keychain"
|
|
6
|
+
],
|
|
7
|
+
"apple": {
|
|
8
|
+
"moduleName": "NitroKeychain"
|
|
9
|
+
},
|
|
10
|
+
"android": {
|
|
11
|
+
"namespace": [
|
|
12
|
+
"keychain"
|
|
13
|
+
],
|
|
14
|
+
"cxxLibName": "NitroKeychain"
|
|
15
|
+
},
|
|
16
|
+
"ignorePaths": [
|
|
17
|
+
"**/node_modules",
|
|
18
|
+
"**/.build",
|
|
19
|
+
"**/.swiftpm"
|
|
20
|
+
]
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-keychain",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Secure credential storage (iOS Keychain and Android Keystore) for NitroUI.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"nitro",
|
|
7
|
+
"nitro-ui",
|
|
8
|
+
"nitro-modules",
|
|
9
|
+
"keychain",
|
|
10
|
+
"keystore",
|
|
11
|
+
"biometrics",
|
|
12
|
+
"credentials",
|
|
13
|
+
"secure-storage",
|
|
14
|
+
"ios",
|
|
15
|
+
"android"
|
|
16
|
+
],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "Dorian Mazur",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"module": "src/index.ts",
|
|
21
|
+
"types": "src/index.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./src/index.ts",
|
|
25
|
+
"default": "./src/index.ts"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"src",
|
|
31
|
+
"nitro.json",
|
|
32
|
+
"README.md",
|
|
33
|
+
"LICENSE"
|
|
34
|
+
],
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/enums.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When a keychain item is accessible (iOS).
|
|
3
|
+
*/
|
|
4
|
+
export enum ACCESSIBLE {
|
|
5
|
+
WHEN_UNLOCKED = 'AccessibleWhenUnlocked',
|
|
6
|
+
AFTER_FIRST_UNLOCK = 'AccessibleAfterFirstUnlock',
|
|
7
|
+
ALWAYS = 'AccessibleAlways',
|
|
8
|
+
WHEN_PASSCODE_SET_THIS_DEVICE_ONLY = 'AccessibleWhenPasscodeSetThisDeviceOnly',
|
|
9
|
+
WHEN_UNLOCKED_THIS_DEVICE_ONLY = 'AccessibleWhenUnlockedThisDeviceOnly',
|
|
10
|
+
AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY = 'AccessibleAfterFirstUnlockThisDeviceOnly',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Access control constraints for stored credentials.
|
|
15
|
+
*/
|
|
16
|
+
export enum ACCESS_CONTROL {
|
|
17
|
+
USER_PRESENCE = 'UserPresence',
|
|
18
|
+
BIOMETRY_ANY = 'BiometryAny',
|
|
19
|
+
BIOMETRY_CURRENT_SET = 'BiometryCurrentSet',
|
|
20
|
+
DEVICE_PASSCODE = 'DevicePasscode',
|
|
21
|
+
APPLICATION_PASSWORD = 'ApplicationPassword',
|
|
22
|
+
BIOMETRY_ANY_OR_DEVICE_PASSCODE = 'BiometryAnyOrDevicePasscode',
|
|
23
|
+
BIOMETRY_CURRENT_SET_OR_DEVICE_PASSCODE = 'BiometryCurrentSetOrDevicePasscode',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Supported authentication types.
|
|
28
|
+
*/
|
|
29
|
+
export enum AUTHENTICATION_TYPE {
|
|
30
|
+
DEVICE_PASSCODE_OR_BIOMETRICS = 'AuthenticationWithBiometricsDevicePasscode',
|
|
31
|
+
BIOMETRICS = 'AuthenticationWithBiometrics',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Security levels for Android Keystore storage.
|
|
36
|
+
*/
|
|
37
|
+
export enum SECURITY_LEVEL {
|
|
38
|
+
SECURE_SOFTWARE = 'SECURE_SOFTWARE',
|
|
39
|
+
SECURE_HARDWARE = 'SECURE_HARDWARE',
|
|
40
|
+
ANY = 'ANY',
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Biometry types supported by the device.
|
|
45
|
+
*/
|
|
46
|
+
export enum BIOMETRY_TYPE {
|
|
47
|
+
TOUCH_ID = 'TouchID',
|
|
48
|
+
FACE_ID = 'FaceID',
|
|
49
|
+
OPTIC_ID = 'OpticID',
|
|
50
|
+
FINGERPRINT = 'Fingerprint',
|
|
51
|
+
FACE = 'Face',
|
|
52
|
+
IRIS = 'Iris',
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Cryptographic storage implementations on Android.
|
|
57
|
+
*/
|
|
58
|
+
export enum STORAGE_TYPE {
|
|
59
|
+
AES_GCM = 'KeystoreAESGCM',
|
|
60
|
+
AES_GCM_NO_AUTH = 'KeystoreAESGCM_NoAuth',
|
|
61
|
+
RSA = 'KeystoreRSAECB',
|
|
62
|
+
}
|
package/src/index.ts
ADDED
package/src/types.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ACCESS_CONTROL,
|
|
3
|
+
ACCESSIBLE,
|
|
4
|
+
AUTHENTICATION_TYPE,
|
|
5
|
+
SECURITY_LEVEL,
|
|
6
|
+
STORAGE_TYPE,
|
|
7
|
+
} from './enums'
|
|
8
|
+
|
|
9
|
+
export interface AuthenticationPrompt {
|
|
10
|
+
title?: string
|
|
11
|
+
subtitle?: string
|
|
12
|
+
description?: string
|
|
13
|
+
cancel?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface BaseOptions {
|
|
17
|
+
service?: string
|
|
18
|
+
accessGroup?: string
|
|
19
|
+
cloudSync?: boolean
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface SetOptions extends BaseOptions {
|
|
23
|
+
accessible?: ACCESSIBLE
|
|
24
|
+
accessControl?: ACCESS_CONTROL
|
|
25
|
+
authenticationType?: AUTHENTICATION_TYPE
|
|
26
|
+
securityLevel?: SECURITY_LEVEL
|
|
27
|
+
storage?: STORAGE_TYPE
|
|
28
|
+
authenticationPrompt?: AuthenticationPrompt
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface GetOptions extends BaseOptions {
|
|
32
|
+
authenticationType?: AUTHENTICATION_TYPE
|
|
33
|
+
authenticationPrompt?: AuthenticationPrompt
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface Result {
|
|
37
|
+
service: string
|
|
38
|
+
storage: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface UserCredentials extends Result {
|
|
42
|
+
username: string
|
|
43
|
+
password: string
|
|
44
|
+
}
|