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

feat: add statusList handling, workflows, docker images and helm chart #1

Merged
merged 32 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
72a57da
adjust dim creation
Phil91 Mar 26, 2024
1c21f65
chore: enable workflows, docker images and helm chart (#1)
evegufy Mar 28, 2024
870a4ec
chore: fix formatting and unit tests
Phil91 Mar 29, 2024
d8fcb0f
chore: update chart release step and readme (#12)
evegufy Mar 29, 2024
f4f69b1
chore: upgrade nuget packages
Phil91 Mar 29, 2024
26bc00c
chore: improve workflows (#17)
evegufy Apr 2, 2024
f3beecc
chore(release): fix create tag step (#18)
evegufy Apr 2, 2024
221a435
feat(authorization): add role authorization (#19)
Phil91 Apr 2, 2024
c955601
chore: adjust audience check (#20)
Phil91 Apr 3, 2024
172ce46
chore: improve release and update docs (#21)
evegufy Apr 3, 2024
b828a9e
chore(deps): bump aquasecurity/trivy-action from 0.18.0 to 0.19.0 (#2)
dependabot[bot] Apr 3, 2024
34341e6
chore(deps): bump actions/cache from 3 to 4 (#3)
dependabot[bot] Apr 3, 2024
6f33543
chore(deps): bump docker/build-push-action from 5.1.0 to 5.3.0 (#4)
dependabot[bot] Apr 3, 2024
0176a15
chore(deps): bump helm/chart-releaser-action from 1.4.1 to 1.6.0 (#6)
dependabot[bot] Apr 3, 2024
9027356
chore(deps): bump container-tools/kind-action from 2.0.3 to 2.0.4 (#5)
dependabot[bot] Apr 3, 2024
167ff48
feat(statusList): add statuslist endpoints (#22)
Phil91 Apr 3, 2024
c11f07a
chore(consortia-env): fix image tag for dev
evegufy Apr 4, 2024
e8e653a
chore(consortia-env): update argo app templates
evegufy Apr 4, 2024
aa2af1f
chore(helm): increase resource limits
evegufy Apr 4, 2024
d3494de
feat(net8): upgrade to .net8 (#23)
Phil91 Apr 4, 2024
5d07bab
chore(release): don't run jobs unnecessarily
evegufy Apr 4, 2024
341a7a6
build(0.0.2): bump version
evegufy Apr 4, 2024
d11b77a
chore: add release-helm-chart as required for create-tag job
evegufy Apr 4, 2024
55c94af
chore: add dependencies file
Phil91 Apr 8, 2024
8a045e5
chore(consortia): fix path to clientIdCisCentral
evegufy Apr 8, 2024
5b8f6cc
fix(bindings): adjust errorhandling for service instances (#29)
Phil91 Apr 9, 2024
bd21e09
Merge remote-tracking branch 'dim/main' into feature/status-list
Phil91 Apr 9, 2024
81c5c90
chore: adjust readme links
Phil91 Apr 9, 2024
bf9ccc0
chore(changelog/v1.0.0): release 1.0.0 (#2)
github-actions[bot] Apr 9, 2024
df6f041
chore: adjust copyright header
Phil91 Apr 9, 2024
eb6b7a5
feat(technicalUser): add endpoint to create technicalUser for wallet …
Phil91 Apr 10, 2024
3d79211
feat(technicalUser): add endpoint to create technicalUser for wallet
Phil91 Apr 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
###############################################################
# Copyright 2024 SAP SE or an SAP affiliate company and ssi-dim-middle-layer contributors.
#
# 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
###############################################################

---
version: 2
updates:
# NuGet
-
package-ecosystem: "nuget"
directory: /
labels:
- "dependabot"
- "dependencies"
schedule:
interval: "weekly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]

# Github Actions
-
package-ecosystem: "github-actions"
directory: /
labels:
- "dependabot"
- "github-actions"
schedule:
interval: "weekly"

# Docker
-
package-ecosystem: "docker"
directory: ./docker/
labels:
- "dependabot"
- "docker"
schedule:
interval: "weekly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Description

Please include a summary of the change.

## Why

Please include an explanation of why this change is necessary as well as relevant motivation and context. List any dependencies that are required for this change.

## Issue

Link to Github issue.

## Checklist

Please delete options that are not relevant.

- [ ] I have performed a self-review of my own code
- [ ] I have successfully tested my changes locally
- [ ] I have added tests that prove my changes work
- [ ] I have checked that new and existing tests pass locally with my changes
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added copyright and license headers, footers (for .md files) or files (for images)
128 changes: 128 additions & 0 deletions .github/workflows/chart-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
###############################################################
# Copyright 2024 SAP SE or an SAP affiliate company and ssi-dim-middle-layer contributors.
#
# 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
###############################################################

name: Lint and Test Chart

on:
push:
paths:
- 'charts/dim/**'
branches: [main]
pull_request:
paths:
- 'charts/dim/**'
workflow_dispatch:
inputs:
node_image:
description: 'kindest/node image for k8s kind cluster'
# k8s version
default: 'kindest/node:v1.27.3'
required: false
type: string
upgrade_from:
description: 'dim chart version to upgrade from'
# tbd
default: 'tbd'
required: false
type: string

jobs:

lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Kubernetes KinD Cluster
uses: container-tools/kind-action@0ad70e2299366b0e1552c7240f4e4567148f723e # v2.0.4
with:
# upgrade version, default (v0.17.0) uses node image v1.21.1 and doesn't work with more recent node image versions
version: v0.20.0
# default value for event_name != workflow_dispatch
node_image: ${{ github.event.inputs.node_image || 'kindest/node:v1.27.3' }}

- name: Build migration image
id: build-migration-image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: .
file: ./docker/Dockerfile-dim-migrations
push: true
tags: kind-registry:5000/dim-migrations:testing

- name: Build service image
id: build-service-image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: .
file: ./docker/Dockerfile-dim-service
push: true
tags: kind-registry:5000/dim-service:testing

- name: Build processes worker
id: build-processes-worker-image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: .
file: ./docker/Dockerfile-dim-processes-worker
push: true
tags: kind-registry:5000/dim-processes-worker:testing

- name: Set up Helm
uses: azure/setup-helm@b7246b12e77f7134dc2d460a3d5bad15bbe29390 # v4
with:
version: v3.9.3

- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.9'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi

- name: Run chart-testing (lint)
run: ct lint --validate-maintainers=false --check-version-increment=false --target-branch ${{ github.event.repository.default_branch }}

- name: Run chart-testing (install)
run: ct install --charts charts/dim --config charts/chart-testing-config.yaml --helm-extra-set-args "--set dim.image.name=kind-registry:5000/dim-service --set dim.image.tag=testing --set migrations.image.name=kind-registry:5000/dim-migrations --set migrations.image.tag=testing --set processesworker.image.name=kind-registry:5000/dim-processes-worker --set processesworker.image.tag=testing"
if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'

# TODO: re-add the step after the first version release
# Upgrade the released chart version with the locally available chart
# default value for event_name != workflow_dispatch
# - name: Run helm upgrade
# run: |
# helm repo add bitnami https://charts.bitnami.com/bitnami
# helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev
# helm install dim tractusx-dev/dim --version ${{ github.event.inputs.upgrade_from || 'tbd' }} --namespace upgrade --create-namespace
# helm dependency update charts/dim
# helm upgrade dim charts/dim --set dim.image.name=kind-registry:5000/dim-service --set dim.image.tag=testing --set migrations.image.name=kind-registry:5000/dim-migrations --set migrations.image.tag=testing --set processesworker.image.name=kind-registry:5000/dim-processes-worker --set processesworker.image.tag=testing --namespace upgrade
# if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'
105 changes: 105 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
###############################################################
# Copyright 2024 SAP SE or an SAP affiliate company and ssi-dim-middle-layer contributors.
#
# 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
###############################################################

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#

name: "CodeQL"

on:
push:
branches: [main]
paths:
- 'src/**'
pull_request:
paths:
- 'src/**'
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["csharp"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@1b1aada464948af03b950897e5eb522f92603cc2 # v2.227
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
queries: +security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# Automates dependency installation for Python, Ruby, and JavaScript, optimizing the CodeQL analysis setup.
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@1b1aada464948af03b950897e5eb522f92603cc2 # v2.227

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@1b1aada464948af03b950897e5eb522f92603cc2 # v2.227
with:
category: "/language:${{matrix.language}}"
75 changes: 75 additions & 0 deletions .github/workflows/kics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
###############################################################
# Copyright 2024 SAP SE or an SAP affiliate company and ssi-dim-middle-layer contributors.
#
# 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
###############################################################

name: "KICS"

on:
push:
branches: [main]
# pull_request:
# The branches below must be a subset of the branches above
# branches: [main, dev]
# paths-ignore:
# - "**/*.md"
# - "**/*.txt"
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: KICS scan
uses: checkmarx/kics-github-action@8a44970e3d2eca668be41abe9d4e06709c3b3609 # v1.7.0
with:
# Scanning directory .
path: "."
# 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
# - results-dir/results.sarif
output_path: kicsResults/
output_formats: "json,sarif"
# If you want KICS to ignore the results and return exit status code 0 unless a KICS engine error happens
# ignore_on_exit: results
# GITHUB_TOKEN enables this github action to access github API and post comments in a pull request
# token: ${{ secrets.GITHUB_TOKEN }}
# enable_comments: true

# Upload findings to GitHub Advanced Security Dashboard
- name: Upload SARIF file for GitHub Advanced Security Dashboard
if: always()
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
with:
sarif_file: kicsResults/results.sarif

Loading
Loading