feat: add connection config support - #184
Conversation
7b14757 to
fd200b0
Compare
There was a problem hiding this comment.
Pull request overview
This PR bumps app_bridge to 5.0.0 and introduces WIT v5 (standout:app@5.0.0) with a new exported connections interface so components can embed and expose a validated connection-config JSON document to the Ruby API.
Changes:
- Add Ruby-side
connections_supported?/connection_configAPI, including JSON Schema validation viaAppBridge::ConnectionConfigValidator+ newConnectionConfigError. - Add WIT v5 bindings + loader order update (try v5 first) and wire v5 into the Rust host implementations (http/file/env).
- Add schema/docs/tests and a new v5 Rust WASM fixture + build task updates.
Reviewed changes
Copilot reviewed 22 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tasks/fixtures.rake | Updates fixture build tasks; adds v5 fixture compilation task and switches v4 copy behavior. |
| spec/spec_helper.rb | Ensures Bundler is set up before loading the gem in specs. |
| spec/fixtures/components/rust_app_v5/src/lib.rs | New v5 Rust component fixture exporting connections.connection-config. |
| spec/fixtures/components/rust_app_v5/Cargo.toml | New Cargo manifest for the v5 Rust fixture. |
| spec/fixtures/components/rust_app_v5/Cargo.lock | New lockfile for the v5 Rust fixture dependencies. |
| spec/app_bridge/connections_spec.rb | Specs for v5 connections behavior + fallback behavior on v4 components. |
| spec/app_bridge/connection_config_validator_spec.rb | Specs for schema validation and error reporting behavior. |
| README.md | Documents the new v5 connection configuration contract and extraction behavior. |
| lib/app_bridge/version.rb | Bumps gem version to 5.0.0. |
| lib/app_bridge/connection_config_validator.rb | Adds JSON Schema validator for connection-config. |
| lib/app_bridge/app.rb | Adds Ruby API methods for connections support + validated config retrieval. |
| lib/app_bridge.rb | Wires validator + defines ConnectionConfigError. |
| Gemfile.lock | Updates gem version and adds json_schemer (and dependencies). |
| app_bridge.gemspec | Adds runtime dependency on json_schemer. |
| ext/app_bridge/wit/v5/world.wit | Introduces WIT v5 world including exported connections interface. |
| ext/app_bridge/docs/connection-config-schema.json | Adds the bundled JSON Schema used for validation. |
| ext/app_bridge/Cargo.toml | Bumps native extension crate version to 5.0.0. |
| Cargo.toml | Excludes the v5 fixture crate from the workspace. |
| Cargo.lock | Updates workspace lock to app_bridge 5.0.0. |
| ext/app_bridge/src/wrappers/app.rs | Adds Rust wrapper methods for connections_supported and connection_config. |
| ext/app_bridge/src/lib.rs | Exposes the new Ruby methods (connections_supported?, _rust_connection_config, etc.). |
| ext/app_bridge/src/component.rs | Adds v5 component bindings, instantiation order, and connections call plumbing. |
| ext/app_bridge/src/request_builder.rs | Enables HTTP host support for v5. |
| ext/app_bridge/src/file_ops.rs | Enables file host support for v5. |
| ext/app_bridge/src/app_state.rs | Implements required host traits for v5. |
| .gitignore | Ignores vendored Bundler directory. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fd200b0 to
122ada9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 122ada9. Configure here.
| end | ||
| rescue JSON::ParserError => e | ||
| raise AppBridge::ConnectionConfigError, "Invalid connection-config JSON: #{e.message}" | ||
| end |
There was a problem hiding this comment.
Symbol keys break config validation
Medium Severity
parse_data returns a Ruby Hash unchanged, so symbol keys never match the string keys in the JSON Schema. json_schemer checks required properties with key set difference, so idiomatic symbol-keyed hashes (including the new validator specs and the documented CI-without-WASM path) fail validation even when the config is valid. The WASM string path is unaffected because JSON.parse yields string keys.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 122ada9. Configure here.


Note
Medium Risk
Major additive WIT/API change around auth connection config, but older connectors remain supported and this gem only extracts/validates declarative JSON rather than running OAuth flows.
Overview
Bumps to 5.0.0 and adds WIT v5 so connectors can export embedded connection-config JSON through a new
connectionsinterface. Older WIT versions keep working; v5 is tried first on load.App#connection_configreads that JSON and validates it withConnectionConfigValidatoragainst the new schema (OAuth2, API key, session, runtime headers/templates, post-connect hooks).connections_supported?reports whether the loaded component has the interface.Also adds a v5 fixture connector, schema docs, and
json_schemeras a gem dependency.Reviewed by Cursor Bugbot for commit 122ada9. Bugbot is set up for automated code reviews on this repo. Configure here.