Skip to content

Commit

Permalink
Merge pull request #145 from regulaforensics/develop
Browse files Browse the repository at this point in the history
develop -> master
  • Loading branch information
KirylKovaliov authored Oct 4, 2024
2 parents 9d249ed + 22a9dab commit f8775c9
Show file tree
Hide file tree
Showing 17 changed files with 440 additions and 283 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/sast.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Semgrep SAST

on:
pull_request:
branches:
- develop
- staging
- production
- stable
- main
- master

env:
# Fail workflow or not if vulnerabilities found
FAIL_ON_VULNERABILITIES: true
# List of paths (space separated) to ignore
# Supports PATTERNS
# EXCLUDE_PATHS: 'foo bar/baz file.txt dir/*.yml'
EXCLUDE_PATHS: ''
# List of rules (space separated) to ignore
# EXCLUDE_RULES: 'generic.secrets.security.detected-aws-account-id.detected-aws-account-id'
# See https://github.com/semgrep/semgrep-rules for rules registry
EXCLUDE_RULES: ''

jobs:
semgrep:
name: semgrep-oss/scan
runs-on: ubuntu-latest
container:
image: semgrep/semgrep
steps:
- uses: actions/checkout@v4
- name: Scan
shell: bash
run: |
EXCLUDED_PATHS=()
if [[ ! -z $EXCLUDE_PATHS ]]; then
for path in $EXCLUDE_PATHS; do
EXCLUDED_PATHS+=("--exclude $path")
done
fi
EXCLUDED_RULES=()
if [[ ! -z $EXCLUDE_RULES ]]; then
for rule in $EXCLUDE_RULES; do
EXCLUDED_RULES+=("--exclude-rule $rule")
done
fi
if [[ $FAIL_ON_VULNERABILITIES == "true" ]]; then
semgrep scan --config auto ${EXCLUDED_PATHS[@]} ${EXCLUDED_RULES[@]} --error --verbose
elif [[ $FAIL_ON_VULNERABILITIES == "false" ]]; then
semgrep scan --config auto ${EXCLUDED_PATHS[@]} ${EXCLUDED_RULES[@]} --error --verbose || true
else
echo "Bad FAIL_ON_VULNERABILITIES env var value"
exit 1
fi
1 change: 1 addition & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ regula/documentreader/webclient/gen/models/lexical_analysis_result_all_of.py
regula/documentreader/webclient/gen/models/license_result.py
regula/documentreader/webclient/gen/models/license_result_all_of.py
regula/documentreader/webclient/gen/models/light.py
regula/documentreader/webclient/gen/models/list_transactions_by_tag_response.py
regula/documentreader/webclient/gen/models/list_verified_fields.py
regula/documentreader/webclient/gen/models/liveness_params.py
regula/documentreader/webclient/gen/models/log_level.py
Expand Down
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ requests = ">=2.32.3"

[dev-packages]
setuptools = ">=21.0.0"
pipenv-setup = "*"
wheel = "*"
twine = "*"
chardet = "*"
Expand Down
257 changes: 53 additions & 204 deletions Pipfile.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class RawAuthenticityCheckResultItem(AuthenticityCheckResultItem):
attribute_map = copy(AuthenticityCheckResultItem.attribute_map)
attribute_map["raw"] = "raw"

def __init__(self, type=0, element_result=None, element_diagnose=None, raw=None, local_vars_configuration=None):
super().__init__(type, element_result, element_diagnose, local_vars_configuration)
def __init__(self, type=0, element_result=None, element_diagnose=None, raw=None, percent_value=None, local_vars_configuration=None):
super().__init__(type, element_result, element_diagnose, percent_value, local_vars_configuration)
self.__raw = raw

@property
Expand Down
1 change: 1 addition & 0 deletions regula/documentreader/webclient/gen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
from regula.documentreader.webclient.gen.models.license_result import LicenseResult
from regula.documentreader.webclient.gen.models.license_result_all_of import LicenseResultAllOf
from regula.documentreader.webclient.gen.models.light import Light
from regula.documentreader.webclient.gen.models.list_transactions_by_tag_response import ListTransactionsByTagResponse
from regula.documentreader.webclient.gen.models.list_verified_fields import ListVerifiedFields
from regula.documentreader.webclient.gen.models.liveness_params import LivenessParams
from regula.documentreader.webclient.gen.models.log_level import LogLevel
Expand Down
10 changes: 5 additions & 5 deletions regula/documentreader/webclient/gen/api/transaction_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def api_v2_tag_tag_id_transactions_get(self, tag_id, **kwargs): # noqa: E501
>>> result = thread.get()
:param tag_id: Tag id (required)
:type tag_id: int
:type tag_id: str
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
Expand All @@ -189,7 +189,7 @@ def api_v2_tag_tag_id_transactions_get(self, tag_id, **kwargs): # noqa: E501
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: list[GetTransactionsByTagResponse]
:rtype: ListTransactionsByTagResponse
"""
kwargs['_return_http_data_only'] = True
return self.api_v2_tag_tag_id_transactions_get_with_http_info(tag_id, **kwargs) # noqa: E501
Expand All @@ -204,7 +204,7 @@ def api_v2_tag_tag_id_transactions_get_with_http_info(self, tag_id, **kwargs):
>>> result = thread.get()
:param tag_id: Tag id (required)
:type tag_id: int
:type tag_id: str
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _return_http_data_only: response data without head status code
Expand All @@ -225,7 +225,7 @@ def api_v2_tag_tag_id_transactions_get_with_http_info(self, tag_id, **kwargs):
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: tuple(list[GetTransactionsByTagResponse], status_code(int), headers(HTTPHeaderDict))
:rtype: tuple(ListTransactionsByTagResponse, status_code(int), headers(HTTPHeaderDict))
"""

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

