Skip to content

Commit f8775c9

Browse files
Merge pull request #145 from regulaforensics/develop
develop -> master
2 parents 9d249ed + 22a9dab commit f8775c9

17 files changed

+440
-283
lines changed

.github/workflows/sast.yaml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Semgrep SAST
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- staging
8+
- production
9+
- stable
10+
- main
11+
- master
12+
13+
env:
14+
# Fail workflow or not if vulnerabilities found
15+
FAIL_ON_VULNERABILITIES: true
16+
# List of paths (space separated) to ignore
17+
# Supports PATTERNS
18+
# EXCLUDE_PATHS: 'foo bar/baz file.txt dir/*.yml'
19+
EXCLUDE_PATHS: ''
20+
# List of rules (space separated) to ignore
21+
# EXCLUDE_RULES: 'generic.secrets.security.detected-aws-account-id.detected-aws-account-id'
22+
# See https://github.com/semgrep/semgrep-rules for rules registry
23+
EXCLUDE_RULES: ''
24+
25+
jobs:
26+
semgrep:
27+
name: semgrep-oss/scan
28+
runs-on: ubuntu-latest
29+
container:
30+
image: semgrep/semgrep
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Scan
34+
shell: bash
35+
run: |
36+
EXCLUDED_PATHS=()
37+
if [[ ! -z $EXCLUDE_PATHS ]]; then
38+
for path in $EXCLUDE_PATHS; do
39+
EXCLUDED_PATHS+=("--exclude $path")
40+
done
41+
fi
42+
43+
EXCLUDED_RULES=()
44+
if [[ ! -z $EXCLUDE_RULES ]]; then
45+
for rule in $EXCLUDE_RULES; do
46+
EXCLUDED_RULES+=("--exclude-rule $rule")
47+
done
48+
fi
49+
50+
if [[ $FAIL_ON_VULNERABILITIES == "true" ]]; then
51+
semgrep scan --config auto ${EXCLUDED_PATHS[@]} ${EXCLUDED_RULES[@]} --error --verbose
52+
elif [[ $FAIL_ON_VULNERABILITIES == "false" ]]; then
53+
semgrep scan --config auto ${EXCLUDED_PATHS[@]} ${EXCLUDED_RULES[@]} --error --verbose || true
54+
else
55+
echo "Bad FAIL_ON_VULNERABILITIES env var value"
56+
exit 1
57+
fi
58+

.openapi-generator/FILES

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ regula/documentreader/webclient/gen/models/lexical_analysis_result_all_of.py
8888
regula/documentreader/webclient/gen/models/license_result.py
8989
regula/documentreader/webclient/gen/models/license_result_all_of.py
9090
regula/documentreader/webclient/gen/models/light.py
91+
regula/documentreader/webclient/gen/models/list_transactions_by_tag_response.py
9192
regula/documentreader/webclient/gen/models/list_verified_fields.py
9293
regula/documentreader/webclient/gen/models/liveness_params.py
9394
regula/documentreader/webclient/gen/models/log_level.py

Pipfile

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ requests = ">=2.32.3"
1414

1515
[dev-packages]
1616
setuptools = ">=21.0.0"
17-
pipenv-setup = "*"
1817
wheel = "*"
1918
twine = "*"
2019
chardet = "*"

Pipfile.lock

+53-204
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

regula/documentreader/webclient/ext/models/raw_authenticity_result_item.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class RawAuthenticityCheckResultItem(AuthenticityCheckResultItem):
1010
attribute_map = copy(AuthenticityCheckResultItem.attribute_map)
1111
attribute_map["raw"] = "raw"
1212

13-
def __init__(self, type=0, element_result=None, element_diagnose=None, raw=None, local_vars_configuration=None):
14-
super().__init__(type, element_result, element_diagnose, local_vars_configuration)
13+
def __init__(self, type=0, element_result=None, element_diagnose=None, raw=None, percent_value=None, local_vars_configuration=None):
14+
super().__init__(type, element_result, element_diagnose, percent_value, local_vars_configuration)
1515
self.__raw = raw
1616

1717
@property

regula/documentreader/webclient/gen/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
from regula.documentreader.webclient.gen.models.license_result import LicenseResult
107107
from regula.documentreader.webclient.gen.models.license_result_all_of import LicenseResultAllOf
108108
from regula.documentreader.webclient.gen.models.light import Light
109+
from regula.documentreader.webclient.gen.models.list_transactions_by_tag_response import ListTransactionsByTagResponse
109110
from regula.documentreader.webclient.gen.models.list_verified_fields import ListVerifiedFields
110111
from regula.documentreader.webclient.gen.models.liveness_params import LivenessParams
111112
from regula.documentreader.webclient.gen.models.log_level import LogLevel

