Thanks to visit codestin.com
Credit goes to lib.rs

#product-os #openapi

product-os-connector

Product OS : Connector provides a framework for definining a server with APIs, outward API calls, a workflow to pass data along, all using only configuration that can be defined in JSON or Yaml. This flexible and powerful framework is akin to using automation tools like Zapier and IFTTT and tray.io and supports using OpenAPI / Swagger defined APIs.

25 releases

0.0.28 Feb 9, 2026
0.0.27 Feb 9, 2026
0.0.25 Jan 27, 2025
0.0.19 Jun 14, 2024
0.0.5 Aug 21, 2023

#259 in Authentication

GPL-3.0-only and AGPL-3.0-only

1.5MB
39K SLoC

Product OS : Connector

Crates.io Documentation License: GPL-3.0

Product OS : Connector provides a framework for defining a server with APIs, outward API calls, and workflows to pass data along, all using only configuration that can be defined in JSON or YAML. This flexible and powerful framework is akin to automation tools like Zapier, IFTTT, and Tray.io, and supports using OpenAPI/Swagger defined APIs.

What is Product OS?

Product OS is a collection of packages that provide different tools and features that can work together to build products more easily for the Rust ecosystem.

Features

  • Configuration-Driven: Define APIs and workflows using JSON or YAML
  • OpenAPI Support: Import and use OpenAPI/Swagger defined APIs
  • Workflow Engine: Chain API calls and data transformations
  • JWT Authentication: Built-in JWT token verification and encryption
  • No-std Support: Works in no_std environments with alloc
  • Flexible Data Types: Support for various data formats and transformations

Installation

Add Product OS : Connector to your Cargo.toml:

[dependencies]
product-os-connector = { version = "0.0.26", features = ["connectors", "openapi"] }

Quick Start

use product_os_connector::Definition;

// Load a connector definition from JSON
let definition_json = r#"{
    "name": "my-api",
    "version": "1.0.0",
    "base_url": "https://api.example.com",
    "endpoints": [
        {
            "name": "get_users",
            "method": "GET",
            "path": "/users"
        }
    ]
}"#;

let definition: Definition = serde_json::from_str(definition_json).unwrap();

Feature Flags

  • default: Standard library support with all Product OS dependencies
  • connectors: Enable connector functionality with HTTP endpoints
  • definition: Enable definition parsing (JSON, matchit routing)
  • openapi: Enable OpenAPI/Swagger specification support

Workflow Definition

Define workflows that chain multiple API operations:

{
  "name": "user-sync-workflow",
  "steps": [
    {
      "name": "fetch-users",
      "connector": "source-api",
      "endpoint": "get_users",
      "output": "users"
    },
    {
      "name": "transform",
      "type": "map",
      "input": "users",
      "transform": {
        "id": "$.id",
        "email": "$.email"
      },
      "output": "transformed_users"
    },
    {
      "name": "sync-users",
      "connector": "dest-api",
      "endpoint": "create_users",
      "input": "transformed_users"
    }
  ]
}

OpenAPI Integration

Import existing OpenAPI specifications:

use product_os_connector::Definition;

// Load from OpenAPI specification
// Requires "openapi" feature
let openapi_spec = std::fs::read_to_string("openapi.yaml")?;
// Parse and convert to connector definition

Authentication

The connector supports various authentication methods:

  • JWT token verification
  • API key authentication
  • OAuth2 token handling
  • Custom header-based auth

Testing

# Run all tests
cargo test --all-features

# Run with specific features
cargo test --features "connectors"

# Generate documentation
cargo doc --all-features --open

License

GNU GPLv3

Contributing

Contributions are welcome! Please ensure:

  • All tests pass: cargo test --all-features
  • Code is formatted: cargo fmt
  • No clippy warnings: cargo clippy --all-features
  • Documentation is updated for public APIs

Minimum Supported Rust Version (MSRV)

Rust 1.69 or later.

Dependencies

~18–24MB
~351K SLoC