chimera-api 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chimera_api-0.1.1/.gitignore +194 -0
- chimera_api-0.1.1/AGENTS.md +38 -0
- chimera_api-0.1.1/API-DOCUMENTATION.md +997 -0
- chimera_api-0.1.1/Dockerfile +29 -0
- chimera_api-0.1.1/Dockerfile.fargate +20 -0
- chimera_api-0.1.1/Dockerfile.prod +67 -0
- chimera_api-0.1.1/Makefile +165 -0
- chimera_api-0.1.1/PKG-INFO +17 -0
- chimera_api-0.1.1/README.md +226 -0
- chimera_api-0.1.1/app/__init__.py +302 -0
- chimera_api-0.1.1/app/blueprints/admin/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/admin/routes.py +708 -0
- chimera_api-0.1.1/app/blueprints/attack_sim/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/attack_sim/routes.py +577 -0
- chimera_api-0.1.1/app/blueprints/auth/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/auth/routes.py +1158 -0
- chimera_api-0.1.1/app/blueprints/banking/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/banking/routes.py +880 -0
- chimera_api-0.1.1/app/blueprints/checkout/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/checkout/routes.py +124 -0
- chimera_api-0.1.1/app/blueprints/compliance/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/compliance/routes.py +218 -0
- chimera_api-0.1.1/app/blueprints/database_vulnerable/__init__.py +15 -0
- chimera_api-0.1.1/app/blueprints/database_vulnerable/routes.py +340 -0
- chimera_api-0.1.1/app/blueprints/diagnostics/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/diagnostics/routes.py +70 -0
- chimera_api-0.1.1/app/blueprints/ecommerce/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/ecommerce/routes.py +588 -0
- chimera_api-0.1.1/app/blueprints/energy_utilities/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/energy_utilities/routes.py +414 -0
- chimera_api-0.1.1/app/blueprints/genai/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/genai/routes.py +261 -0
- chimera_api-0.1.1/app/blueprints/government/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/government/routes.py +684 -0
- chimera_api-0.1.1/app/blueprints/healthcare/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/healthcare/routes.py +956 -0
- chimera_api-0.1.1/app/blueprints/ics_ot/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/ics_ot/routes.py +266 -0
- chimera_api-0.1.1/app/blueprints/infrastructure/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/infrastructure/routes.py +269 -0
- chimera_api-0.1.1/app/blueprints/insurance/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/insurance/routes.py +838 -0
- chimera_api-0.1.1/app/blueprints/integrations/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/integrations/routes.py +133 -0
- chimera_api-0.1.1/app/blueprints/loyalty/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/loyalty/routes.py +195 -0
- chimera_api-0.1.1/app/blueprints/main/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/main/routes.py +41 -0
- chimera_api-0.1.1/app/blueprints/mobile/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/mobile/routes.py +146 -0
- chimera_api-0.1.1/app/blueprints/payments/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/payments/routes.py +683 -0
- chimera_api-0.1.1/app/blueprints/recorder/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/recorder/routes.py +39 -0
- chimera_api-0.1.1/app/blueprints/saas/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/saas/routes.py +567 -0
- chimera_api-0.1.1/app/blueprints/security_ops/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/security_ops/routes.py +163 -0
- chimera_api-0.1.1/app/blueprints/telecom/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/telecom/routes.py +448 -0
- chimera_api-0.1.1/app/blueprints/testing/__init__.py +13 -0
- chimera_api-0.1.1/app/blueprints/testing/routes.py +364 -0
- chimera_api-0.1.1/app/blueprints/throughput/__init__.py +9 -0
- chimera_api-0.1.1/app/blueprints/throughput/routes.py +75 -0
- chimera_api-0.1.1/app/cli.py +40 -0
- chimera_api-0.1.1/app/database.py +313 -0
- chimera_api-0.1.1/app/error_handlers.py +307 -0
- chimera_api-0.1.1/app/middleware/traffic_recorder.py +67 -0
- chimera_api-0.1.1/app/models/__init__.py +200 -0
- chimera_api-0.1.1/app/models/dal.py +391 -0
- chimera_api-0.1.1/app/models/data_stores.py +363 -0
- chimera_api-0.1.1/app/models.py +216 -0
- chimera_api-0.1.1/app/throughput.py +62 -0
- chimera_api-0.1.1/app/utils/__init__.py +155 -0
- chimera_api-0.1.1/app/utils/auth_helpers.py +528 -0
- chimera_api-0.1.1/app/utils/demo_data.py +1045 -0
- chimera_api-0.1.1/app/utils/monitoring.py +510 -0
- chimera_api-0.1.1/app/utils/responses.py +507 -0
- chimera_api-0.1.1/app/utils/templates.py +124 -0
- chimera_api-0.1.1/app/utils/validators.py +544 -0
- chimera_api-0.1.1/app/web_dist/assets/index-Ce9aAr74.js +613 -0
- chimera_api-0.1.1/app/web_dist/assets/index-DoKhh6ts.css +1 -0
- chimera_api-0.1.1/app/web_dist/index.html +13 -0
- chimera_api-0.1.1/app.py +15 -0
- chimera_api-0.1.1/app.py.monolith +6882 -0
- chimera_api-0.1.1/docs/archive/PHASE_0_FOUNDATIONS.md +538 -0
- chimera_api-0.1.1/docs/archive/PHASE_0_USAGE_EXAMPLES.md +853 -0
- chimera_api-0.1.1/docs/archive/README.md +18 -0
- chimera_api-0.1.1/docs/archive/api-demo-plan.md +37 -0
- chimera_api-0.1.1/docs/openapi.yaml +9522 -0
- chimera_api-0.1.1/gunicorn.conf.py +129 -0
- chimera_api-0.1.1/main.py +6 -0
- chimera_api-0.1.1/project.json +59 -0
- chimera_api-0.1.1/pyproject.toml +32 -0
- chimera_api-0.1.1/scripts/migrate_to_blueprints.py +173 -0
- chimera_api-0.1.1/scripts/run-compose.mjs +87 -0
- chimera_api-0.1.1/scripts/run_tests.sh +252 -0
- chimera_api-0.1.1/scripts/test_auth_workstream.sh +280 -0
- chimera_api-0.1.1/scripts/test_error_handlers.py +136 -0
- chimera_api-0.1.1/scripts/test_workstreams.py +177 -0
- chimera_api-0.1.1/security.py +147 -0
- chimera_api-0.1.1/static/api-styles.css +83 -0
- chimera_api-0.1.1/static/images/galleon-icon-dark.svg +26 -0
- chimera_api-0.1.1/static/images/galleon-icon-light.svg +26 -0
- chimera_api-0.1.1/static/styles.css +63 -0
- chimera_api-0.1.1/tests/README.md +380 -0
- chimera_api-0.1.1/tests/__init__.py +3 -0
- chimera_api-0.1.1/tests/conftest.py +670 -0
- chimera_api-0.1.1/tests/integration/__init__.py +0 -0
- chimera_api-0.1.1/tests/unit/__init__.py +3 -0
- chimera_api-0.1.1/tests/unit/test_admin_routes.py +889 -0
- chimera_api-0.1.1/tests/unit/test_auth_helpers.py +522 -0
- chimera_api-0.1.1/tests/unit/test_auth_routes.py +920 -0
- chimera_api-0.1.1/tests/unit/test_banking_routes.py +25 -0
- chimera_api-0.1.1/tests/unit/test_dal.py +648 -0
- chimera_api-0.1.1/tests/unit/test_demo_data.py +495 -0
- chimera_api-0.1.1/tests/unit/test_ecommerce_routes.py +25 -0
- chimera_api-0.1.1/tests/unit/test_energy_utilities_routes.py +55 -0
- chimera_api-0.1.1/tests/unit/test_government_routes.py +53 -0
- chimera_api-0.1.1/tests/unit/test_healthcare_routes.py +698 -0
- chimera_api-0.1.1/tests/unit/test_insurance_routes.py +75 -0
- chimera_api-0.1.1/tests/unit/test_monitoring.py +533 -0
- chimera_api-0.1.1/tests/unit/test_responses.py +630 -0
- chimera_api-0.1.1/tests/unit/test_saas_routes.py +59 -0
- chimera_api-0.1.1/tests/unit/test_sample.py +254 -0
- chimera_api-0.1.1/tests/unit/test_spa_serving.py +157 -0
- chimera_api-0.1.1/tests/unit/test_telecom_routes.py +55 -0
- chimera_api-0.1.1/tests/unit/test_validators.py +660 -0
- chimera_api-0.1.1/uv.lock +851 -0
- chimera_api-0.1.1/wsgi.py +8 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Build output
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
dist-*/
|
|
8
|
+
|
|
9
|
+
# Python
|
|
10
|
+
__pycache__/
|
|
11
|
+
*.pyc
|
|
12
|
+
*.pyo
|
|
13
|
+
.venv/
|
|
14
|
+
*.egg-info/
|
|
15
|
+
.eggs/
|
|
16
|
+
htmlcov/
|
|
17
|
+
.coverage
|
|
18
|
+
.pytest_cache/
|
|
19
|
+
|
|
20
|
+
# IDE
|
|
21
|
+
.idea/
|
|
22
|
+
.vscode/
|
|
23
|
+
*.swp
|
|
24
|
+
*.swo
|
|
25
|
+
|
|
26
|
+
# OS
|
|
27
|
+
.DS_Store
|
|
28
|
+
Thumbs.db
|
|
29
|
+
|
|
30
|
+
# Nx
|
|
31
|
+
.nx/cache
|
|
32
|
+
.nx/workspace-data
|
|
33
|
+
|
|
34
|
+
# Misc
|
|
35
|
+
*.log
|
|
36
|
+
reports/
|
|
37
|
+
|
|
38
|
+
# ---- Node ----
|
|
39
|
+
# Logs
|
|
40
|
+
logs
|
|
41
|
+
*.log
|
|
42
|
+
npm-debug.log*
|
|
43
|
+
yarn-debug.log*
|
|
44
|
+
yarn-error.log*
|
|
45
|
+
lerna-debug.log*
|
|
46
|
+
|
|
47
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
48
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
49
|
+
|
|
50
|
+
# Runtime data
|
|
51
|
+
pids
|
|
52
|
+
*.pid
|
|
53
|
+
*.seed
|
|
54
|
+
*.pid.lock
|
|
55
|
+
|
|
56
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
57
|
+
lib-cov
|
|
58
|
+
|
|
59
|
+
# Coverage directory used by tools like istanbul
|
|
60
|
+
coverage
|
|
61
|
+
*.lcov
|
|
62
|
+
|
|
63
|
+
# nyc test coverage
|
|
64
|
+
.nyc_output
|
|
65
|
+
|
|
66
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
67
|
+
.grunt
|
|
68
|
+
|
|
69
|
+
# Bower dependency directory (https://bower.io/)
|
|
70
|
+
bower_components
|
|
71
|
+
|
|
72
|
+
# node-waf configuration
|
|
73
|
+
.lock-wscript
|
|
74
|
+
|
|
75
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
76
|
+
build/Release
|
|
77
|
+
|
|
78
|
+
# Dependency directories
|
|
79
|
+
node_modules/
|
|
80
|
+
jspm_packages/
|
|
81
|
+
|
|
82
|
+
# Snowpack dependency directory (https://snowpack.dev/)
|
|
83
|
+
web_modules/
|
|
84
|
+
|
|
85
|
+
# TypeScript cache
|
|
86
|
+
*.tsbuildinfo
|
|
87
|
+
|
|
88
|
+
# Optional npm cache directory
|
|
89
|
+
.npm
|
|
90
|
+
|
|
91
|
+
# Optional eslint cache
|
|
92
|
+
.eslintcache
|
|
93
|
+
|
|
94
|
+
# Optional stylelint cache
|
|
95
|
+
.stylelintcache
|
|
96
|
+
|
|
97
|
+
# Optional REPL history
|
|
98
|
+
.node_repl_history
|
|
99
|
+
|
|
100
|
+
# Output of 'npm pack'
|
|
101
|
+
*.tgz
|
|
102
|
+
|
|
103
|
+
# Yarn Integrity file
|
|
104
|
+
.yarn-integrity
|
|
105
|
+
|
|
106
|
+
# dotenv environment variable files
|
|
107
|
+
.env
|
|
108
|
+
.env.*
|
|
109
|
+
!.env.example
|
|
110
|
+
|
|
111
|
+
# direnv
|
|
112
|
+
.envrc
|
|
113
|
+
|
|
114
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
115
|
+
.cache
|
|
116
|
+
.parcel-cache
|
|
117
|
+
|
|
118
|
+
# Next.js build output
|
|
119
|
+
.next
|
|
120
|
+
out
|
|
121
|
+
|
|
122
|
+
# Nuxt.js build / generate output
|
|
123
|
+
.nuxt
|
|
124
|
+
dist
|
|
125
|
+
.output
|
|
126
|
+
|
|
127
|
+
# Gatsby files
|
|
128
|
+
.cache/
|
|
129
|
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
130
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
131
|
+
# public
|
|
132
|
+
|
|
133
|
+
# vuepress build output
|
|
134
|
+
.vuepress/dist
|
|
135
|
+
|
|
136
|
+
# vuepress v2.x temp and cache directory
|
|
137
|
+
.temp
|
|
138
|
+
.cache
|
|
139
|
+
|
|
140
|
+
# Sveltekit cache directory
|
|
141
|
+
.svelte-kit/
|
|
142
|
+
|
|
143
|
+
# vitepress build output
|
|
144
|
+
**/.vitepress/dist
|
|
145
|
+
|
|
146
|
+
# vitepress cache directory
|
|
147
|
+
**/.vitepress/cache
|
|
148
|
+
|
|
149
|
+
# Docusaurus cache and generated files
|
|
150
|
+
.docusaurus
|
|
151
|
+
|
|
152
|
+
# Serverless directories
|
|
153
|
+
.serverless/
|
|
154
|
+
|
|
155
|
+
# FuseBox cache
|
|
156
|
+
.fusebox/
|
|
157
|
+
|
|
158
|
+
# DynamoDB Local files
|
|
159
|
+
.dynamodb/
|
|
160
|
+
|
|
161
|
+
# Firebase cache directory
|
|
162
|
+
.firebase/
|
|
163
|
+
|
|
164
|
+
# TernJS port file
|
|
165
|
+
.tern-port
|
|
166
|
+
|
|
167
|
+
# Stores VSCode versions used for testing VSCode extensions
|
|
168
|
+
.vscode-test
|
|
169
|
+
|
|
170
|
+
# pnpm
|
|
171
|
+
.pnpm-store
|
|
172
|
+
|
|
173
|
+
# yarn v3
|
|
174
|
+
.pnp.*
|
|
175
|
+
.yarn/*
|
|
176
|
+
!.yarn/patches
|
|
177
|
+
!.yarn/plugins
|
|
178
|
+
!.yarn/releases
|
|
179
|
+
!.yarn/sdks
|
|
180
|
+
!.yarn/versions
|
|
181
|
+
|
|
182
|
+
# Vite files
|
|
183
|
+
vite.config.js.timestamp-*
|
|
184
|
+
vite.config.ts.timestamp-*
|
|
185
|
+
.vite/
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
# Bundled web frontend (built by vite into Flask package)
|
|
189
|
+
apps/vuln-api/app/web_dist/*
|
|
190
|
+
!apps/vuln-api/app/web_dist/.gitkeep
|
|
191
|
+
|
|
192
|
+
# Agents
|
|
193
|
+
**/reviews/
|
|
194
|
+
backlog/
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Repository Guidelines
|
|
2
|
+
|
|
3
|
+
## Project Structure & Ownership
|
|
4
|
+
- `app/`: Flask code split by blueprint domains (`blueprints/`), data layer (`models/`), and helpers (`utils/`).
|
|
5
|
+
- `tests/`: Unit (`tests/unit`), integration (`tests/integration`), and security/vulnerability suites (`tests/vulnerability`, `tests/smoke`).
|
|
6
|
+
- `docs/` and `API-DOCUMENTATION.md`: Endpoint reference and contributor notes; update when adding routes or payload examples.
|
|
7
|
+
- `static/`: Demo assets served by Flask; keep large files out of git.
|
|
8
|
+
- Entrypoints: `app.py` for local dev, `wsgi.py`/`gunicorn.conf.py` for deployment.
|
|
9
|
+
|
|
10
|
+
## Build, Run, and Dev Workflow
|
|
11
|
+
- `uv sync --extra dev --frozen`: Install Python 3.12 deps into `.venv` (preferred, matches Docker).
|
|
12
|
+
- `uv run python app.py`: Launch locally in vulnerable mode; visit `http://localhost:5000`.
|
|
13
|
+
- `USE_DATABASE=true uv run python app.py`: Enable SQLite-backed SQLi scenarios.
|
|
14
|
+
- `make run` / `make run-vulnerable`: Gunicorn with `DEMO_MODE=full` (intentionally unsafe).
|
|
15
|
+
- `make run-secure`: Hardened mode (`DEMO_MODE=strict`) for control comparisons.
|
|
16
|
+
- Docker: `docker build -t demo-api .` then `docker run -p 8080:80 demo-api` (honors `USE_DATABASE` env var).
|
|
17
|
+
|
|
18
|
+
## Testing Guidelines
|
|
19
|
+
- Default: `make test` (delegates to `./run_tests.sh all`).
|
|
20
|
+
- Fast feedback: `make test-quick` or `make test-unit`.
|
|
21
|
+
- Security focus: `make test-vulnerability` (pytest `-m vulnerability`), smoke checks via `make test-smoke`.
|
|
22
|
+
- Coverage: `make test-coverage` (fails <80%); HTML report via `make test-report` → `reports/test_report.html`.
|
|
23
|
+
- Naming: use `test_<feature>.py` and pytest-style functions; place fixtures near consuming tests or under `tests/conftest.py`.
|
|
24
|
+
|
|
25
|
+
## Coding Style & Tooling
|
|
26
|
+
- Formatting: `make format` (black, 120-char lines). Linting: `make lint` (flake8 + pylint; docstring warnings disabled). Fix style before pushing.
|
|
27
|
+
- Prefer explicit imports, typed function signatures where feasible, and small, isolated fixtures for new vulnerabilities.
|
|
28
|
+
- Configuration via env vars: `DEMO_MODE` (`full` vs `strict`), `USE_DATABASE` (enable SQLi), plus feature toggles in `security.py`.
|
|
29
|
+
|
|
30
|
+
## Commit & PR Expectations
|
|
31
|
+
- Follow Conventional Commits seen in history, e.g., `feat(api)`, `refactor(load-testing)`, `docs(readme)` with scope where meaningful.
|
|
32
|
+
- PRs should include: problem statement, summary of changes, relevant `make`/`uv run` commands executed, and screenshots or curl samples for new endpoints.
|
|
33
|
+
- Keep changes small and grouped by domain blueprint; update docs and tests in the same PR.
|
|
34
|
+
|
|
35
|
+
## Security & Safe Handling
|
|
36
|
+
- This app is intentionally vulnerable; never point at production data or networks.
|
|
37
|
+
- Run demos in isolated environments, and explicitly set `DEMO_MODE=strict` when showcasing mitigations.
|
|
38
|
+
- Rotate and avoid committing secrets; prefer env vars and keep `.env` files out of version control.
|