Skip to content

Commit

Permalink
chore:update spacegate version(#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
RWDai authored Apr 9, 2024
1 parent feaf831 commit 8330638
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ tardis = { version = "0.1.0-rc.11" }
spacegate-shell = { git = "https://github.com/ideal-world/spacegate.git", branch = "master", features = [
"cache",
"k8s",
# "ext-redis",
# "ext-redis",
] }

spacegate-plugin = { git = "https://github.com/ideal-world/spacegate.git", branch = "master" }
2 changes: 1 addition & 1 deletion backend/gateways/spacegate-plugins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ schema = ["spacegate-plugin/schema"]
[dependencies]
serde.workspace = true
lazy_static.workspace = true
spacegate-shell.workspace = true
spacegate-shell = { workspace = true, features = ["cache", "k8s", "ext-redis"] }
spacegate-plugin = { workspace = true, features = ["schema"], optional = true }

bios-sdk-invoke = { path = "../../../frontend/sdks/invoke", features = [
Expand Down
2 changes: 1 addition & 1 deletion backend/gateways/spacegate-plugins/src/plugin/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
use spacegate_shell::{
hyper::{
self, header,
http::{self, HeaderMap, HeaderName, HeaderValue, StatusCode},
http::{HeaderMap, HeaderName, HeaderValue, StatusCode},
Method, Request, Response,
},
kernel::{extension::Reflect, helper_layers::function::Inner},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ use http::Response;
use jsonpath_rust::JsonPathInst;
use serde::{Deserialize, Serialize};
use spacegate_shell::{
kernel::{
extension::{EnterTime, GatewayName},
SgRequest, SgResponse,
},
kernel::{extension::EnterTime, SgRequest, SgResponse},
plugin::{Inner, Plugin, PluginConfig},
spacegate_ext_redis::global_repo,
BoxError,
BoxError, SgRequestExt as _,
};
use tardis::{
cache::Script,
Expand Down Expand Up @@ -70,10 +66,7 @@ impl Plugin for RedisPublisherPlugin {
}

async fn call(&self, req: SgRequest, inner: Inner) -> Result<http::Response<spacegate_shell::SgBody>, spacegate_shell::BoxError> {
let Some(gateway_name) = req.extensions().get::<GatewayName>() else {
return Err("missing gateways name".into());
};
let Some(client) = global_repo().get(gateway_name) else {
let Some(client) = req.get_redis_client_by_gateway_name() else {
return Err("missing redis client".into());
};
let spec_id = RedisPublisherPlugin::parse_spec_id(&req);
Expand Down

0 comments on commit 8330638

Please sign in to comment.