-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from regulaforensics/develop
develop -> master
- Loading branch information
Showing
16 changed files
with
1,089 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '*docker-compose.y*ml' | ||
# 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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
142 changes: 142 additions & 0 deletions
142
src/Regula.DocumentReader.WebClient/Model/BinaryDataResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
/* | ||
* Regula Document Reader Web API | ||
* | ||
* Documents recognition as easy as reading two bytes. # Clients: * [JavaScript](https://github.com/regulaforensics/DocumentReader-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/DocumentReader-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/DocumentReader-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/DocumentReader-web-csharp-client) client for .NET & .NET Core | ||
* | ||
* The version of the OpenAPI document: 7.2.0 | ||
* | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
||
using System; | ||
using System.Linq; | ||
using System.IO; | ||
using System.Text; | ||
using System.Text.RegularExpressions; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Runtime.Serialization; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using System.ComponentModel.DataAnnotations; | ||
using OpenAPIDateConverter = Regula.DocumentReader.WebClient.Client.OpenAPIDateConverter; | ||
|
||
namespace Regula.DocumentReader.WebClient.Model | ||
{ | ||
/// <summary> | ||
/// BinaryDataResult | ||
/// </summary> | ||
[DataContract] | ||
public partial class BinaryDataResult : IEquatable<BinaryDataResult>, IValidatableObject | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="BinaryDataResult" /> class. | ||
/// </summary> | ||
/// <param name="nFields">Count of array fields.</param> | ||
/// <param name="pArrayFields">pArrayFields.</param> | ||
public BinaryDataResult(int nFields = default(int), List<TBinaryData> pArrayFields = default(List<TBinaryData>)) | ||
{ | ||
this.NFields = nFields; | ||
this.PArrayFields = pArrayFields; | ||
} | ||
|
||
/// <summary> | ||
/// Count of array fields | ||
/// </summary> | ||
/// <value>Count of array fields</value> | ||
[DataMember(Name="nFields", EmitDefaultValue=false)] | ||
public int NFields { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets PArrayFields | ||
/// </summary> | ||
[DataMember(Name="pArrayFields", EmitDefaultValue=false)] | ||
public List<TBinaryData> PArrayFields { get; set; } | ||
|
||
/// <summary> | ||
/// Returns the string presentation of the object | ||
/// </summary> | ||
/// <returns>String presentation of the object</returns> | ||
public override string ToString() | ||
{ | ||
var sb = new StringBuilder(); | ||
sb.Append("class BinaryDataResult {\n"); | ||
sb.Append(" NFields: ").Append(NFields).Append("\n"); | ||
sb.Append(" PArrayFields: ").Append(PArrayFields).Append("\n"); | ||
sb.Append("}\n"); | ||
return sb.ToString(); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the JSON string presentation of the object | ||
/// </summary> | ||
/// <returns>JSON string presentation of the object</returns> | ||
public virtual string ToJson() | ||
{ | ||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); | ||
} | ||
|
||
/// <summary> | ||
/// Returns true if objects are equal | ||
/// </summary> | ||
/// <param name="input">Object to be compared</param> | ||
/// <returns>Boolean</returns> | ||
public override bool Equals(object input) | ||
{ | ||
return this.Equals(input as BinaryDataResult); | ||
} | ||
|
||
/// <summary> | ||
/// Returns true if BinaryDataResult instances are equal | ||
/// </summary> | ||
/// <param name="input">Instance of BinaryDataResult to be compared</param> | ||
/// <returns>Boolean</returns> | ||
public bool Equals(BinaryDataResult input) | ||
{ | ||
if (input == null) | ||
return false; | ||
|
||
return | ||
( | ||
this.NFields == input.NFields || | ||
(this.NFields != null && | ||
this.NFields.Equals(input.NFields)) | ||
) && | ||
( | ||
this.PArrayFields == input.PArrayFields || | ||
this.PArrayFields != null && | ||
input.PArrayFields != null && | ||
this.PArrayFields.SequenceEqual(input.PArrayFields) | ||
); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the hash code | ||
/// </summary> | ||
/// <returns>Hash code</returns> | ||
public override int GetHashCode() | ||
{ | ||
unchecked // Overflow is fine, just wrap | ||
{ | ||
int hashCode = 41; | ||
if (this.NFields != null) | ||
hashCode = hashCode * 59 + this.NFields.GetHashCode(); | ||
if (this.PArrayFields != null) | ||
hashCode = hashCode * 59 + this.PArrayFields.GetHashCode(); | ||
return hashCode; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// To validate all properties of the instance | ||
/// </summary> | ||
/// <param name="validationContext">Validation context</param> | ||
/// <returns>Validation Result</returns> | ||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) | ||
{ | ||
yield break; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.