Skip to content

Commit 56dfd5c

Browse files
committed
Initial release: SentinelGate v2.0.0
0 parents  commit 56dfd5c

203 files changed

Lines changed: 58225 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Bug Report
2+
description: Report a bug in SentinelGate
3+
labels: ["bug"]
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description
9+
description: What happened? Provide a clear and concise description of the bug.
10+
placeholder: A clear description of the bug...
11+
validations:
12+
required: true
13+
14+
- type: textarea
15+
id: steps
16+
attributes:
17+
label: Steps to Reproduce
18+
description: How can we reproduce this issue?
19+
placeholder: |
20+
1. Start SentinelGate with config...
21+
2. Send request to...
22+
3. Observe...
23+
validations:
24+
required: true
25+
26+
- type: textarea
27+
id: expected
28+
attributes:
29+
label: Expected Behavior
30+
description: What should have happened?
31+
placeholder: I expected...
32+
validations:
33+
required: true
34+
35+
- type: textarea
36+
id: actual
37+
attributes:
38+
label: Actual Behavior
39+
description: What actually happened?
40+
placeholder: Instead, what happened was...
41+
validations:
42+
required: true
43+
44+
- type: input
45+
id: version
46+
attributes:
47+
label: Version
48+
description: Output of `sentinel-gate version`
49+
placeholder: "v1.0.0"
50+
validations:
51+
required: true
52+
53+
- type: dropdown
54+
id: installation
55+
attributes:
56+
label: Installation Method
57+
options:
58+
- Docker
59+
- Binary
60+
- Source
61+
validations:
62+
required: false
63+
64+
- type: input
65+
id: os
66+
attributes:
67+
label: OS
68+
description: Operating system and version
69+
placeholder: "e.g. Ubuntu 22.04, macOS 14, Windows 11"
70+
validations:
71+
required: false
72+
73+
- type: textarea
74+
id: logs
75+
attributes:
76+
label: Logs
77+
description: Relevant log output (sensitive data redacted)
78+
render: shell
79+
validations:
80+
required: false
81+
82+
- type: textarea
83+
id: config
84+
attributes:
85+
label: Configuration
86+
description: Relevant configuration (sensitive data redacted)
87+
render: yaml
88+
validations:
89+
required: false
90+
91+
- type: checkboxes
92+
id: search
93+
attributes:
94+
label: Due Diligence
95+
options:
96+
- label: I have searched existing issues for duplicates
97+
required: true
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Feature Request
2+
description: Suggest an improvement for SentinelGate
3+
labels: ["enhancement"]
4+
body:
5+
- type: textarea
6+
id: problem
7+
attributes:
8+
label: Problem
9+
description: What problem does this feature solve?
10+
placeholder: I'm always frustrated when...
11+
validations:
12+
required: true
13+
14+
- type: textarea
15+
id: solution
16+
attributes:
17+
label: Proposed Solution
18+
description: How should it work? Describe the desired behavior.
19+
placeholder: It would be great if...
20+
validations:
21+
required: true
22+
23+
- type: textarea
24+
id: alternatives
25+
attributes:
26+
label: Alternatives Considered
27+
description: Other approaches you've considered
28+
placeholder: I also thought about...
29+
validations:
30+
required: false
31+
32+
- type: dropdown
33+
id: component
34+
attributes:
35+
label: Component
36+
description: Which part of SentinelGate does this affect?
37+
options:
38+
- Core Proxy
39+
- Admin UI
40+
- Policy Engine
41+
- CLI
42+
- Docker
43+
- Other
44+
validations:
45+
required: false
46+
47+
- type: checkboxes
48+
id: search
49+
attributes:
50+
label: Due Diligence
51+
options:
52+
- label: I have searched existing issues for duplicates
53+
required: true
54+
- label: "This is NOT a Pro/Enterprise feature (SSO, SIEM, multi-tenant, etc.)"
55+
required: false

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Summary
2+
3+
<!-- Brief description of what this PR does -->
4+
5+
## Related Issues
6+
7+
<!-- Link related issues: Fixes #123, Closes #456 -->
8+
9+
## Changes
10+
11+
<!-- List the key changes -->
12+
13+
-
14+
15+
## Checklist
16+
17+
- [ ] Tests pass (`go test ./...`)
18+
- [ ] Lint passes (`golangci-lint run`)
19+
- [ ] New code has tests
20+
- [ ] Documentation updated (if applicable)
21+
- [ ] No breaking changes (or documented below)
22+
- [ ] CLA signed (required for all contributors)
23+
24+
## Breaking Changes
25+
26+
<!-- If any, describe migration steps -->
27+
28+
None.
29+
30+
## Screenshots
31+
32+
<!-- If UI changes, add before/after screenshots -->

