Skip to content

Commit 2bb7b33

Browse files
committed
Refactor A01 vulnerability handling: streamline attack and defense methods, enhance error handling, and improve type safety for payload options.
0 parents  commit 2bb7b33

File tree

676 files changed

+125606
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

676 files changed

+125606
-0
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master, develop]
6+
pull_request:
7+
8+
jobs:
9+
backend:
10+
name: Backend Build
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: src/backend
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: 'temurin'
23+
java-version: '17'
24+
cache: 'maven'
25+
26+
- name: Maven package (skip tests placeholder)
27+
run: mvn -B -DskipTests package
28+
29+
frontend:
30+
name: Frontend Lint & Build
31+
runs-on: ubuntu-latest
32+
defaults:
33+
run:
34+
working-directory: src/frontend
35+
steps:
36+
- name: Check out repository
37+
uses: actions/checkout@v4
38+
39+
- name: Set up Node.js 20
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '20'
43+
cache: 'npm'
44+
cache-dependency-path: src/frontend/package-lock.json
45+
46+
- name: Install dependencies
47+
run: npm ci
48+
49+
- name: Lint check (if available)
50+
run: npm run lint:check --if-present
51+
52+
- name: Build (placeholder)
53+
run: npm run build --if-present

.github/workflows/docker-build.yml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: Build and Push Docker Images
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
tags:
9+
- 'v*'
10+
pull_request:
11+
branches:
12+
- main
13+
- master
14+
workflow_dispatch:
15+
inputs:
16+
version:
17+
description: 'Version tag (e.g., 1.0.0)'
18+
required: false
19+
default: 'latest'
20+
21+
env:
22+
REGISTRY: ghcr.io
23+
IMAGE_NAME_BACKEND: ${{ github.repository }}/backend
24+
IMAGE_NAME_FRONTEND: ${{ github.repository }}/frontend
25+
IMAGE_NAME_FULL: ${{ github.repository }}/full
26+
27+
jobs:
28+
build-backend:
29+
name: Build Backend Image
30+
runs-on: ubuntu-latest
31+
permissions:
32+
contents: read
33+
packages: write
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v3
40+
41+
- name: Log in to GitHub Container Registry
42+
uses: docker/login-action@v3
43+
with:
44+
registry: ${{ env.REGISTRY }}
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Extract metadata (tags, labels) for backend
49+
id: meta-backend
50+
uses: docker/metadata-action@v5
51+
with:
52+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BACKEND }}
53+
tags: |
54+
type=ref,event=branch
55+
type=ref,event=pr
56+
type=semver,pattern={{version}}
57+
type=semver,pattern={{major}}.{{minor}}
58+
type=sha,prefix={{branch}}-
59+
type=raw,value=latest,enable={{is_default_branch}}
60+
61+
- name: Build and push backend image
62+
uses: docker/build-push-action@v5
63+
with:
64+
context: .
65+
file: ./Dockerfile.backend
66+
push: ${{ github.event_name != 'pull_request' }}
67+
tags: ${{ steps.meta-backend.outputs.tags }}
68+
labels: ${{ steps.meta-backend.outputs.labels }}
69+
cache-from: type=gha
70+
cache-to: type=gha,mode=max
71+
platforms: linux/amd64,linux/arm64
72+
73+
build-frontend:
74+
name: Build Frontend Image
75+
runs-on: ubuntu-latest
76+
permissions:
77+
contents: read
78+
packages: write
79+
steps:
80+
- name: Checkout repository
81+
uses: actions/checkout@v4
82+
83+
- name: Set up Docker Buildx
84+
uses: docker/setup-buildx-action@v3
85+
86+
- name: Log in to GitHub Container Registry
87+
uses: docker/login-action@v3
88+
with:
89+
registry: ${{ env.REGISTRY }}
90+
username: ${{ github.actor }}
91+
password: ${{ secrets.GITHUB_TOKEN }}
92+
93+
- name: Extract metadata (tags, labels) for frontend
94+
id: meta-frontend
95+
uses: docker/metadata-action@v5
96+
with:
97+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FRONTEND }}
98+
tags: |
99+
type=ref,event=branch
100+
type=ref,event=pr
101+
type=semver,pattern={{version}}
102+
type=semver,pattern={{major}}.{{minor}}
103+
type=sha,prefix={{branch}}-
104+
type=raw,value=latest,enable={{is_default_branch}}
105+
106+
- name: Build and push frontend image
107+
uses: docker/build-push-action@v5
108+
with:
109+
context: .
110+
file: ./Dockerfile.frontend
111+
push: ${{ github.event_name != 'pull_request' }}
112+
tags: ${{ steps.meta-frontend.outputs.tags }}
113+
labels: ${{ steps.meta-frontend.outputs.labels }}
114+
cache-from: type=gha
115+
cache-to: type=gha,mode=max
116+
platforms: linux/amd64,linux/arm64
117+
118+
build-full:
119+
name: Build Full Stack Image
120+
runs-on: ubuntu-latest
121+
permissions:
122+
contents: read
123+
packages: write
124+
steps:
125+
- name: Checkout repository
126+
uses: actions/checkout@v4
127+
128+
- name: Set up Docker Buildx
129+
uses: docker/setup-buildx-action@v3
130+
131+
- name: Log in to GitHub Container Registry
132+
uses: docker/login-action@v3
133+
with:
134+
registry: ${{ env.REGISTRY }}
135+
username: ${{ github.actor }}
136+
password: ${{ secrets.GITHUB_TOKEN }}
137+
138+
- name: Extract metadata (tags, labels) for full stack
139+
id: meta-full
140+
uses: docker/metadata-action@v5
141+
with:
142+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FULL }}
143+
tags: |
144+
type=ref,event=branch
145+
type=ref,event=pr
146+
type=semver,pattern={{version}}
147+
type=semver,pattern={{major}}.{{minor}}
148+
type=sha,prefix={{branch}}-
149+
type=raw,value=latest,enable={{is_default_branch}}
150+
151+
- name: Build and push full stack image
152+
uses: docker/build-push-action@v5
153+
with:
154+
context: .
155+
file: ./Dockerfile
156+
push: ${{ github.event_name != 'pull_request' }}
157+
tags: ${{ steps.meta-full.outputs.tags }}
158+
labels: ${{ steps.meta-full.outputs.labels }}
159+
cache-from: type=gha
160+
cache-to: type=gha,mode=max
161+
platforms: linux/amd64,linux/arm64
162+
163+
build-matrix:
164+
name: Build All Images
165+
runs-on: ubuntu-latest
166+
needs: [build-backend, build-frontend, build-full]
167+
if: github.event_name != 'pull_request'
168+
steps:
169+
- name: Build summary
170+
run: |
171+
echo "✅ All Docker images built and pushed successfully!"
172+
echo "Backend: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BACKEND }}"
173+
echo "Frontend: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FRONTEND }}"
174+
echo "Full Stack: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FULL }}"
175+
176+

0 commit comments

Comments
 (0)