react-native-credentials-manager 0.2.0
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 +20 -0
- package/README.md +258 -0
- package/android/build.gradle +116 -0
- package/android/generated/RCTAppDependencyProvider.h +25 -0
- package/android/generated/RCTAppDependencyProvider.mm +55 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/android/generated/ReactAppDependencyProvider.podspec +34 -0
- package/android/generated/java/com/credentialsmanager/NativeCredentialsManagerSpec.java +47 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNCredentialsManagerSpec-generated.cpp +44 -0
- package/android/generated/jni/RNCredentialsManagerSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNCredentialsManagerSpec/RNCredentialsManagerSpecJSI-generated.cpp +43 -0
- package/android/generated/jni/react/renderer/components/RNCredentialsManagerSpec/RNCredentialsManagerSpecJSI.h +136 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/credentialsmanager/CredentialsManagerModule.kt +212 -0
- package/android/src/main/java/com/credentialsmanager/CredentialsManagerPackage.kt +35 -0
- package/ios/CredentialsManager.h +6 -0
- package/ios/CredentialsManager.mm +18 -0
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNCredentialsManagerSpec/RNCredentialsManagerSpec-generated.mm +58 -0
- package/ios/generated/RNCredentialsManagerSpec/RNCredentialsManagerSpec.h +93 -0
- package/ios/generated/RNCredentialsManagerSpecJSI-generated.cpp +43 -0
- package/ios/generated/RNCredentialsManagerSpecJSI.h +136 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/commonjs/NativeCredentialsManager.js +9 -0
- package/lib/commonjs/NativeCredentialsManager.js.map +1 -0
- package/lib/commonjs/index.js +26 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/j.js +9 -0
- package/lib/commonjs/j.js.map +1 -0
- package/lib/module/NativeCredentialsManager.js +5 -0
- package/lib/module/NativeCredentialsManager.js.map +1 -0
- package/lib/module/index.js +19 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/j.js +5 -0
- package/lib/module/j.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/NativeCredentialsManager.d.ts +23 -0
- package/lib/typescript/commonjs/src/NativeCredentialsManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +8 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/NativeCredentialsManager.d.ts +23 -0
- package/lib/typescript/module/src/NativeCredentialsManager.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +8 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +228 -0
- package/react-native-credentials-manager.podspec +42 -0
- package/react-native.config.js +12 -0
- package/src/NativeCredentialsManager.ts +32 -0
- package/src/index.tsx +28 -0
- package/src/j.js +33 -0
package/package.json
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-credentials-manager",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A React Native library that implements the Credential Manager API for Android. This library allows you to manage passwords and passkeys in your React Native applications.",
|
|
5
|
+
"source": "./src/index.tsx",
|
|
6
|
+
"main": "./lib/commonjs/index.js",
|
|
7
|
+
"module": "./lib/module/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
12
|
+
"default": "./lib/module/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
+
"default": "./lib/commonjs/index.js"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"src",
|
|
22
|
+
"lib",
|
|
23
|
+
"android",
|
|
24
|
+
"ios",
|
|
25
|
+
"cpp",
|
|
26
|
+
"*.podspec",
|
|
27
|
+
"react-native.config.js",
|
|
28
|
+
"!ios/build",
|
|
29
|
+
"!android/build",
|
|
30
|
+
"!android/gradle",
|
|
31
|
+
"!android/gradlew",
|
|
32
|
+
"!android/gradlew.bat",
|
|
33
|
+
"!android/local.properties",
|
|
34
|
+
"!**/__tests__",
|
|
35
|
+
"!**/__fixtures__",
|
|
36
|
+
"!**/__mocks__",
|
|
37
|
+
"!**/.*"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"example": "yarn workspace react-native-credentials-manager-example",
|
|
41
|
+
"test": "jest",
|
|
42
|
+
"typecheck": "tsc",
|
|
43
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
44
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
45
|
+
"prepare": "bob build",
|
|
46
|
+
"release": "release-it"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"react-native",
|
|
50
|
+
"ios",
|
|
51
|
+
"android"
|
|
52
|
+
],
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/benjamineruvieru/react-native-credentials-manager.git"
|
|
56
|
+
},
|
|
57
|
+
"author": "Benjamin <benjamineruvieru@gmail.com> (https://github.com/benjamineruvieru)",
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/benjamineruvieru/react-native-credentials-manager/issues"
|
|
61
|
+
},
|
|
62
|
+
"homepage": "https://github.com/benjamineruvieru/react-native-credentials-manager#readme",
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"registry": "https://registry.npmjs.org/"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
68
|
+
"@evilmartians/lefthook": "^1.5.0",
|
|
69
|
+
"@react-native-community/cli": "15.0.1",
|
|
70
|
+
"@react-native/eslint-config": "^0.73.1",
|
|
71
|
+
"@release-it/conventional-changelog": "^9.0.2",
|
|
72
|
+
"@types/jest": "^29.5.5",
|
|
73
|
+
"@types/react": "^18.2.44",
|
|
74
|
+
"commitlint": "^17.0.2",
|
|
75
|
+
"del-cli": "^5.1.0",
|
|
76
|
+
"eslint": "^8.51.0",
|
|
77
|
+
"eslint-config-prettier": "^9.0.0",
|
|
78
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
79
|
+
"flow-bin": "^0.259.1",
|
|
80
|
+
"jest": "^29.7.0",
|
|
81
|
+
"prettier": "^3.0.3",
|
|
82
|
+
"react": "18.3.1",
|
|
83
|
+
"react-native": "0.77.0",
|
|
84
|
+
"react-native-builder-bob": "^0.32.0",
|
|
85
|
+
"release-it": "^17.10.0",
|
|
86
|
+
"turbo": "^1.10.7",
|
|
87
|
+
"typescript": "^5.2.2"
|
|
88
|
+
},
|
|
89
|
+
"resolutions": {
|
|
90
|
+
"@types/react": "^18.2.44"
|
|
91
|
+
},
|
|
92
|
+
"peerDependencies": {
|
|
93
|
+
"react": "*",
|
|
94
|
+
"react-native": "*"
|
|
95
|
+
},
|
|
96
|
+
"workspaces": [
|
|
97
|
+
"example"
|
|
98
|
+
],
|
|
99
|
+
"packageManager": "yarn@3.6.1",
|
|
100
|
+
"jest": {
|
|
101
|
+
"preset": "react-native",
|
|
102
|
+
"modulePathIgnorePatterns": [
|
|
103
|
+
"<rootDir>/example/node_modules",
|
|
104
|
+
"<rootDir>/lib/"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"commitlint": {
|
|
108
|
+
"extends": [
|
|
109
|
+
"@commitlint/config-conventional"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"release-it": {
|
|
113
|
+
"git": {
|
|
114
|
+
"commitMessage": "chore: release ${version}",
|
|
115
|
+
"tagName": "v${version}"
|
|
116
|
+
},
|
|
117
|
+
"npm": {
|
|
118
|
+
"publish": true
|
|
119
|
+
},
|
|
120
|
+
"github": {
|
|
121
|
+
"release": true
|
|
122
|
+
},
|
|
123
|
+
"plugins": {
|
|
124
|
+
"@release-it/conventional-changelog": {
|
|
125
|
+
"preset": {
|
|
126
|
+
"name": "conventionalcommits",
|
|
127
|
+
"types": [
|
|
128
|
+
{
|
|
129
|
+
"type": "feat",
|
|
130
|
+
"section": "✨ Features"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"type": "fix",
|
|
134
|
+
"section": "🐛 Bug Fixes"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"type": "perf",
|
|
138
|
+
"section": "💨 Performance Improvements"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"type": "chore(deps)",
|
|
142
|
+
"section": "🛠️ Dependency Upgrades"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"type": "docs",
|
|
146
|
+
"section": "📚 Documentation"
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"eslintConfig": {
|
|
154
|
+
"root": true,
|
|
155
|
+
"extends": [
|
|
156
|
+
"@react-native",
|
|
157
|
+
"prettier"
|
|
158
|
+
],
|
|
159
|
+
"rules": {
|
|
160
|
+
"react/react-in-jsx-scope": "off",
|
|
161
|
+
"prettier/prettier": [
|
|
162
|
+
"error",
|
|
163
|
+
{
|
|
164
|
+
"quoteProps": "consistent",
|
|
165
|
+
"singleQuote": true,
|
|
166
|
+
"tabWidth": 2,
|
|
167
|
+
"trailingComma": "es5",
|
|
168
|
+
"useTabs": false
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"eslintIgnore": [
|
|
174
|
+
"node_modules/",
|
|
175
|
+
"lib/"
|
|
176
|
+
],
|
|
177
|
+
"prettier": {
|
|
178
|
+
"quoteProps": "consistent",
|
|
179
|
+
"singleQuote": true,
|
|
180
|
+
"tabWidth": 2,
|
|
181
|
+
"trailingComma": "es5",
|
|
182
|
+
"useTabs": false
|
|
183
|
+
},
|
|
184
|
+
"react-native-builder-bob": {
|
|
185
|
+
"source": "src",
|
|
186
|
+
"output": "lib",
|
|
187
|
+
"targets": [
|
|
188
|
+
"codegen",
|
|
189
|
+
[
|
|
190
|
+
"commonjs",
|
|
191
|
+
{
|
|
192
|
+
"esm": true
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
[
|
|
196
|
+
"module",
|
|
197
|
+
{
|
|
198
|
+
"esm": true
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
[
|
|
202
|
+
"typescript",
|
|
203
|
+
{
|
|
204
|
+
"project": "tsconfig.build.json",
|
|
205
|
+
"esm": true
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"codegenConfig": {
|
|
211
|
+
"name": "RNCredentialsManagerSpec",
|
|
212
|
+
"type": "modules",
|
|
213
|
+
"jsSrcsDir": "src",
|
|
214
|
+
"outputDir": {
|
|
215
|
+
"ios": "ios/generated",
|
|
216
|
+
"android": "android/generated"
|
|
217
|
+
},
|
|
218
|
+
"android": {
|
|
219
|
+
"javaPackageName": "com.credentialsmanager"
|
|
220
|
+
},
|
|
221
|
+
"includesGeneratedCode": true
|
|
222
|
+
},
|
|
223
|
+
"create-react-native-library": {
|
|
224
|
+
"type": "turbo-module",
|
|
225
|
+
"languages": "kotlin-objc",
|
|
226
|
+
"version": "0.47.0"
|
|
227
|
+
}
|
|
228
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
|
+
|
|
6
|
+
Pod::Spec.new do |s|
|
|
7
|
+
s.name = "react-native-credentials-manager"
|
|
8
|
+
s.version = package["version"]
|
|
9
|
+
s.summary = package["description"]
|
|
10
|
+
s.homepage = package["homepage"]
|
|
11
|
+
s.license = package["license"]
|
|
12
|
+
s.authors = package["author"]
|
|
13
|
+
|
|
14
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
15
|
+
s.source = { :git => "https://github.com/benjamineruvieru/react-native-credentials-manager.git", :tag => "#{s.version}" }
|
|
16
|
+
|
|
17
|
+
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
|
18
|
+
s.private_header_files = "ios/generated/**/*.h"
|
|
19
|
+
|
|
20
|
+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
21
|
+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
22
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
23
|
+
install_modules_dependencies(s)
|
|
24
|
+
else
|
|
25
|
+
s.dependency "React-Core"
|
|
26
|
+
|
|
27
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
29
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
30
|
+
s.pod_target_xcconfig = {
|
|
31
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
32
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
33
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
34
|
+
}
|
|
35
|
+
s.dependency "React-Codegen"
|
|
36
|
+
s.dependency "RCT-Folly"
|
|
37
|
+
s.dependency "RCTRequired"
|
|
38
|
+
s.dependency "RCTTypeSafety"
|
|
39
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
|
|
4
|
+
type CredObject = {
|
|
5
|
+
username: string;
|
|
6
|
+
password: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type PasskeyCredential = {
|
|
10
|
+
type: 'passkey';
|
|
11
|
+
authenticationResponseJson: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type PasswordCredential = {
|
|
15
|
+
type: 'password';
|
|
16
|
+
username: string;
|
|
17
|
+
password: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type Credential = PasskeyCredential | PasswordCredential;
|
|
21
|
+
|
|
22
|
+
export interface Spec extends TurboModule {
|
|
23
|
+
signUpWithPasskeys(
|
|
24
|
+
requestJson: Object,
|
|
25
|
+
preferImmediatelyAvailableCredentials: boolean
|
|
26
|
+
): Promise<Object>;
|
|
27
|
+
signUpWithPassword(credObject: CredObject): void;
|
|
28
|
+
|
|
29
|
+
signInWithSavedCredentials(requestJson: Object): Promise<Credential>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('CredentialsManager');
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import CredentialsManager from './NativeCredentialsManager';
|
|
2
|
+
import type { Credential } from './NativeCredentialsManager';
|
|
3
|
+
|
|
4
|
+
export function signUpWithPasskeys(
|
|
5
|
+
requestJson: Object,
|
|
6
|
+
preferImmediatelyAvailableCredentials: boolean = false
|
|
7
|
+
): Promise<Object> {
|
|
8
|
+
return CredentialsManager.signUpWithPasskeys(
|
|
9
|
+
requestJson,
|
|
10
|
+
preferImmediatelyAvailableCredentials
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function signUpWithPassword({
|
|
15
|
+
username,
|
|
16
|
+
password,
|
|
17
|
+
}: {
|
|
18
|
+
username: string;
|
|
19
|
+
password: string;
|
|
20
|
+
}) {
|
|
21
|
+
CredentialsManager.signUpWithPassword({ password, username });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function signInWithSavedCredentials(
|
|
25
|
+
requestJson: Object
|
|
26
|
+
): Promise<Credential> {
|
|
27
|
+
return CredentialsManager.signInWithSavedCredentials(requestJson);
|
|
28
|
+
}
|
package/src/j.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
import type { TurboModule } from 'react-native';
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
type CredObject = {
|
|
6
|
+
username: string,
|
|
7
|
+
password: string,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type PasskeyCredential = {
|
|
11
|
+
type: 'passkey',
|
|
12
|
+
authenticationResponseJson: string,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type PasswordCredential = {
|
|
16
|
+
type: 'password',
|
|
17
|
+
username: string,
|
|
18
|
+
password: string,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type Credential = PasskeyCredential | PasswordCredential;
|
|
22
|
+
|
|
23
|
+
export interface Spec extends TurboModule {
|
|
24
|
+
signUpWithPasskeys(
|
|
25
|
+
requestJson: Object,
|
|
26
|
+
preferImmediatelyAvailableCredentials: boolean
|
|
27
|
+
): Promise<Object>;
|
|
28
|
+
signUpWithPassword(credObject: CredObject): void;
|
|
29
|
+
|
|
30
|
+
signInWithSavedCredentials(requestJson: Object): Promise<Credential>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('CredentialsManager');
|