response_types_map = {
200: "list[GetTransactionsByTagResponse]",
200: "ListTransactionsByTagResponse",
400: None,
403: None,
}
Expand Down
1 change: 1 addition & 0 deletions regula/documentreader/webclient/gen/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
from regula.documentreader.webclient.gen.models.license_result import LicenseResult
from regula.documentreader.webclient.gen.models.license_result_all_of import LicenseResultAllOf
from regula.documentreader.webclient.gen.models.light import Light
from regula.documentreader.webclient.gen.models.list_transactions_by_tag_response import ListTransactionsByTagResponse
from regula.documentreader.webclient.gen.models.list_verified_fields import ListVerifiedFields
from regula.documentreader.webclient.gen.models.liveness_params import LivenessParams
from regula.documentreader.webclient.gen.models.log_level import LogLevel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ class AuthenticityCheckResultItem(object):
openapi_types = {
'type': 'int',
'element_result': 'CheckResult',
'element_diagnose': 'CheckDiagnose'
'element_diagnose': 'CheckDiagnose',
'percent_value': 'int'
}

attribute_map = {
'type': 'Type',
'element_result': 'ElementResult',
'element_diagnose': 'ElementDiagnose'
'element_diagnose': 'ElementDiagnose',
'percent_value': 'PercentValue'
}
discriminator_value_class_map = {
1 : 'SecurityFeatureResult',
Expand All @@ -67,7 +69,7 @@ class AuthenticityCheckResultItem(object):
8388608 : 'SecurityFeatureResult',
}

def __init__(self, type=0, element_result=None, element_diagnose=None, local_vars_configuration=None): # noqa: E501
def __init__(self, type=0, element_result=None, element_diagnose=None, percent_value=None, local_vars_configuration=None): # noqa: E501
"""AuthenticityCheckResultItem - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
Expand All @@ -76,13 +78,16 @@ def __init__(self, type=0, element_result=None, element_diagnose=None, local_var
self._type = None
self._element_result = None
self._element_diagnose = None
self._percent_value = None
self.discriminator = 'type'

self.type = type
if element_result is not None:
self.element_result = element_result
if element_diagnose is not None:
self.element_diagnose = element_diagnose
if percent_value is not None:
self.percent_value = percent_value

@property
def type(self):
Expand Down Expand Up @@ -151,6 +156,27 @@ def element_diagnose(self, element_diagnose):

self._element_diagnose = element_diagnose

@property
def percent_value(self):
"""Gets the percent_value of this AuthenticityCheckResultItem. # noqa: E501
:return: The percent_value of this AuthenticityCheckResultItem. # noqa: E501
:rtype: int
"""
return self._percent_value

@percent_value.setter
def percent_value(self, percent_value):
"""Sets the percent_value of this AuthenticityCheckResultItem.
:param percent_value: The percent_value of this AuthenticityCheckResultItem. # noqa: E501
:type percent_value: int
"""

self._percent_value = percent_value

def get_real_child_model(self, data):
"""Returns the real base class specified by the discriminator"""
discriminator_key = self.attribute_map[self.discriminator]
Expand Down
28 changes: 27 additions & 1 deletion regula/documentreader/webclient/gen/models/fiber_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class FiberResult(object):
'type': 'int',
'element_result': 'CheckResult',
'element_diagnose': 'CheckDiagnose',
'percent_value': 'int',
'rect_count': 'int',
'expected_count': 'int',
'light_value': 'Light',
Expand All @@ -50,6 +51,7 @@ class FiberResult(object):
'type': 'Type',
'element_result': 'ElementResult',
'element_diagnose': 'ElementDiagnose',
'percent_value': 'PercentValue',
'rect_count': 'RectCount',
'expected_count': 'ExpectedCount',
'light_value': 'LightValue',
Expand All @@ -61,7 +63,7 @@ class FiberResult(object):
'color_values': 'ColorValues'
}

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
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
"""FiberResult - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
Expand All @@ -70,6 +72,7 @@ def __init__(self, type=0, element_result=None, element_diagnose=None, rect_coun
self._type = None
self._element_result = None
self._element_diagnose = None
self._percent_value = None
self._rect_count = None
self._expected_count = None
self._light_value = None
Expand All @@ -86,6 +89,8 @@ def __init__(self, type=0, element_result=None, element_diagnose=None, rect_coun
self.element_result = element_result
if element_diagnose is not None:
self.element_diagnose = element_diagnose
if percent_value is not None:
self.percent_value = percent_value
if rect_count is not None:
self.rect_count = rect_count
if expected_count is not None:
Expand Down Expand Up @@ -172,6 +177,27 @@ def element_diagnose(self, element_diagnose):

self._element_diagnose = element_diagnose

@property
def percent_value(self):
"""Gets the percent_value of this FiberResult. # noqa: E501
:return: The percent_value of this FiberResult. # noqa: E501
:rtype: int
"""
return self._percent_value

@percent_value.setter
def percent_value(self, percent_value):
"""Sets the percent_value of this FiberResult.
:param percent_value: The percent_value of this FiberResult. # noqa: E501
:type percent_value: int
"""

self._percent_value = percent_value

@property
def rect_count(self):
"""Gets the rect_count of this FiberResult. # noqa: E501
Expand Down
Loading

0 comments on commit f8775c9

Please sign in to comment.