.github/workflows/ci.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version-file: 'go.mod'
21+
- name: golangci-lint
22+
uses: golangci/golangci-lint-action@v6
23+
with:
24+
version: latest
25+
args: --timeout=5m
26+
27+
test:
28+
name: Test
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-go@v5
33+
with:
34+
go-version-file: 'go.mod'
35+
- name: Run tests with race detector and coverage
36+
run: |
37+
go test -race -coverprofile=coverage.out -covermode=atomic ./...
38+
- name: Check coverage on critical packages
39+
run: |
40+
# Extract coverage for critical packages and enforce 80% threshold
41+
CRITICAL_PKGS=(
42+
"github.com/Sentinel-Gate/Sentinelgate/internal/adapter/outbound/state"
43+
"github.com/Sentinel-Gate/Sentinelgate/internal/domain/proxy"
44+
"github.com/Sentinel-Gate/Sentinelgate/internal/service"
45+
"github.com/Sentinel-Gate/Sentinelgate/internal/adapter/inbound/admin"
46+
"github.com/Sentinel-Gate/Sentinelgate/internal/adapter/outbound/cel"
47+
)
48+
49+
FAIL=0
50+
for pkg in "${CRITICAL_PKGS[@]}"; do
51+
COV=$(go tool cover -func=coverage.out | grep "^${pkg}/" | tail -1 | awk '{print $NF}' | tr -d '%')
52+
if [ -z "$COV" ]; then
53+
echo "WARNING: No coverage data for $pkg"
54+
continue
55+
fi
56+
echo "$pkg: ${COV}%"
57+
COV_INT=${COV%.*}
58+
if [ "$COV_INT" -lt 65 ]; then
59+
echo "FAIL: $pkg coverage ${COV}% is below 65% threshold"
60+
FAIL=1
61+
fi
62+
done
63+
64+
echo ""
65+
echo "Overall coverage:"
66+
go tool cover -func=coverage.out | tail -1
67+
68+
if [ "$FAIL" -eq 1 ]; then
69+
echo "::error::Coverage below 65% on one or more critical packages"
70+
exit 1
71+
fi
72+
- name: Upload coverage report
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: coverage-report
76+
path: coverage.out
77+
78+
build:
79+
name: Build
80+
runs-on: ubuntu-latest
81+
strategy:
82+
matrix:
83+
include:
84+
- goos: linux
85+
goarch: amd64
86+
- goos: linux
87+
goarch: arm64
88+
- goos: darwin
89+
goarch: amd64
90+
- goos: darwin
91+
goarch: arm64
92+
steps:
93+
- uses: actions/checkout@v4
94+
- uses: actions/setup-go@v5
95+
with:
96+
go-version-file: 'go.mod'
97+
- name: Build binary
98+
env:
99+
GOOS: ${{ matrix.goos }}
100+
GOARCH: ${{ matrix.goarch }}
101+
run: |
102+
go build -ldflags="-s -w" -o sentinel-gate-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/sentinel-gate
103+
- name: Upload binary
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: sentinel-gate-${{ matrix.goos }}-${{ matrix.goarch }}
107+
path: sentinel-gate-${{ matrix.goos }}-${{ matrix.goarch }}
108+
109+
smoke:
110+
name: Smoke Test
111+
runs-on: ubuntu-latest
112+
needs: [build]
113+
steps:
114+
- uses: actions/checkout@v4
115+
- uses: actions/setup-go@v5
116+
with:
117+
go-version-file: 'go.mod'
118+
- name: Install dependencies
119+
run: sudo apt-get update && sudo apt-get install -y jq
120+
- name: Run smoke tests
121+
run: bash scripts/smoke.sh
122+
123+
security:
124+
name: Security Scan
125+
runs-on: ubuntu-latest
126+
steps:
127+
- uses: actions/checkout@v4
128+
- uses: actions/setup-go@v5
129+
with:
130+
go-version-file: 'go.mod'
131+
- name: Install govulncheck
132+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
133+
- name: Run vulnerability scan
134+
run: govulncheck ./...

.github/workflows/cla.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CLA Assistant
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_target:
6+
types: [opened, closed, synchronize]
7+
8+
permissions:
9+
actions: write
10+
contents: read
11+
pull-requests: write
12+
statuses: write
13+
14+
jobs:
15+
cla:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: CLA Assistant
19+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
20+
uses: contributor-assistant/github-action@v2.6.1
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
24+
with:
25+
path-to-signatures: 'signatures/cla.json'
26+
path-to-document: 'https://github.com/Sentinel-Gate/Sentinelgate/blob/main/CLA.md'
27+
branch: 'main'
28+
allowlist: bot*,dependabot*

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
release:
14+
name: Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version-file: 'go.mod'
26+
27+
- name: Run tests
28+
run: go test ./... -race -count=1
29+
30+
- name: Login to GHCR
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
40+
- name: Run GoReleaser
41+
uses: goreleaser/goreleaser-action@v6
42+
with:
43+
version: '~> v2'
44+
args: release --clean
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)