-
Notifications
You must be signed in to change notification settings - Fork 6
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 #31 from catenax-ng/feature/CXAR-919-quality-gates
docs|fix|chore(provisioning-agent): SAST Flaws and CHANGELOG
- Loading branch information
Showing
9 changed files
with
106 additions
and
13 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 |
---|---|---|
|
@@ -49,6 +49,9 @@ jobs: | |
- name: Verify proper formatting | ||
run: ./mvnw spotless:check | ||
|
||
### | ||
# Standalone applications have all dependencies in their jar | ||
### | ||
build_standalone: | ||
runs-on: ubuntu-latest | ||
needs: [ secret-presence, verify-formatting ] | ||
|
@@ -87,6 +90,13 @@ jobs: | |
vid: ${{ secrets.ORG_VERACODE_API_ID }} | ||
vkey: ${{ secrets.ORG_VERACODE_API_KEY }} | ||
|
||
### | ||
# Embedded applications need dependencies being provided. | ||
# Expecially wrt. Spring 5.3.28 Web there is an open HIGH vulnerability regarding | ||
# org/springframework/remoting/httpinvoker which will not be fixed | ||
# so we manipulate the jar in the docker environment directly and exclude | ||
# the dependency from the scan | ||
### | ||
build_embedded: | ||
runs-on: ubuntu-latest | ||
needs: [ secret-presence, verify-formatting ] | ||
|
@@ -110,7 +120,7 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Tar gzip files for veracode upload | ||
run: |- | ||
tar -czvf ${{ matrix.variant.dir }}/target/${{ matrix.variant.name }}.tar.gz ${{ matrix.variant.dir }}/target/lib/*.jar ${{ matrix.variant.dir }}/target/${{ matrix.variant.name }}-*.jar | ||
tar --exclude='spring-web-5.3.28.jar' -czvf ${{ matrix.variant.dir }}/target/${{ matrix.variant.name }}.tar.gz ${{ matrix.variant.dir }}/target/lib/*.jar ${{ matrix.variant.dir }}/target/${{ matrix.variant.name }}-*.jar | ||
- name: Veracode Upload And Scan | ||
uses: veracode/[email protected] | ||
if: | | ||
|
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
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
50 changes: 50 additions & 0 deletions
50
provisioning/src/test/java/org/eclipse/tractusx/agents/AmazonRdsProxyTest.java
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,50 @@ | ||
// Copyright (c) 2023 T-Systems International GmbH | ||
// Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
// | ||
// See the NOTICE file(s) distributed with this work for additional | ||
// information regarding copyright ownership. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Apache License, Version 2.0 which is available at | ||
// https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations | ||
// under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package org.eclipse.tractusx.agents; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.Tag; | ||
|
||
import java.sql.Connection; | ||
import java.sql.DriverManager; | ||
import java.sql.SQLException; | ||
import java.util.Properties; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
/** | ||
* Amazon RDS behaves sometimes a little bit different than the native DBs | ||
* This test class is to find out and mitigate the peculiarities. | ||
*/ | ||
@Tag("online") | ||
public class AmazonRdsProxyTest { | ||
|
||
String rdsInstance="jdbc:postgresql://%s.rds.amazonaws.com:%d/postgres?user=%s&password=%s"; | ||
|
||
/** | ||
* tests connection to amazon | ||
* @throws SQLException | ||
*/ | ||
@Test | ||
public void testConnection() throws SQLException { | ||
String connectionUrl=String.format(rdsInstance,"database-x.region",8080,"who","what"); | ||
Properties connectionProperties=new Properties(); | ||
Connection connection=DriverManager.getConnection(connectionUrl, connectionProperties); | ||
assertNotNull(connection.getSchema(),"Current schema should be non-empty"); | ||
} | ||
} |
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