hyperlane-plugin-cors 23.3.2

A zero-allocation precompiled CORS plugin for the Hyperlane framework with exact/suffix/predicate origin matching, safe credential reflection, RFC preflight handling, and Vary header merging.
Documentation

hyperlane-plugin-cors

Zero-Allocation Precompiled RFC-Compliant CORS Middleware Plugin

Crates.io Version Docs.rs CI Status Rust 2024 License: MIT

Workspace Overview · Plugin Catalog · API Docs


Overview

hyperlane-plugin-cors adds zero-allocation Cross-Origin Resource Sharing (CORS) policy enforcement and preflight handling to hyperlane services (hook order -100 / -80). It is opt-in and transparent (Status::Continue) when unconfigured.

Installation

cargo add hyperlane-plugin-cors

Usage

use hyperlane_plugin_cors::{CorsConfig, CorsPlugin};

fn setup_cors() {
    CorsPlugin::init(CorsConfig::default());
}

Verification

cargo run -p hyperlane-cli -- fmt --check
cargo clippy -p hyperlane-plugin-cors --all-features --all-targets -- -D warnings
cargo test -p hyperlane-plugin-cors --all-features

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For inquiries, please contact the author at root@devhub.vip.