Skip to content

Commit 43245a8

Browse files
author
Jenkins
committed
7.1.317
1 parent 3bc8e91 commit 43245a8

File tree

418 files changed

+49005
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

418 files changed

+49005
-146
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/actions/verify-linked-issue/action.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/sast.yaml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/trivy-scan.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/verify-linked-issue.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.gitlab-ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
stages:
2+
- test
3+
- reports
4+
5+
include:
6+
- template: Jobs/SAST.gitlab-ci.yml
7+
- template: Jobs/Secret-Detection.gitlab-ci.yml
8+
- template: Jobs/Dependency-Scanning.gitlab-ci.yml
9+
- local: .gitlab/report.yaml
10+
rules:
11+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
12+
inputs:
13+
stage: reports
14+
image: ubuntu:22.04
15+
ignore_vulnerabilities: "false"
16+
sast_report_file: gl-sast-report.json
17+
secret_detection_report_file: gl-secret-detection-report.json
18+
dependency_scanning_report_file: gl-dependency-scanning-report.json
19+
20+
trivy scan:
21+
stage: test
22+
image: aquasec/trivy
23+
rules:
24+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
25+
script:
26+
- trivy fs --severity CRITICAL,HIGH,MEDIUM,LOW --ignore-unfixed --db-repository container-registry.regula.local:80/aquasecurity/trivy-db:2 --exit-code 1 .
27+
28+
semgrep-sast:
29+
rules:
30+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
31+
artifacts:
32+
paths:
33+
- gl-sast-report.json
34+
35+
secret_detection:
36+
rules:
37+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
38+
artifacts:
39+
paths:
40+
- gl-secret-detection-report.json
41+
42+
gemnasium-dependency_scanning:
43+
variables:
44+
DS_MAX_DEPTH: -1
45+
rules:
46+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
47+
artifacts:
48+
paths:
49+
- gl-dependency-scanning-report.json

