-
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 branch 'catenax-ng-feat/DCMFOSS-53' into feat/DCMFOSS-53
- Loading branch information
Showing
62 changed files
with
5,658 additions
and
1,202 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,48 @@ | ||
name: "KICS" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- rc/** | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: KICS scan | ||
uses: checkmarx/kics-github-action@master | ||
with: | ||
path: "." | ||
# Exclude paths from scan by providing the paths as comma separated list | ||
# exclude_paths: "postgres-init.yaml,templates/sharedidp.yaml" | ||
# Exclude queries by providing the query / rule ID as comma separated list | ||
# exclude_queries: "b9c83569-459b-4110-8f79-6305aa33cb37" | ||
# Fail on HIGH severity results | ||
fail_on: high | ||
# Disable secrets detection - we use GitGuardian | ||
disable_secrets: true | ||
# When provided with a directory on output_path | ||
# it will generate the specified reports file named 'results.{extension}' | ||
# in this example it will generate: | ||
# - results-dir/results.json and results-dir/results.sarif | ||
output_path: kicsResults/ | ||
output_formats: "json,sarif" | ||
|
||
# Upload findings to GitHub Advanced Security Dashboard | ||
- name: Upload SARIF file for GitHub Advanced Security Dashboard | ||
if: always() | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: kicsResults/results.sarif |
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 |
---|---|---|
|
@@ -23,26 +23,22 @@ name: Veracode Static Analysis Pipeline Scan | |
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '27 12 * * 6' | ||
|
||
permissions: | ||
contents: read | ||
# Once a day | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-pipeline-scan: | ||
build-and-pipeline-scan-backend: | ||
permissions: | ||
contents: read | ||
security-events: write | ||
actions: read | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: '' | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
|
@@ -64,3 +60,26 @@ jobs: | |
filepath: "./veracode-scan-target.zip" | ||
vid: "${{ secrets.VERACODE_API_ID }}" | ||
vkey: "${{ secrets.VERACODE_API_KEY }}" | ||
|
||
build-and-pipeline-scan-frontend: | ||
permissions: | ||
contents: read | ||
security-events: write | ||
actions: read | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Zip frontend | ||
run: zip -r veracode-scan-target-frontend.zip ./demand-capacity-mgmt-frontend | ||
|
||
- name: Run Veracode Upload And Scan | ||
uses: veracode/[email protected] | ||
with: | ||
appname: "demand-capacity-mgmt-frontend" | ||
createprofile: false | ||
filepath: "./veracode-scan-target-frontend.zip" | ||
vid: "${{ secrets.VERACODE_API_ID }}" | ||
vkey: "${{ secrets.VERACODE_API_KEY }}" |
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
72 changes: 72 additions & 0 deletions
72
...tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/controllers/FavoriteController.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,72 @@ | ||
/* | ||
* ****************************************************************************** | ||
* Copyright (c) 2023 BMW AG | ||
* 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.demandcapacitymgmt.demandcapacitymgmtbackend.controllers; | ||
|
||
import eclipse.tractusx.demand_capacity_mgmt_specification.api.FavoriteApi; | ||
import eclipse.tractusx.demand_capacity_mgmt_specification.model.FavoriteRequest; | ||
import eclipse.tractusx.demand_capacity_mgmt_specification.model.FavoriteResponse; | ||
import lombok.AllArgsConstructor; | ||
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.FavoriteType; | ||
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.services.FavoriteService; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@RestController | ||
@AllArgsConstructor | ||
public class FavoriteController implements FavoriteApi { | ||
|
||
private final FavoriteService favoriteService; | ||
|
||
@Override | ||
public ResponseEntity<FavoriteResponse> createFavorite(FavoriteRequest favoriteRequest) throws Exception { | ||
FavoriteResponse response = favoriteService.createFavorite(favoriteRequest); | ||
return ResponseEntity.status(200).body(response); | ||
} | ||
|
||
@Override | ||
public ResponseEntity<Void> deleteFavoriteById(String id) throws Exception { | ||
favoriteService.deleteFavorite(UUID.fromString(id)); | ||
return ResponseEntity.status(200).build(); | ||
} | ||
|
||
@Override | ||
public ResponseEntity<List<FavoriteResponse>> getFavorite() throws Exception { | ||
List<FavoriteResponse> responseList = favoriteService.getAllFavorites(); | ||
return ResponseEntity.status(200).body(responseList); | ||
} | ||
|
||
@Override | ||
public ResponseEntity<List<FavoriteResponse>> getFavoriteByType(String type) throws Exception { | ||
List<FavoriteResponse> responseList = favoriteService.getAllFavoritesByType(type); | ||
return ResponseEntity.status(200).body(responseList); | ||
} | ||
|
||
@Override | ||
public ResponseEntity<FavoriteResponse> updateFavorite(String id,String type, FavoriteRequest favoriteRequest) throws Exception { | ||
FavoriteResponse response = favoriteService.updateFavorite(UUID.fromString(id), FavoriteType.valueOf(type),favoriteRequest); | ||
return ResponseEntity.status(200).body(response); | ||
} | ||
} |
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
54 changes: 0 additions & 54 deletions
54
...clipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/CustomerEntity.java
This file was deleted.
Oops, something went wrong.
73 changes: 0 additions & 73 deletions
73
.../eclipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/DemandEntity.java
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
...clipse/tractusx/demandcapacitymgmt/demandcapacitymgmtbackend/entities/FavoriteEntity.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,53 @@ | ||
/* | ||
* ****************************************************************************** | ||
* Copyright (c) 2023 BMW AG | ||
* 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.demandcapacitymgmt.demandcapacitymgmtbackend.entities; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.eclipse.tractusx.demandcapacitymgmt.demandcapacitymgmtbackend.entities.enums.FavoriteType; | ||
|
||
import javax.persistence.*; | ||
import java.util.UUID; | ||
|
||
@Entity | ||
@Table(name = "favorites") | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class FavoriteEntity { | ||
|
||
@Id | ||
@GeneratedValue | ||
@Column(columnDefinition = "uuid", updatable = false, name = "user_id") | ||
private UUID id; | ||
|
||
@Column(columnDefinition = "uuid",name = "favorite_id") | ||
private UUID favoriteId; | ||
|
||
@Column(name = "f_type", columnDefinition = "varchar") | ||
@Enumerated(EnumType.STRING) | ||
private FavoriteType type; | ||
} |
Oops, something went wrong.