Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
68611d8
refactor(rest): separate service model and parser
JedimEmO Sep 5, 2026
df4a90e
refactor(rest): separate server generation responsibilities
JedimEmO Sep 5, 2026
ae345e7
refactor(jsonrpc): separate service model and parser
JedimEmO Sep 5, 2026
1c31587
refactor(jsonrpc): separate HTTP handling and method dispatch
JedimEmO Sep 5, 2026
4b5edef
refactor(explorer): give shared assets explicit package ownership
JedimEmO Sep 5, 2026
dc80044
refactor(websocket): separate subscription policy and handler tests
JedimEmO Sep 5, 2026
dbcec15
refactor(websocket): isolate callbacks IO and lifecycle configuration
JedimEmO Sep 5, 2026
1e39481
refactor(explorer): separate embedded source responsibilities
JedimEmO Sep 5, 2026
7886e52
refactor(file): separate server generation responsibilities
JedimEmO Sep 5, 2026
c99b62c
refactor(rest): separate OpenAPI schema and operation emission
JedimEmO Sep 5, 2026
db78da5
refactor(jsonrpc): separate OpenRPC schema examples and methods
JedimEmO Sep 5, 2026
aceaf08
refactor(auth): separate HTTP credential cookie and CSRF policy
JedimEmO Sep 5, 2026
797487e
refactor(session): separate JWT policy and session lifecycle
JedimEmO Sep 5, 2026
852e414
refactor(oauth2): separate authorization and token validation policy
JedimEmO Sep 5, 2026
462e3ca
refactor(transport): separate query serialization and path encoding
JedimEmO Sep 5, 2026
5811d1b
refactor(observability): depend on http header types directly
JedimEmO Sep 5, 2026
1053ef6
refactor(websocket): organize client tests by responsibility
JedimEmO Sep 5, 2026
4190b1b
refactor(websocket): separate client builder and message driver
JedimEmO Sep 5, 2026
448e778
refactor(chat): expose application construction from the library
JedimEmO Sep 5, 2026
7a696cd
test(chat): exercise production application wiring in fixtures
JedimEmO Sep 5, 2026
1a39ad7
fix(wasm-ui): pass task detail CSS classes as separate tokens
JedimEmO Sep 5, 2026
93b7ab6
refactor(wasm-ui): separate app state and component renderers
JedimEmO Sep 5, 2026
e1aaa89
refactor(websocket): separate wire models and sender adapters
JedimEmO Sep 5, 2026
7417719
refactor(rest): organize integration tests by behavior
JedimEmO Sep 5, 2026
b334569
refactor(jsonrpc): organize integration tests by behavior
JedimEmO Sep 5, 2026
5b11f80
refactor(file): organize upload and transfer test scenarios
JedimEmO Sep 5, 2026
597db89
refactor(identity): move local provider tests into a companion module
JedimEmO Sep 5, 2026
361f2ff
test(macros): name HTTP service contract suites by behavior
JedimEmO Sep 5, 2026
67a21a9
ci: verify stacked merge requests and record refactor checkpoints
JedimEmO Sep 5, 2026
6220a42
ci: retain existing workflow permissions for refactor verification
JedimEmO Sep 5, 2026
8c0a03c
docs: record final refactor validation and application contract
JedimEmO Sep 5, 2026
b585b51
Merge master after comment cleanup
JedimEmO Sep 5, 2026
cf5493b
refactor(explorer): make embedded assets standalone fragments
JedimEmO Sep 5, 2026
a6ac35f
ci: run the WASM UI browser test in the WASM UI example job
JedimEmO Sep 5, 2026
9baa9dc
test(chat): drive the router WebSocket test through the generated client
JedimEmO Sep 5, 2026
2cb5ff6
deps: align tokio-tungstenite with the version Axum uses
JedimEmO Sep 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,27 @@ jobs:
npm ci
npm run build

- name: Install Playwright package
working-directory: tests/playwright
run: npm ci

- name: Install Playwright browsers
working-directory: tests/playwright
run: npx playwright install --with-deps chromium

