Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second batch of test and functionality updates #40

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
branches:
- main
paths:
- 'build.gradle'
- "build.gradle"

jobs:
blackduck-scan:
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
Expand All @@ -30,6 +30,9 @@ jobs:
UNIT_API_URL: ${{ secrets.UNIT_API_URL }}
UNIT_TOKEN: ${{ secrets.UNIT_TOKEN }}
access_token: ${{ secrets.UNIT_TOKEN }}
token_tests_user_id: ${{ secrets.TOKEN_TESTS_USER_ID }}
test_plaid_counterparty_token: ${{ secrets.TEST_PLAID_COUNTERPARTY_TOKEN }}
wallet_terms: ${{ secrets.WALLET_TERMS }}

- name: Black Duck Full Scan
uses: synopsys-sig/[email protected]
Expand All @@ -42,46 +45,45 @@ jobs:
blackduck_url: ${{ secrets.BLACKDUCK_URL }}
blackduck_token: ${{ secrets.BLACKDUCK_API_TOKEN }}
blackduck_scan_full: true

### Accepts Multiple Values
blackduck_scan_failure_severities: 'BLOCKER,CRITICAL'
blackduck_scan_failure_severities: "BLOCKER,CRITICAL"

### Uncomment below configuration to enable automatic fix pull request creation if vulnerabilities are reported
blackduck_fixpr_enabled: true
blackduck_fixpr_maxCount: 5
blackduck_fixpr_filter_severities: 'CRITICAL,HIGH'
blackduck_fixpr_useUpgradeGuidance: 'SHORT_TERM,LONG_TERM'
blackduck_fixpr_filter_severities: "CRITICAL,HIGH"
blackduck_fixpr_useUpgradeGuidance: "SHORT_TERM,LONG_TERM"
github_token: ${{ secrets.GITHUB_TOKEN }} # Mandatory when blackduck_fixpr_enabled is set to 'true'

### Uncomment below configuration if Synopsys Bridge diagnostic files needs to be uploaded
include_diagnostics: true

- name: If failed - Configure 1Password Service Account For Slack Webhook URL Secret
uses: 1password/load-secrets-action/configure@v1
if: ${{ failure() }}
with:
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- name: If failed - Load Slack Webhook URL Secret
uses: 1password/load-secrets-action@v1
if: ${{ failure() }}
with:
export-env: true
export-env: true
env:
SLACK_WEBHOOK_URL: op://Security/slack-appsec-blackduck-alerts/webhook-url
- name: If failed - Report failure to Slack
SLACK_WEBHOOK_URL: op://Security/slack-appsec-blackduck-alerts/webhook-url
- name: If failed - Report failure to Slack
#Slack channel: appsec-blackduck-alerts
uses: ravsamhq/notify-slack-action@v2
uses: ravsamhq/notify-slack-action@v2
if: ${{ failure() }}
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: "{workflow} has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{run_url}|{repo}>"
footer: "Linked Run <{run_url}|{repo}>"
notify_when: "failure"
mention_users: "U040AD4BT42"
mention_users_when: "failure,warnings"
mention_groups: "!channel"
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: "{workflow} has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{run_url}|{repo}>"
footer: "Linked Run <{run_url}|{repo}>"
notify_when: "failure"
mention_users: "U040AD4BT42"
mention_users_when: "failure,warnings"
mention_groups: "!channel"
env:
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }}

SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }}
52 changes: 27 additions & 25 deletions .github/workflows/CI-appsec-blackduck-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ name: CI-AppSec [Master]
on:
schedule:
#At 13:00 on every day-of-week from Sunday through Thursday.
- cron: '0 13 * * SUN-THU'
- cron: "0 13 * * SUN-THU"
workflow_dispatch:
#The workflow will only run when a push that includes a change to the build.gradle file is made in the main branch.
push:
branches:
- main
paths:
- 'build.gradle'
- "build.gradle"

