Gain instant monitoring and protection into GraphQL APIs. Unblock platform teams and accelerate GraphQL adoption. Inigo's platform integration offers GraphQL Security, Analytics, Rate-limiting, Access Control and more.
This package is the Inigo plugin for the Apollo Rust Router
- Import the Inigo library in your Cargo.toml
cargo add inigo-rs
- a. Setup Inigo plugin (without registry)
use apollo_router::register_plugin;
use inigo_rs::Middleware;
register_plugin!("inigo", "middleware", Middleware);
fn main() {
match apollo_router::main() {
Ok(_) => {}
Err(e) => {
eprintln!("{}", e);
std::process::exit(1);
}
}
}
- b. Setup Inigo plugin (with registry)
use apollo_router::register_plugin;
use inigo_rs::registry::InigoRegistry;
use inigo_rs::Middleware;
register_plugin!("inigo", "middleware", Middleware);
fn main() {
match InigoRegistry::new(None).and(apollo_router::main()) {
Ok(_) => {}
Err(e) => {
eprintln!("{}", e);
std::process::exit(1);
}
}
}
- Configure the plugin
plugins:
inigo.middleware:
token: "your-inigo-service-token"
Tip: It can also be an environment variable
plugins:
inigo.middleware:
token: "${env.INIGO_SERVICE_TOKEN}"
- a. Automatic FFI library loading Inigo Rust Router will automatically download the Inigo library from the Inigo service. Only if configured.
plugins:
inigo.middleware:
token: "${env.INIGO_SERVICE_TOKEN}"
auto_download_library: true
- b Manual FFI library loading Place a copy of Inigo lib file in the docker and set this env variable. For example:
INIGO_LIB_PATH=/inigo-linux-amd64.so # Change depending on path/file name (platform and architecture)
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Distributed under the MIT License.