- name: Run WASM UI browser tests
working-directory: tests/playwright
run: npm test -- --config wasm-ui.config.ts

- name: Upload WASM UI test results
if: failure()
uses: actions/upload-artifact@v7.0.1
with:
name: wasm-ui-test-results
path: tests/playwright/test-results
if-no-files-found: ignore
retention-days: 7

coverage:
name: Coverage report
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ sketchpad/

# External security review input (not part of the published repo)
SECURITY_FINDINGS.md

# Specification emitter source modules are not generated documents.
!crates/rest/ras-rest-macro/src/openapi/
!crates/rpc/ras-jsonrpc-macro/src/openrpc/
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Changed - 2026-09-05 (responsibility boundaries refactor)
- **`tokio-tungstenite` aligned with Axum** (`ras-jsonrpc-bidirectional-client`, `-server`, `-types`, `-macro`). The workspace pin moved from 0.26 to 0.29, the version Axum 0.8 already used, so the lockfile carries a single copy of `tungstenite` and `tokio-tungstenite`. No source changes were needed.
- **New `ras-api-explorer-assets` crate** (`crates/specs`). The browser API explorer that `ras-rest-macro` and `ras-jsonrpc-macro` embed now lives in its own dependency-free crate as standalone HTML, CSS and JavaScript files assembled at compile time into `TEMPLATE`, with the configuration placeholder exported as `CONFIG_PLACEHOLDER`. Previously the JSON-RPC macro read the template from the REST macro's source tree with a relative `include_str!`, which broke outside the workspace. Publish this crate before either macro. The served explorer differs from the previous one only in whitespace around the style and script wrapper tags.
- Large modules were split by responsibility across the macro, auth, identity, transport and bidirectional crates without changing public paths, generated code, or behavior; moved types are re-exported from their previous locations. Integration suites were regrouped into scenario modules under the same test targets, and the `xm_feedback_*` macro test targets were renamed to `http_service_contracts`.

### Fixed - 2026-09-05 (audit remediation, fifth review pass)
- **`ConnectionContext::subscribe` is the only subscription mutation, and it is checked** (`ras-jsonrpc-bidirectional-server`, breaking). The context now carries the service's `SubscriptionPolicy` (limits, shared accounting, manager) and `subscribe` enforces topic length and the per-connection cap under the connection's write guard, reserves a global slot atomically, and mirrors into the manager, returning `BidirectionalError` on refusal instead of `()`. `unsubscribe` releases the slot and the manager entry. The `info` field is no longer public, so there is no unchecked path: a handler subscribing from `on_connect`, `handle_request` or anywhere else is limited and counted exactly like a client-driven subscribe, and teardown releases only what was reserved, so the counter cannot underflow. The handler-level reconciliation (`sync_subscriptions`) and `WebSocketHandler::with_subscription_limits` / `with_subscription_accounting` are gone; attach the policy with `ConnectionContext::with_subscription_policy` (the service does this automatically). Regression test subscribes greedily from both `on_connect` and `handle_subscribe` and asserts exactly the cap was accepted and the counter returns to zero.

Expand Down
80 changes: 21 additions & 59 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ sha2 = "0.10"
subtle = "2.6"
tempfile = "3.13"
thiserror = "2.0"
tokio-tungstenite = "0.26"
tokio-tungstenite = "0.29"
tower-http = "0.6"
tracing = "0.1"
url = "2.5"
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ crates/
│ └── ras-identity-session # JWT session management
├── observability/ # Monitoring and metrics
│ └── ras-observability-otel # OpenTelemetry implementation
├── specs/ # Specification types
│ └── ras-openrpc-types # OpenRPC 1.3.2 spec types
├── specs/ # Specifications and their shared assets
│ ├── ras-api-explorer-assets # Embedded API explorer shared by the REST and JSON-RPC macros
│ ├── ras-openrpc-types # OpenRPC 1.3.2 spec types
│ └── ras-permission-manifest # Permission manifest types
examples/ # Example applications
├── basic-jsonrpc/ # JSON-RPC service demo
├── bidirectional-chat/ # Real-time chat system
Expand Down
Loading
Loading