jobs:
blackduck-scan:
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
Expand All @@ -30,6 +30,9 @@ jobs:
UNIT_API_URL: ${{ secrets.UNIT_API_URL }}
UNIT_TOKEN: ${{ secrets.UNIT_TOKEN }}
access_token: ${{ secrets.UNIT_TOKEN }}
token_tests_user_id: ${{ secrets.TOKEN_TESTS_USER_ID }}
test_plaid_counterparty_token: ${{ secrets.TEST_PLAID_COUNTERPARTY_TOKEN }}
wallet_terms: ${{ secrets.WALLET_TERMS }}

- name: Black Duck Full Scan
uses: synopsys-sig/[email protected]
Expand All @@ -42,46 +45,45 @@ jobs:
blackduck_url: ${{ secrets.BLACKDUCK_URL }}
blackduck_token: ${{ secrets.BLACKDUCK_API_TOKEN }}
blackduck_scan_full: true

### Accepts Multiple Values
blackduck_scan_failure_severities: 'BLOCKER,CRITICAL'
blackduck_scan_failure_severities: "BLOCKER,CRITICAL"

### Uncomment below configuration to enable automatic fix pull request creation if vulnerabilities are reported
blackduck_fixpr_enabled: true
blackduck_fixpr_maxCount: 5
blackduck_fixpr_filter_severities: 'CRITICAL,HIGH'
blackduck_fixpr_useUpgradeGuidance: 'SHORT_TERM,LONG_TERM'
blackduck_fixpr_filter_severities: "CRITICAL,HIGH"
blackduck_fixpr_useUpgradeGuidance: "SHORT_TERM,LONG_TERM"
github_token: ${{ secrets.GITHUB_TOKEN }} # Mandatory when blackduck_fixpr_enabled is set to 'true'

### Uncomment below configuration if Synopsys Bridge diagnostic files needs to be uploaded
# include_diagnostics: true

- name: If failed - Configure 1Password Service Account For Slack Webhook URL Secret
uses: 1password/load-secrets-action/configure@v1
if: ${{ failure() }}
with:
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- name: If failed - Load Slack Webhook URL Secret
uses: 1password/load-secrets-action@v1
if: ${{ failure() }}
with:
export-env: true
export-env: true
env:
SLACK_WEBHOOK_URL: op://Security/slack-appsec-blackduck-alerts/webhook-url
- name: If failed - Report failure to Slack
SLACK_WEBHOOK_URL: op://Security/slack-appsec-blackduck-alerts/webhook-url
- name: If failed - Report failure to Slack
#Slack channel: appsec-blackduck-alerts
uses: ravsamhq/notify-slack-action@v2
uses: ravsamhq/notify-slack-action@v2
if: ${{ failure() }}
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: "{workflow} has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{run_url}|{repo}>"
footer: "Linked Run <{run_url}|{repo}>"
notify_when: "failure"
mention_users: "U040AD4BT42"
mention_users_when: "failure,warnings"
mention_groups: "!channel"
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: "{workflow} has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{run_url}|{repo}>"
footer: "Linked Run <{run_url}|{repo}>"
notify_when: "failure"
mention_users: "U040AD4BT42"
mention_users_when: "failure,warnings"
mention_groups: "!channel"
env:
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }}

SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }}
3 changes: 3 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
UNIT_API_URL: ${{ secrets.UNIT_API_URL }}
UNIT_TOKEN: ${{ secrets.UNIT_TOKEN }}
access_token: ${{ secrets.UNIT_TOKEN }}
token_tests_user_id: ${{ secrets.TOKEN_TESTS_USER_ID }}
test_plaid_counterparty_token: ${{ secrets.TEST_PLAID_COUNTERPARTY_TOKEN }}
wallet_terms: ${{ secrets.WALLET_TERMS }}

