Skip to content

Commit 8fcdad0

Browse files
committed
Add environment configuration and code of conduct
- Introduced `.env.example` for environment variable setup, including LLM provider and API keys. - Added `CODE_OF_CONDUCT.md` to establish community standards and expectations for project participation. - Updated `CONTRIBUTING.md` to reflect new installation instructions using `make`. - Created `SECURITY.md` to outline the security policy and reporting process. - Enhanced `README.md` with clearer project descriptions and usage examples. - Added a `Makefile` for simplified development tasks and dependency management. - Included initial test cases for new functionalities in the testing framework.
1 parent 0e06cbf commit 8fcdad0

25 files changed

Lines changed: 895 additions & 266 deletions

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Choose one provider/model pair for LiteLLM
2+
SECNODE_LLM=openai/gpt-4o
3+
4+
# Provider API keys
5+
OPENAI_API_KEY=
6+
ANTHROPIC_API_KEY=
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Report incorrect behavior or regression
4+
title: "[Bug] "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## Description
10+
11+
## Steps To Reproduce
12+
13+
1.
14+
2.
15+
3.
16+
17+
## Expected Behavior
18+
19+
## Actual Behavior
20+
21+
## Environment
22+
23+
- OS:
24+
- Python:
25+
- Model provider:
26+
- Command run:
27+
28+
## Logs / Traceback
29+
30+
```text
31+
paste logs
32+
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Propose an enhancement
4+
title: "[Feature] "
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## Problem Statement
10+
11+
## Proposed Solution
12+
13+
## Alternatives Considered
14+
15+
## Security / Risk Considerations
16+
17+
## Additional Context

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Summary
2+
3+
-
4+
5+
## Why
6+
7+
-
8+
9+
## Changes
10+
11+
-
12+
13+
## Test Plan
14+
15+
- [ ] `pytest`
16+
- [ ] `ruff check src tests`
17+
- [ ] Manual CLI sanity check
18+
19+
## Security Impact
20+
21+
- [ ] No security impact
22+
- [ ] Security-sensitive behavior changed (describe below)
23+
24+
## Checklist
25+
26+
- [ ] Documentation updated
27+
- [ ] Backward compatibility reviewed

.github/workflows/secnode-pentest.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: secnode-api-pentest
1+
name: secnode-api-ci
22

33
on:
44
pull_request:
55

66
jobs:
7-
test:
7+
lint-test-build:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
@@ -17,11 +17,19 @@ jobs:
1717
- name: Install dependencies
1818
run: pip install -r requirements.txt && pip install -e .[dev]
1919

20-
- name: Run tests
20+
- name: Lint
21+
run: ruff check src tests
22+
23+
- name: Run tests with coverage
2124
run: pytest
2225

26+
- name: Build package
27+
run: |
28+
python -m pip install build
29+
python -m build
30+
2331
security-scan:
24-
needs: test
32+
needs: lint-test-build
2533
runs-on: ubuntu-latest
2634
steps:
2735
- uses: actions/checkout@v4

CODE_OF_CONDUCT.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We commit to making participation in this project a harassment-free experience for everyone.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to a positive environment:
10+
11+
- Respectful and constructive feedback
12+
- Professional disagreement focused on technical outcomes
13+
- Responsible disclosure and safe security research practices
14+
15+
Unacceptable behavior includes:
16+
17+
- Harassment, insults, or discriminatory language
18+
- Publishing private information without consent
19+
- Any exploit-sharing that can harm real systems
20+
21+
## Enforcement Responsibilities
22+
23+
Project maintainers are responsible for clarifying and enforcing this Code of Conduct and may remove or reject content that violates it.
24+
25+
## Scope
26+
27+
This Code of Conduct applies in project spaces, issue trackers, pull requests, discussions, and community channels linked to this repository.
28+
29+
## Reporting
30+
31+
Report violations privately to maintainers through the security contact process in `SECURITY.md`.

CONTRIBUTING.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ Thank you for your interest in contributing to SecNode API! This guide will help
2525

2626
3. **Install dependencies**
2727
```bash
28-
pip install -r requirements.txt
29-
pip install -e .[dev]
28+
make install-dev
3029
```
3130

3231
4. **Configure your LLM provider**
@@ -45,6 +44,14 @@ Thank you for your interest in contributing to SecNode API! This guide will help
4544
secnodeapi --target https://api.example.com/swagger.json
4645
```
4746

47+
### Development quality checks
48+
49+
```bash
50+
make lint
51+
make test
52+
make build
53+
```
54+
4855
## Enhancing the AI Engine
4956

5057
SecNode relies heavily on its `ai/` package (`understand`, `generate`, `validate`) for cognitive test generation and verification.
@@ -79,7 +86,7 @@ SecNode relies heavily on its `ai/` package (`understand`, `generate`, `validate
7986
- Use Python type hints (`typing`) for all functions and Pydantic models.
8087
- Write docstrings for all public methods.
8188
- Keep functions tightly focused and under 100 lines.
82-
- No `print()` statements use `structlog` (`logger.info()`, `logger.error()`).
89+
- Avoid debug `print()` statements in library code; use `structlog` (`logger.info()`, `logger.error()`).
8390

8491
## Reporting Issues
8592

Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
PYTHON ?= python
2+
3+
.PHONY: install install-dev lint test test-cov build run clean
4+
5+
install:
6+
$(PYTHON) -m pip install -r requirements.txt
7+
$(PYTHON) -m pip install -e .
8+
9+
install-dev:
10+
$(PYTHON) -m pip install -r requirements.txt
11+
$(PYTHON) -m pip install -e .[dev]
12+
13+
lint:
14+
ruff check src tests
15+
16+
test:
17+
pytest
18+
19+
test-cov:
20+
pytest --cov=src/secnodeapi --cov-report=term-missing --cov-fail-under=70
21+
22+
build:
23+
$(PYTHON) -m pip install build
24+
$(PYTHON) -m build
25+
26+
run:
27+
secnodeapi --help
28+
29+
clean:
30+
$(PYTHON) -c "import shutil, pathlib; [shutil.rmtree(p, ignore_errors=True) for p in ['dist','build','.pytest_cache','htmlcov']]; [q.unlink() for q in pathlib.Path('.').rglob('*.pyc')]"

0 commit comments

Comments
 (0)