Skip to content

Commit 53788f6

Browse files
committed
Merge branch 'develop' into update-from-template-merged
2 parents 45e3f51 + a797cd4 commit 53788f6

34 files changed

+1671
-7
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
[*.{ts,js,json,yaml,yml}]
10+
indent_size = 2
11+
12+
[*.cs]
13+
indent_size = 4

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ body:
1515
attributes:
1616
label: "Checklist"
1717
options:
18-
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
18+
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/oidc-server-mock/releases/latest)"
1919
required: true
20-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
20+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/oidc-server-mock/issues) or [closed](https://github.com/xdev-software/oidc-server-mock/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
2121
required: true
2222
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
2323
required: true

.github/ISSUE_TEMPLATE/enhancement.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body:
1313
attributes:
1414
label: "Checklist"
1515
options:
16-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
16+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/oidc-server-mock/issues) or [closed](https://github.com/xdev-software/oidc-server-mock/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1717
required: true
1818
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
1919
required: true

.github/ISSUE_TEMPLATE/question.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ body:
1212
attributes:
1313
label: "Checklist"
1414
options:
15-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
15+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/oidc-server-mock/issues) or [closed](https://github.com/xdev-software/oidc-server-mock/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1616
required: true
1717
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
1818
required: true

.github/workflows/check-build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Check Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ develop ]
7+
paths-ignore:
8+
- '**.md'
9+
- '.config/**'
10+
- '.github/**'
11+
- 'assets/**'
12+
pull_request:
13+
branches: [ develop ]
14+
paths-ignore:
15+
- '**.md'
16+
- '.config/**'
17+
- '.github/**'
18+
- 'assets/**'
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
# Build entirely in docker
27+
- uses: docker/setup-qemu-action@v3
28+
29+
- uses: docker/setup-buildx-action@v3
30+
31+
- uses: docker/build-push-action@v6
32+
with:
33+
context: ./src
34+
push: false
35+
tags: oidc-server-mock:experimental
36+
platforms: linux/amd64,linux/arm64
37+
cache-from: type=gha
38+
cache-to: type=gha,mode=max
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Image vuln scan
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "22 7 * * 0"
7+
8+
permissions:
9+
issues: write
10+
11+
env:
12+
# Note: Use ghcr since we have no rate limiting there
13+
TRIVYY_IMAGE_REF: 'ghcr.io/xdev-software/oidc-server-mock:latest'
14+
15+
jobs:
16+
scan:
17+
runs-on: ubuntu-latest
18+
continue-on-error: true # Ignore errors, we create an issue instead
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Scan - Full
23+
uses: aquasecurity/[email protected]
24+
with:
25+
image-ref: ${{ env.TRIVYY_IMAGE_REF }}
26+
27+
- name: Scan - Relevant
28+
id: scan_relevant
29+
uses: aquasecurity/[email protected]
30+
with:
31+
image-ref: ${{ env.TRIVYY_IMAGE_REF }}
32+
exit-code: 1
33+
severity: 'HIGH,CRITICAL'
34+
output: reported.txt
35+
env:
36+
TRIVY_DISABLE_VEX_NOTICE: 1
37+
38+
- name: Find already existing issue
39+
id: find-issue
40+
if: ${{ always() }}
41+
run: |
42+
echo "number=$(gh issue list -l 'bug' -l 'automated' -L 1 -S 'in:title \"Trivy Vulnerability Report\"' -s 'open' --json 'number' --jq '.[].number')" >> $GITHUB_OUTPUT
43+
env:
44+
GH_TOKEN: ${{ github.token }}
45+
46+
- name: Close issue if everything is fine
47+
if: ${{ success() && steps.find-issue.outputs.number != '' }}
48+
run: gh issue close -r 'not planned' ${{ steps.find-issue.outputs.number }}
49+
env:
50+
GH_TOKEN: ${{ github.token }}
51+
52+
- name: Reformat report
53+
if: ${{ failure() && steps.scan_relevant.conclusion == 'failure' }}
54+
run: |
55+
echo 'Trivy reported vulnerabilities that should be addressed:' > reported.md
56+
echo '```' >> reported.md
57+
cat reported.txt >> reported.md
58+
echo '```' >> reported.md
59+
cat reported.md
60+
61+
- name: Create Issue From File
62+
if: ${{ failure() && steps.scan_relevant.conclusion == 'failure' }}
63+
uses: peter-evans/create-issue-from-file@v5
64+
with:
65+
issue-number: ${{ steps.find-issue.outputs.number }}
66+
title: Trivy Vulnerability Report
67+
content-filepath: ./reported.md
68+
labels: bug, automated

