Skip to content

Commit b969d12

Browse files
committed
feat[security]: Security and performance improvements v1 (#11)
* feat[security]: Security and performance improvements v1 - Fixed filter chaining so resource/route middleware executes and added coverage. - Isolated CORS allowlist state per filter and verified behavior. - Preserved upstream request contexts in the adapter. - Made security caching opt-in and documented with tests. - This is version 1.0.0, will receive no new features only security updates as needed. * chore[security]: SNYK-GOLANG-GITHUBCOMSIRUPSENLOGRUS-5564391 Upgraded github.com/sirupsen/logrus to v1.9.1 Rel: https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMSIRUPSENLOGRUS-5564391
1 parent dc20f02 commit b969d12

59 files changed

Lines changed: 650 additions & 332 deletions

Some content is hidden

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

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CODEOWNERS: specify people or teams responsible for changes
2+
# Format: path @username-or-team
3+
# Use @srfrog as default owner for reviews. Adjust as needed.
4+
5+
* @srfrog

.github/CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing to go-relax
2+
3+
Thanks for your interest in contributing to go-relax!
4+
5+
Table of contents
6+
- How to contribute
7+
- Reporting bugs
8+
- Submitting changes (PR workflow)
9+
- Testing and linting
10+
- Commit message guidelines
11+
- Code of conduct
12+
13+
How to contribute
14+
1. Fork the repository.
15+
2. Create a branch from master:
16+
- git checkout -b <your-branch-name>
17+
3. Make small, focused changes with tests where appropriate.
18+
4. Run the tests and linters locally (instructions below).
19+
5. Push your branch to your fork and open a Pull Request against srfrog/go-relax master.
20+
21+
Reporting bugs
22+
- Open an issue using the Bug Report template.
23+
- Include: steps to reproduce, expected vs actual behavior, Go version, OS.
24+
25+
Submitting changes (PR workflow)
26+
- Open a pull request from your fork to srfrog/go-relax master.
27+
- Use the provided PR template and fill in all checklist items.
28+
- Keep PRs focused and small where possible.
29+
- If requested, respond to review comments and push updates to the same branch.
30+
- If you allow “edits by maintainers” that helps maintainers make small fixes.
31+
32+
Testing and linting (local)
33+
- Install Go (1.20+ recommended).
34+
- Run unit tests:
35+
- go test ./...
36+
- Run go vet:
37+
- go vet ./...
38+
- Run gofmt check:
39+
- gofmt -l . # should print no files
40+
- Optional linting (recommended):
41+
- golangci-lint run
42+
43+
Commit message guidelines
44+
- Keep a short subject line (<=72 chars).
45+
- Use the imperative mood: "Fix", "Add", "Remove".
46+
- Optionally include a longer body explaining why the change is necessary.
47+
- If you must sign-off, include Signed-off-by: Name <email>.
48+
49+
Code of Conduct
50+
- Be respectful and constructive in reviews and issues. Maintainers reserve the right to close or redirect contributions that do not follow community standards.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG]"
5+
labels: bug
6+
assignees: srfrog
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior.
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Screenshots**
20+
If applicable, add screenshots to help explain your problem.
21+
22+
**Additional context**
23+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[FEATURE]"
5+
labels: enhancement
6+
assignees: srfrog
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### Summary
2+
3+
<!-- Brief description of the change -->
4+
5+
### Related issues
6+
<!-- Link issue(s) if any, e.g. Fixes #123 -->
7+
8+
### Checklist
9+
- [ ] I have run tests locally and they pass: `go test ./...`
10+
- [ ] I have run linters: `gofmt -l .` / `golangci-lint run` (if available)
11+
- [ ] I have added tests if applicable
12+
- [ ] I have updated documentation if needed
13+
14+
### Notes for reviewers
15+
<!-- Anything the reviewer should know; short and focused -->

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
permissions:
3+
contents: read
4+
5+
on:
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
push:
9+
branches:
10+
- master
11+
12+
jobs:
13+
test:
14+
name: Test and Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v4
24+
with:
25+
go-version: '1.20'
26+
27+
- name: Cache Go modules
28+
uses: actions/cache@v4
29+
with:
30+
path: |
31+
~/.cache/go-build
32+
${{ github.workspace }}/pkg/mod
33+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
34+
35+
- name: Install linters
36+
run: |
37+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.0
38+
39+
- name: Run gofmt check
40+
run: |
41+
if [ -n "$(gofmt -l .)" ]; then
42+
echo "gofmt needs to be run on the following files:"
43+
gofmt -l .
44+
exit 1
45+
fi
46+
47+
- name: Run go vet
48+
run: go vet ./...
49+
50+
- name: Run golangci-lint
51+
run: golangci-lint run ./...
52+
53+
- name: Run tests
54+
run: go test -v ./...

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/go.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
11+
build:
12+
name: Build
13+
permissions:
14+
contents: read
15+
runs-on: ubuntu-latest
16+
steps:
17+
18+
- name: Set up Go 1.x
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: ^1.14
22+
23+
- name: Check out code into the Go module directory
24+
uses: actions/checkout@v2
25+
26+
- name: Get dependencies
27+
run: |
28+
go get -v -t -d ./...
29+
30+
- name: Build
31+
run: go build -v .
32+
33+
- name: Test
34+
run: go test -v .

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ _*
1111
vendor/*
1212
!vendor/vendor.json
1313

14+
.vscode

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
3434

3535
## Enforcement
3636

37-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at github@codehack.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at github@castlebytes.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
3838

3939
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
4040

0 commit comments

Comments
 (0)