- name: Store reports
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ p.setNumber("5555555555");
p.setCountryCode("1");
attr.setPhone(p);
attr.setIdempotencyKey("3a1a33be-4e12-4603-9ed0-820922389fb8");
attr.setOccupation(Occupation.ARCHITECTORENGINEER);
attr.setOccupation(Occupation.ARCHITECT_OR_ENGINEER);

createIndividualApplication.setAttributes(attr);

Expand Down
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ ext {
jackson_version = "2.14.1"
jakarta_annotation_version = "2.1.1"
junit_version = "4.13.2"
httpmime_version = "4.5.13"
}

dependencies {
Expand All @@ -134,6 +135,8 @@ dependencies {
implementation "org.openapitools:jackson-databind-nullable:0.2.1"
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
implementation "org.apache.httpcomponents:httpmime:$httpmime_version"
implementation "commons-io:commons-io:2.5"
testImplementation "junit:junit:$junit_version"
}

Expand Down Expand Up @@ -169,6 +172,10 @@ spotless {
}

test {
testLogging {
showStandardStreams = true
}

useJUnit()
}
// // Enable JUnit 5 (Gradle 4.6+).
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@
<version>${jakarta-annotation-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>${httpmime-version}</version>
</dependency>

<!-- test dependencies -->
<dependency>
Expand All @@ -253,5 +258,6 @@
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<junit-version>4.13.2</junit-version>
<spotless.version>2.27.2</spotless.version>
<httpmime-version>4.5.14</httpmime-version>
</properties>
</project>
4 changes: 2 additions & 2 deletions src/main/java/unit/java/sdk/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* <p>The setter methods of this class return the current object to facilitate
* a fluent style of configuration.</p>
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
public class ApiClient {

private HttpClient.Builder builder;
Expand All @@ -66,7 +66,7 @@ public class ApiClient {
private Duration readTimeout;
private Duration connectTimeout;

private static String valueToString(Object value) {
public static String valueToString(Object value) {
if (value == null) {
return "";
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/unit/java/sdk/ApiException.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import java.net.http.HttpHeaders;

@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
public class ApiException extends Exception {
private static final long serialVersionUID = 1L;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/unit/java/sdk/ApiResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @param <T> The type of data that is deserialized from response body
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
public class ApiResponse<T> {
final private int statusCode;
final private Map<String, List<String>> headers;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/unit/java/sdk/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

package unit.java.sdk;

@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
public class Configuration {
public static final String VERSION = "0.1.0";

Expand Down
19 changes: 16 additions & 3 deletions src/main/java/unit/java/sdk/JSON.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Unit OpenAPI specifications
* An OpenAPI specifications for unit-sdk clients
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package unit.java.sdk;

import com.fasterxml.jackson.annotation.*;
Expand All @@ -13,15 +26,15 @@
import java.util.Map;
import java.util.Set;

@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
public class JSON {
private ObjectMapper mapper;

public JSON() {
mapper = JsonMapper.builder()
.serializationInclusion(JsonInclude.Include.NON_NULL)
.disable(MapperFeature.ALLOW_COERCION_OF_SCALARS)
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING)
Expand Down Expand Up @@ -69,7 +82,7 @@ public static Class<?> getClassForElement(JsonNode node, Class<?> modelClass) {
/**
* Helper class to register the discriminator mappings.
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
private static class ClassDiscriminatorMapping {
// The model class name.
Class<?> modelClass;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/unit/java/sdk/Pair.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

package unit.java.sdk;

@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
public class Pair {
private String name = "";
private String value = "";
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/unit/java/sdk/RFC3339DateFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.GregorianCalendar;
import java.util.TimeZone;

@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
public class RFC3339DateFormat extends DateFormat {
private static final long serialVersionUID = 1L;
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/unit/java/sdk/ServerConfiguration.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
/*
* Unit OpenAPI specifications
* An OpenAPI specifications for unit-sdk clients
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package unit.java.sdk;

import java.util.Map;

/**
* Representing a Server configuration.
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
public class ServerConfiguration {
public String URL;
public String description;
Expand Down
Loading
Loading