-
Notifications
You must be signed in to change notification settings - Fork 1
docs: improve API reference to match actual codebase #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -307,22 +307,30 @@ WebSocket connections handle errors gracefully: | |||||
|
|
||||||
| ## Authentication | ||||||
|
|
||||||
| ### Current Implementation | ||||||
| - No authentication required (local access only) | ||||||
| - Dashboard only accessible on localhost interface | ||||||
| ### Bearer Token (Optional) | ||||||
|
|
||||||
| When the dashboard is constructed with `auth_token`, all `/api/*` and `/ws` requests must | ||||||
| present a valid token: | ||||||
|
|
||||||
| - **HTTP**: `Authorization: Bearer <token>` header | ||||||
| - **WebSocket**: `?token=<value>` query parameter | ||||||
| - The dashboard HTML page (`/`) is not gated by auth. | ||||||
|
|
||||||
| When `auth_token` is `None` (the default), no authentication is enforced. | ||||||
|
|
||||||
| ### Security Considerations | ||||||
| - Dashboard binds only to localhost (127.0.0.1) | ||||||
| - No external network access | ||||||
| - Dashboard defaults to localhost (127.0.0.1) binding | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win Use the actual default host value.
🤖 Prompt for AI Agents |
||||||
| - Binding to `0.0.0.0` logs a security warning — ensure `auth_token` is set or restrict | ||||||
| access via firewall when exposing externally | ||||||
| - Runs as user service (no root privileges) | ||||||
|
|
||||||
| ## CORS Configuration | ||||||
|
|
||||||
| Cross-Origin Resource Sharing (CORS) is configured to allow: | ||||||
| - **Origins**: All origins (`*`) | ||||||
| - **Methods**: All methods | ||||||
| - **Headers**: All headers | ||||||
| - **Credentials**: Allowed | ||||||
| Cross-Origin Resource Sharing (CORS) is configured as follows: | ||||||
|
|
||||||
| - **Origins**: Defaults to the dashboard's own `host:port` (not `*`) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win Document the wildcard-bind CORS exception.
Proposed wording-- **Origins**: Defaults to the dashboard's own `host:port` (not `*`)
+- **Origins**: Defaults to the dashboard origin; for `0.0.0.0` or `::`, defaults to `http://localhost:<port>` (not `*`)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| - Wildcard `*` origins explicitly disable `allow_credentials` per the CORS specification | ||||||
| - Methods and headers are unrestricted for allowed origins | ||||||
|
|
||||||
| ## Usage Examples | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
rg -n -C 12 'def _auth_middleware|Authorization|bearer\.|query.*token|WebSocket' evoseal/services/monitoring_dashboard.pyRepository: SHA888/EVOSEAL
Length of output: 14684
🏁 Script executed:
Repository: SHA888/EVOSEAL
Length of output: 8553
Document the supported WebSocket auth transport correctly.
doc/API_REFERENCE.md:316currently says only?token=<value>, butevoseal/services/monitoring_dashboard.pysupportsSec-WebSocket-Protocol: bearer.<token>as the header-based handshake path and the embedded dashboard JS uses that path. Update the API reference to list the supported WebSocket mechanisms and avoid making?token=<value>look like the only or preferred option.🤖 Prompt for AI Agents