pub struct RouteConfig {
pub prefix: String,
pub upstream: String,
pub credential_key: Option<String>,
pub inject_mode: InjectMode,
pub inject_header: String,
pub credential_format: String,
pub path_pattern: Option<String>,
pub path_replacement: Option<String>,
pub query_param_name: Option<String>,
pub env_var: Option<String>,
}Expand description
Configuration for a reverse proxy credential route.
Fields§
§prefix: StringPath prefix for routing (e.g., “/openai”)
upstream: StringUpstream URL to forward to (e.g., “https://api.openai.com”)
credential_key: Option<String>Keystore account name to load the credential from.
If None, no credential is injected.
inject_mode: InjectModeInjection mode (default: “header”)
inject_header: StringHTTP header name for the credential (default: “Authorization”) Only used when inject_mode is “header”.
credential_format: StringFormat string for the credential value. {} is replaced with the secret.
Default: “Bearer {}”
Only used when inject_mode is “header”.
path_pattern: Option<String>Pattern to match in incoming URL path. Use {} as placeholder for phantom token.
Example: “/bot{}/” matches “/bot
path_replacement: Option<String>Pattern for outgoing URL path. Use {} as placeholder for real credential. Defaults to same as path_pattern if not specified. Only used when inject_mode is “url_path”.
query_param_name: Option<String>Name of the query parameter to add/replace with the credential. Only used when inject_mode is “query_param”.
env_var: Option<String>Explicit environment variable name for the phantom token (e.g., “OPENAI_API_KEY”).
When set, this is used as the SDK API key env var name instead of deriving
it from credential_key.to_uppercase(). Required when credential_key is
an op:// URI (which would produce a nonsensical env var name).
Trait Implementations§
Source§impl Clone for RouteConfig
impl Clone for RouteConfig
Source§fn clone(&self) -> RouteConfig
fn clone(&self) -> RouteConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more