regula/documentreader/webclient/gen/api/transaction_api.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def api_v2_tag_tag_id_transactions_get(self, tag_id, **kwargs): # noqa: E501
175175
>>> result = thread.get()
176176
177177
:param tag_id: Tag id (required)
178-
:type tag_id: int
178+
:type tag_id: str
179179
:param async_req: Whether to execute the request asynchronously.
180180
:type async_req: bool, optional
181181
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -189,7 +189,7 @@ def api_v2_tag_tag_id_transactions_get(self, tag_id, **kwargs): # noqa: E501
189189
:return: Returns the result object.
190190
If the method is called asynchronously,
191191
returns the request thread.
192-
:rtype: list[GetTransactionsByTagResponse]
192+
:rtype: ListTransactionsByTagResponse
193193
"""
194194
kwargs['_return_http_data_only'] = True
195195
return self.api_v2_tag_tag_id_transactions_get_with_http_info(tag_id, **kwargs) # noqa: E501
@@ -204,7 +204,7 @@ def api_v2_tag_tag_id_transactions_get_with_http_info(self, tag_id, **kwargs):
204204
>>> result = thread.get()
205205
206206
:param tag_id: Tag id (required)
207-
:type tag_id: int
207+
:type tag_id: str
208208
:param async_req: Whether to execute the request asynchronously.
209209
:type async_req: bool, optional
210210
:param _return_http_data_only: response data without head status code
@@ -225,7 +225,7 @@ def api_v2_tag_tag_id_transactions_get_with_http_info(self, tag_id, **kwargs):
225225
:return: Returns the result object.
226226
If the method is called asynchronously,
227227
returns the request thread.
228-
:rtype: tuple(list[GetTransactionsByTagResponse], status_code(int), headers(HTTPHeaderDict))
228+
:rtype: tuple(ListTransactionsByTagResponse, status_code(int), headers(HTTPHeaderDict))
229229
"""
230230

231231
local_var_params = locals()
@@ -278,7 +278,7 @@ def api_v2_tag_tag_id_transactions_get_with_http_info(self, tag_id, **kwargs):
278278
auth_settings = [] # noqa: E501
279279

280280
response_types_map = {
281-
200: "list[GetTransactionsByTagResponse]",
281+
200: "ListTransactionsByTagResponse",
282282
400: None,
283283
403: None,
284284
}

regula/documentreader/webclient/gen/models/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
from regula.documentreader.webclient.gen.models.license_result import LicenseResult
9090
from regula.documentreader.webclient.gen.models.license_result_all_of import LicenseResultAllOf
9191
from regula.documentreader.webclient.gen.models.light import Light
92+
from regula.documentreader.webclient.gen.models.list_transactions_by_tag_response import ListTransactionsByTagResponse
9293
from regula.documentreader.webclient.gen.models.list_verified_fields import ListVerifiedFields
9394
from regula.documentreader.webclient.gen.models.liveness_params import LivenessParams
9495
from regula.documentreader.webclient.gen.models.log_level import LogLevel

regula/documentreader/webclient/gen/models/authenticity_check_result_item.py

+29-3
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ class AuthenticityCheckResultItem(object):
3434
openapi_types = {
3535
'type': 'int',
3636
'element_result': 'CheckResult',
37-
'element_diagnose': 'CheckDiagnose'
37+
'element_diagnose': 'CheckDiagnose',
38+
'percent_value': 'int'
3839
}
3940

4041
attribute_map = {
4142
'type': 'Type',
4243
'element_result': 'ElementResult',
43-
'element_diagnose': 'ElementDiagnose'
44+
'element_diagnose': 'ElementDiagnose',
45+
'percent_value': 'PercentValue'
4446
}
4547
discriminator_value_class_map = {
4648
1 : 'SecurityFeatureResult',
@@ -67,7 +69,7 @@ class AuthenticityCheckResultItem(object):
6769
8388608 : 'SecurityFeatureResult',
6870
}
6971

