fix(gateway): make sgl-model-gateway a cargo workspace so maturin 1.14 accepts the parent README (#27997)
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
[workspace]
|
||||||
|
members = ["bindings/python"]
|
||||||
|
exclude = ["bindings/golang", "examples"]
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "sgl-model-gateway"
|
name = "sgl-model-gateway"
|
||||||
version = "0.3.2"
|
version = "0.3.2"
|
||||||
|
|||||||
@@ -19,10 +19,3 @@ default-features = true
|
|||||||
[features]
|
[features]
|
||||||
default = ["pyo3/extension-module"]
|
default = ["pyo3/extension-module"]
|
||||||
vendored-openssl = ["sgl-model-gateway/vendored-openssl"]
|
vendored-openssl = ["sgl-model-gateway/vendored-openssl"]
|
||||||
|
|
||||||
[profile.ci]
|
|
||||||
inherits = "release"
|
|
||||||
opt-level = 2 # Lighter optimization (still fast runtime, much faster compile)
|
|
||||||
lto = "thin" # Thin LTO - good balance
|
|
||||||
codegen-units = 16 # More parallelization for faster builds
|
|
||||||
strip = true
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
use once_cell::sync::OnceCell;
|
||||||
use pyo3::prelude::*;
|
use pyo3::prelude::*;
|
||||||
use smg::*;
|
use smg::*;
|
||||||
use once_cell::sync::OnceCell;
|
|
||||||
use std::collections::HashMap;
|
|
||||||
|
|
||||||
// Define the enums with PyO3 bindings
|
// Define the enums with PyO3 bindings
|
||||||
#[pyclass(eq)]
|
#[pyclass(eq)]
|
||||||
@@ -69,7 +70,12 @@ impl PyApiKeyEntry {
|
|||||||
#[new]
|
#[new]
|
||||||
#[pyo3(signature = (id, name, key, role = PyRole::User))]
|
#[pyo3(signature = (id, name, key, role = PyRole::User))]
|
||||||
fn new(id: String, name: String, key: String, role: PyRole) -> Self {
|
fn new(id: String, name: String, key: String, role: PyRole) -> Self {
|
||||||
PyApiKeyEntry { id, name, key, role }
|
PyApiKeyEntry {
|
||||||
|
id,
|
||||||
|
name,
|
||||||
|
key,
|
||||||
|
role,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,11 +172,7 @@ impl PyControlPlaneAuthConfig {
|
|||||||
api_keys = vec![],
|
api_keys = vec![],
|
||||||
audit_enabled = true,
|
audit_enabled = true,
|
||||||
))]
|
))]
|
||||||
fn new(
|
fn new(jwt: Option<PyJwtConfig>, api_keys: Vec<PyApiKeyEntry>, audit_enabled: bool) -> Self {
|
||||||
jwt: Option<PyJwtConfig>,
|
|
||||||
api_keys: Vec<PyApiKeyEntry>,
|
|
||||||
audit_enabled: bool,
|
|
||||||
) -> Self {
|
|
||||||
PyControlPlaneAuthConfig {
|
PyControlPlaneAuthConfig {
|
||||||
jwt,
|
jwt,
|
||||||
api_keys,
|
api_keys,
|
||||||
@@ -183,7 +185,11 @@ impl PyControlPlaneAuthConfig {
|
|||||||
pub fn to_auth_control_plane_config(&self) -> auth::ControlPlaneAuthConfig {
|
pub fn to_auth_control_plane_config(&self) -> auth::ControlPlaneAuthConfig {
|
||||||
auth::ControlPlaneAuthConfig {
|
auth::ControlPlaneAuthConfig {
|
||||||
jwt: self.jwt.as_ref().map(|j| j.to_auth_jwt_config()),
|
jwt: self.jwt.as_ref().map(|j| j.to_auth_jwt_config()),
|
||||||
api_keys: self.api_keys.iter().map(|k| k.to_auth_api_key_entry()).collect(),
|
api_keys: self
|
||||||
|
.api_keys
|
||||||
|
.iter()
|
||||||
|
.map(|k| k.to_auth_api_key_entry())
|
||||||
|
.collect(),
|
||||||
audit_enabled: self.audit_enabled,
|
audit_enabled: self.audit_enabled,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -576,9 +582,7 @@ impl Router {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let redis_config = if matches!(self.history_backend, HistoryBackendType::Redis) {
|
let redis_config = if matches!(self.history_backend, HistoryBackendType::Redis) {
|
||||||
self.redis_config
|
self.redis_config.as_ref().map(|cfg| cfg.to_config_redis())
|
||||||
.as_ref()
|
|
||||||
.map(|cfg| cfg.to_config_redis())
|
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user