.github/workflows/release.yml

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
check-code:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
# Build entirely in docker
18+
- uses: docker/setup-qemu-action@v3
19+
20+
- uses: docker/setup-buildx-action@v3
21+
22+
- uses: docker/build-push-action@v6
23+
with:
24+
context: ./src
25+
push: false
26+
tags: oidc-server-mock:experimental
27+
platforms: linux/amd64,linux/arm64
28+
cache-from: type=gha
29+
cache-to: type=gha,mode=max
30+
31+
prepare-release:
32+
runs-on: ubuntu-latest
33+
needs: [check-code]
34+
outputs:
35+
upload_url: ${{ steps.create-release.outputs.upload_url }}
36+
version: ${{ steps.version.outputs.release }}
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Configure Git
41+
run: |
42+
git config --global user.email "[email protected]"
43+
git config --global user.name "GitHub Actions"
44+
45+
- name: Un-SNAP
46+
run: |
47+
version=$(grep -oPm1 "(?<=<VersionPrefix>)[^<]+" <<< cat src/OpenIdConnectServerMock.csproj)
48+
new_version=${version::-9}
49+
sed -i "s/\(<VersionPrefix>\)[^<>]*\(<\/VersionPrefix.*\)/\1$new_version\2/" src/OpenIdConnectServerMock.csproj
50+
51+
- name: Get version
52+
id: version
53+
run: |
54+
version=$(grep -oPm1 "(?<=<VersionPrefix>)[^<]+" <<< cat src/OpenIdConnectServerMock.csproj)
55+
echo "release=$version" >> $GITHUB_OUTPUT
56+
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
57+
58+
- name: Commit and Push
59+
run: |
60+
git add -A
61+
git commit -m "Release ${{ steps.version.outputs.release }}"
62+
git push origin
63+
git tag v${{ steps.version.outputs.release }}
64+
git push origin --tags
65+
66+
- name: Create Release
67+
id: create-release
68+
uses: shogo82148/actions-create-release@v1
69+
with:
70+
tag_name: v${{ steps.version.outputs.release }}
71+
release_name: v${{ steps.version.outputs.release }}
72+
commitish: master
73+
body: |
74+
## [Changelog](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }})
75+
See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information.
76+
77+
## Installation
78+
79+
### Docker
80+
Download the image from
81+
* [DockerHub](https://hub.docker.com/r/xdevsoftware/oidc-server-mock/tags?name=${{ steps.version.outputs.release }})
82+
* [GitHub Packages (ghcr.io)](https://github.com/xdev-software/oidc-server-mock/pkgs/container/oidc-server-mock)
83+
84+
publish-docker:
85+
runs-on: ubuntu-latest
86+
needs: [prepare-release]
87+
permissions:
88+
packages: write
89+
contents: read
90+
attestations: write
91+
id-token: write
92+
steps:
93+
- uses: actions/checkout@v4
94+
95+
- name: Init Git and pull
96+
run: |
97+
git config --global user.email "[email protected]"
98+
git config --global user.name "GitHub Actions"
99+
git pull
100+
101+
- uses: docker/setup-qemu-action@v3
102+
103+
- uses: docker/setup-buildx-action@v3
104+
105+
- name: Login to DockerHub
106+
uses: docker/login-action@v3
107+
with:
108+
username: ${{ secrets.DOCKERHUB_USERNAME }}
109+
password: ${{ secrets.DOCKERHUB_TOKEN }}
110+
111+
- name: Login to ghcr.io
112+
uses: docker/login-action@v3
113+
with:
114+
registry: ghcr.io
115+
username: ${{ github.actor }}
116+
password: ${{ secrets.GITHUB_TOKEN }}
117+
118+
- name: Extract metadata (tags, labels) for Docker
119+
id: meta
120+
uses: docker/metadata-action@v5
121+
with:
122+
images: |
123+
${{ secrets.DOCKERHUB_USERNAME }}/oidc-server-mock
124+
ghcr.io/${{ github.repository }}
125+
tags: |
126+
type=semver,pattern={{version}},value=${{ needs.prepare-release.outputs.version }}
127+
type=semver,pattern={{major}}.{{minor}},value=${{ needs.prepare-release.outputs.version }}
128+
type=semver,pattern={{major}},value=${{ needs.prepare-release.outputs.version }}
129+
latest
130+
131+
- uses: docker/build-push-action@v6
132+
id: push
133+
with:
134+
context: ./src
135+
push: true
136+
platforms: linux/amd64,linux/arm64
137+
tags: ${{ steps.meta.outputs.tags }}
138+
labels: ${{ steps.meta.outputs.labels }}
139+
outputs: type=image,compression=zstd,force-compression=true
140+
141+
- name: Generate artifact attestation (ghcr.io)
142+
uses: actions/attest-build-provenance@v2
143+
with:
144+
subject-name: ghcr.io/${{ github.repository }}
145+
subject-digest: ${{ steps.push.outputs.digest }}
146+
push-to-registry: true
147+
148+
after-release:
149+
runs-on: ubuntu-latest
150+
needs: [publish-docker]
151+
steps:
152+
- uses: actions/checkout@v4
153+
154+
- name: Init Git and pull
155+
run: |
156+
git config --global user.email "[email protected]"
157+
git config --global user.name "GitHub Actions"
158+
git pull
159+
160+
- name: Inc Version and SNAP
161+
run: |
162+
version=$(grep -oPm1 "(?<=<VersionPrefix>)[^<]+" <<< cat src/OpenIdConnectServerMock.csproj)
163+
new_version="$(echo $version | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}')-SNAPSHOT"
164+
sed -i "s/\(<VersionPrefix>\)[^<>]*\(<\/VersionPrefix.*\)/\1$new_version\2/" src/OpenIdConnectServerMock.csproj
165+
166+
- name: Git Commit and Push
167+
run: |
168+
git add -A
169+
git commit -m "Preparing for next development iteration"
170+
git push origin
171+
172+
- name: pull-request
173+
env:
174+
GH_TOKEN: ${{ github.token }}
175+
run: |
176+
gh_pr_up() {
177+
gh pr create "$@" || gh pr edit "$@"
178+
}
179+
gh_pr_up -B "develop" \
180+
--title "Sync back" \
181+
--body "An automated PR to sync changes back"

.github/workflows/test-deploy.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Test Deployment
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish-docker:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
packages: write
11+
contents: read
12+
attestations: write
13+
id-token: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: docker/setup-qemu-action@v3
18+
19+
- uses: docker/setup-buildx-action@v3
20+
21+
- name: Login to DockerHub
22+
uses: docker/login-action@v3
23+
with:
24+
username: ${{ secrets.DOCKERHUB_USERNAME }}
25+
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
27+
- name: Login to ghcr.io
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Extract metadata (tags, labels) for Docker
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: |
39+
${{ secrets.DOCKERHUB_USERNAME }}/oidc-server-mock
40+
ghcr.io/${{ github.repository }}
41+
tags: |
42+
experimental
43+
44+
- uses: docker/build-push-action@v6
45+
id: push
46+
with:
47+
context: ./src
48+
push: true
49+
platforms: linux/amd64,linux/arm64
50+
tags: ${{ steps.meta.outputs.tags }}
51+
labels: ${{ steps.meta.outputs.labels }}
52+
outputs: type=image,compression=zstd,force-compression=true
53+
54+
- name: Generate artifact attestation (ghcr.io)
55+
uses: actions/attest-build-provenance@v2
56+
with:
57+
subject-name: ghcr.io/${{ github.repository }}
58+
subject-digest: ${{ steps.push.outputs.digest }}
59+
push-to-registry: true

0 commit comments

Comments
 (0)