.gitlab/report.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
spec:
2+
inputs:
3+
stage:
4+
default: reports
5+
image:
6+
default: ubuntu:22.04
7+
ignore_vulnerabilities:
8+
default: "false"
9+
sast_report_file:
10+
default: gl-sast-report.json
11+
secret_detection_report_file:
12+
default: gl-secret-detection-report.json
13+
dependency_scanning_report_file:
14+
default: gl-dependency-scanning-report.json
15+
---
16+
17+
view reports:
18+
image: $[[ inputs.image ]]
19+
stage: $[[ inputs.stage ]]
20+
variables:
21+
IGNORE_VULNERABILITIES: $[[ inputs.ignore_vulnerabilities ]]
22+
SAST_REPORT_FILE: $[[ inputs.sast_report_file ]]
23+
SECRET_DETECTION_REPORT_FILE: $[[ inputs.secret_detection_report_file ]]
24+
DEPENDENCY_SCANNING_REPORT_FILE: $[[ inputs.dependency_scanning_report_file ]]
25+
RED: \033[0;31m
26+
YELLOW: \033[1;33m
27+
GREEN: \033[0;32m
28+
NC: \033[0m
29+
needs:
30+
- job: semgrep-sast
31+
artifacts: true
32+
- job: secret_detection
33+
artifacts: true
34+
- job: gemnasium-dependency_scanning
35+
artifacts: true
36+
rules:
37+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
38+
script:
39+
- ls -la
40+
- apt update && apt install -y jq
41+
- |
42+
for f in SAST_REPORT_FILE SECRET_DETECTION_REPORT_FILE DEPENDENCY_SCANNING_REPORT_FILE
43+
do
44+
if [[ -f "${!f}" ]]
45+
then
46+
echo -e "${GREEN}File ${!f} exists, adding report${NC}"
47+
r=${f/%_FILE}
48+
declare $r="$(cat ${!f} | jq 'select(.vulnerabilities != []).vulnerabilities')"
49+
if [[ ! -z "${!r}" ]]
50+
then
51+
VULNERABILITIES_FOUND=true
52+
echo -e "${RED}Found $r vulnerabilities${NC}"
53+
echo "${!r}"
54+
echo
55+
fi
56+
else
57+
echo -e "${YELLOW}File ${!f} doesn't exist, skipping${NC}"
58+
fi
59+
done
60+
61+
if [[ "$VULNERABILITIES_FOUND" == true ]]
62+
then
63+
if [[ "$IGNORE_VULNERABILITIES" == true ]]
64+
then
65+
echo -e "${GREEN}All found vulnerabilities were ignored due to IGNORE_VULNERABILITIES=true${NC}"
66+
exit 0
67+
else
68+
echo -e "${RED}Vulnerabilities found, please see reports above${NC}"
69+
exit 1
70+
fi
71+
fi
72+
73+
echo -e "${GREEN}No vulnerabilities found${NC}"
74+
75+
exit 0

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
# npm-face-sdk
1+
# Regula Face SDK plugin
2+
Face SDK is a framework that is used for face matching, recognition and liveness detection.
3+
This plugin makes possible to use it with react-native, cordova and ionic applications.
4+
5+
## Demo applications
6+
In the [examples](examples/) folder you can find 4 demo applications:
7+
* [React-native](examples/react_native)
8+
* [Cordova](examples/cordova)
9+
* [Ionic(ionic app with cordova, angular)](examples/ionic)
10+
* [Capacitor(ionic app with capacitor, react)](examples/capacitor)
11+
12+
Each demo app has its own readme file with instructions on building and installation.
13+
14+
## Documentation
15+
* [Documentation](https://docs.regulaforensics.com/develop/face-sdk/mobile)
16+
* [API Reference](https://dev.regulaforensics.com/npm-face-sdk)
17+
18+
## Support
19+
If you have any technical questions, feel free to [contact](mailto:support@regulaforensics.com) us or create issues [here](https://github.com/regulaforensics/npm-face-sdk/issues).

RNFaceSDK.podspec

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
require 'json'
2+
3+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4+
source = File.join(__dir__, 'ios')
5+
6+
Pod::Spec.new do |s|
7+
s.name = 'RNFaceSDK'
8+
s.version = '7.1.317'
9+
s.summary = package['description']
10+
s.license = package['license']
11+
12+
s.authors = { 'RegulaForensics' => 'support@regulaforensics.com' }
13+
s.homepage = 'https://regulaforensics.com'
14+
15+
s.source = { http: "file:#{source}" }
16+
s.ios.deployment_target = '13.0'
17+
s.source_files = 'ios/**/*.{h,m}'
18+
s.exclude_files = [ 'ios/CVDFaceSDK.h', 'ios/CVDFaceSDK.m' ]
19+
s.dependency 'FaceSDK', '7.1.2736'
20+
s.dependency 'React'
21+
end

android/CVDFaceSDK.kt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.regula.plugin.facesdk
2+
3+
import android.content.Context
4+
import android.util.Log
5+
import org.apache.cordova.CallbackContext
6+
import org.apache.cordova.CordovaPlugin
7+
import org.apache.cordova.PluginResult
8+
import org.json.JSONArray
9+
10+
val eventCallbackIds = mutableMapOf<String, String>()
11+
12+
lateinit var args: JSONArray
13+
lateinit var binding: CordovaPlugin
14+
val context: Context
15+
get() = binding.cordova.context
16+
17+
fun sendEvent(callbackId: String, data: Any? = "") {
18+
val pluginResult = when (data) {
19+
is Int -> PluginResult(PluginResult.Status.OK, data)
20+
is Boolean -> PluginResult(PluginResult.Status.OK, data)
21+
else -> PluginResult(PluginResult.Status.OK, data.toSendable() as String?)
22+
}
23+
pluginResult.keepCallback = true
24+
binding.webView.sendPluginResult(pluginResult, eventCallbackIds[callbackId] ?: callbackId)
25+
}
26+
27+
@Suppress("UNCHECKED_CAST")
28+
fun <T> argsNullable(index: Int): T? = if (args.get(index).toString() != "null") {
29+
args.get(index) as T
30+
} else null
31+
32+
class CVDFaceSDK : CordovaPlugin() {
33+
init {
34+
binding = this
35+
}
36+
37+
override fun execute(action: String, arguments: JSONArray, callbackContext: CallbackContext): Boolean {
38+
args = arguments
39+
val method = args.remove(0) as String
40+
if (method == "setEvent") eventCallbackIds[args(0)] = callbackContext.callbackId
41+
try {
42+
methodCall(method) { data: Any? -> sendEvent(callbackContext.callbackId, data) }
43+
} catch (error: Exception) {
44+
Log.e("REGULA", "Caught exception in \"$method\" function:", error)
45+
}
46+
return true
47+
}
48+
}

0 commit comments

Comments
 (0)