70-
def __init__(self, type=0, element_result=None, element_diagnose=None, local_vars_configuration=None): # noqa: E501
72+
def __init__(self, type=0, element_result=None, element_diagnose=None, percent_value=None, local_vars_configuration=None): # noqa: E501
7173
"""AuthenticityCheckResultItem - a model defined in OpenAPI""" # noqa: E501
7274
if local_vars_configuration is None:
7375
local_vars_configuration = Configuration()
@@ -76,13 +78,16 @@ def __init__(self, type=0, element_result=None, element_diagnose=None, local_var
7678
self._type = None
7779
self._element_result = None
7880
self._element_diagnose = None
81+
self._percent_value = None
7982
self.discriminator = 'type'
8083

8184
self.type = type
8285
if element_result is not None:
8386
self.element_result = element_result
8487
if element_diagnose is not None:
8588
self.element_diagnose = element_diagnose
89+
if percent_value is not None:
90+
self.percent_value = percent_value
8691

8792
@property
8893
def type(self):
@@ -151,6 +156,27 @@ def element_diagnose(self, element_diagnose):
151156

152157
self._element_diagnose = element_diagnose
153158

159+
@property
160+
def percent_value(self):
161+
"""Gets the percent_value of this AuthenticityCheckResultItem. # noqa: E501
162+
163+
164+
:return: The percent_value of this AuthenticityCheckResultItem. # noqa: E501
165+
:rtype: int
166+
"""
167+
return self._percent_value
168+
169+
@percent_value.setter
170+
def percent_value(self, percent_value):
171+
"""Sets the percent_value of this AuthenticityCheckResultItem.
172+
173+
174+
:param percent_value: The percent_value of this AuthenticityCheckResultItem. # noqa: E501
175+
:type percent_value: int
176+
"""
177+
178+
self._percent_value = percent_value
179+
154180
def get_real_child_model(self, data):
155181
"""Returns the real base class specified by the discriminator"""
156182
discriminator_key = self.attribute_map[self.discriminator]

regula/documentreader/webclient/gen/models/fiber_result.py

+27-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class FiberResult(object):
3535
'type': 'int',
3636
'element_result': 'CheckResult',
3737
'element_diagnose': 'CheckDiagnose',
38+
'percent_value': 'int',
3839
'rect_count': 'int',
3940
'expected_count': 'int',
4041
'light_value': 'Light',
@@ -50,6 +51,7 @@ class FiberResult(object):
5051
'type': 'Type',
5152
'element_result': 'ElementResult',
5253
'element_diagnose': 'ElementDiagnose',
54+
'percent_value': 'PercentValue',
5355
'rect_count': 'RectCount',
5456
'expected_count': 'ExpectedCount',
5557
'light_value': 'LightValue',
@@ -61,7 +63,7 @@ class FiberResult(object):
6163
'color_values': 'ColorValues'
6264
}
6365

64-
def __init__(self, type=0, element_result=None, element_diagnose=None, rect_count=None, expected_count=None, light_value=None, light_disp=None, rect_array=None, width=None, length=None, area=None, color_values=None, local_vars_configuration=None): # noqa: E501
66+
def __init__(self, type=0, element_result=None, element_diagnose=None, percent_value=None, rect_count=None, expected_count=None, light_value=None, light_disp=None, rect_array=None, width=None, length=None, area=None, color_values=None, local_vars_configuration=None): # noqa: E501
6567
"""FiberResult - a model defined in OpenAPI""" # noqa: E501
6668
if local_vars_configuration is None:
6769
local_vars_configuration = Configuration()
@@ -70,6 +72,7 @@ def __init__(self, type=0, element_result=None, element_diagnose=None, rect_coun
7072
self._type = None
7173
self._element_result = None
7274
self._element_diagnose = None
75+
self._percent_value = None
7376
self._rect_count = None
7477
self._expected_count = None
7578
self._light_value = None
@@ -86,6 +89,8 @@ def __init__(self, type=0, element_result=None, element_diagnose=None, rect_coun
8689
self.element_result = element_result
8790
if element_diagnose is not None:
8891
self.element_diagnose = element_diagnose
92+
if percent_value is not None:
93+
self.percent_value = percent_value
8994
if rect_count is not None:
9095
self.rect_count = rect_count
9196
if expected_count is not None:
@@ -172,6 +177,27 @@ def element_diagnose(self, element_diagnose):
172177

173178
self._element_diagnose = element_diagnose
174179

180+
@property
181+
def percent_value(self):
182+
"""Gets the percent_value of this FiberResult. # noqa: E501
183+
184+
185+
:return: The percent_value of this FiberResult. # noqa: E501
186+
:rtype: int
187+
"""
188+
return self._percent_value
189+
190+
@percent_value.setter
191+
def percent_value(self, percent_value):
192+
"""Sets the percent_value of this FiberResult.
193+
194+
195+
:param percent_value: The percent_value of this FiberResult. # noqa: E501
196+
:type percent_value: int
197+
"""
198+
199+
self._percent_value = percent_value
200+
175201
@property
176202
def rect_count(self):
177203
"""Gets the rect_count of this FiberResult. # noqa: E501

0 commit comments

Comments
 (0)