mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-04-27 14:29:40 +00:00
Update tonic-web to v0.5.0.
This commit is contained in:
parent
a2a0d59982
commit
10371e66a2
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -4121,9 +4121,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tonic-web"
|
name = "tonic-web"
|
||||||
version = "0.4.0"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e392f7556972523aa87ddb0fc7f2d2ce530559956706aa081bb0bd8fed158559"
|
checksum = "9213351ad53b0dcf1c9cf7c372a47533446b1114928a9177bedc6c551e14b7cf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"bytes",
|
"bytes",
|
||||||
@ -4133,6 +4133,8 @@ dependencies = [
|
|||||||
"hyper",
|
"hyper",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"tonic",
|
"tonic",
|
||||||
|
"tower-http",
|
||||||
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
@ -58,7 +58,7 @@ rdkafka = { version = "0.28", features = ["cmake-build"]}
|
|||||||
|
|
||||||
# gRPC and Protobuf
|
# gRPC and Protobuf
|
||||||
tonic = "0.8"
|
tonic = "0.8"
|
||||||
tonic-web = "0.4"
|
tonic-web = "0.5"
|
||||||
tonic-reflection = "0.5"
|
tonic-reflection = "0.5"
|
||||||
tokio = { version = "1.23", features = ["macros", "rt-multi-thread"] }
|
tokio = { version = "1.23", features = ["macros", "rt-multi-thread"] }
|
||||||
tokio-stream = "0.1"
|
tokio-stream = "0.1"
|
||||||
|
@ -19,6 +19,7 @@ use tokio::{task, try_join};
|
|||||||
use tonic::transport::Server as TonicServer;
|
use tonic::transport::Server as TonicServer;
|
||||||
use tonic::Code;
|
use tonic::Code;
|
||||||
use tonic_reflection::server::Builder as TonicReflectionBuilder;
|
use tonic_reflection::server::Builder as TonicReflectionBuilder;
|
||||||
|
use tonic_web::GrpcWebLayer;
|
||||||
use tower::{Service, ServiceBuilder};
|
use tower::{Service, ServiceBuilder};
|
||||||
use tower_http::trace::TraceLayer;
|
use tower_http::trace::TraceLayer;
|
||||||
use tracing::{error, info};
|
use tracing::{error, info};
|
||||||
@ -102,60 +103,53 @@ pub async fn setup() -> Result<()> {
|
|||||||
// tonic gRPC service
|
// tonic gRPC service
|
||||||
let tonic_service = TonicServer::builder()
|
let tonic_service = TonicServer::builder()
|
||||||
.accept_http1(true)
|
.accept_http1(true)
|
||||||
|
.layer(GrpcWebLayer::new())
|
||||||
.add_service(
|
.add_service(
|
||||||
TonicReflectionBuilder::configure()
|
TonicReflectionBuilder::configure()
|
||||||
.register_encoded_file_descriptor_set(chirpstack_api::api::DESCRIPTOR)
|
.register_encoded_file_descriptor_set(chirpstack_api::api::DESCRIPTOR)
|
||||||
.build()
|
.build()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
)
|
)
|
||||||
.add_service(tonic_web::enable(InternalServiceServer::with_interceptor(
|
.add_service(InternalServiceServer::with_interceptor(
|
||||||
internal::Internal::new(
|
internal::Internal::new(
|
||||||
validator::RequestValidator::new(),
|
validator::RequestValidator::new(),
|
||||||
conf.api.secret.clone(),
|
conf.api.secret.clone(),
|
||||||
),
|
),
|
||||||
auth::auth_interceptor,
|
auth::auth_interceptor,
|
||||||
)))
|
))
|
||||||
.add_service(tonic_web::enable(
|
.add_service(ApplicationServiceServer::with_interceptor(
|
||||||
ApplicationServiceServer::with_interceptor(
|
|
||||||
application::Application::new(validator::RequestValidator::new()),
|
application::Application::new(validator::RequestValidator::new()),
|
||||||
auth::auth_interceptor,
|
auth::auth_interceptor,
|
||||||
),
|
|
||||||
))
|
))
|
||||||
.add_service(tonic_web::enable(
|
.add_service(DeviceProfileServiceServer::with_interceptor(
|
||||||
DeviceProfileServiceServer::with_interceptor(
|
|
||||||
device_profile::DeviceProfile::new(validator::RequestValidator::new()),
|
device_profile::DeviceProfile::new(validator::RequestValidator::new()),
|
||||||
auth::auth_interceptor,
|
auth::auth_interceptor,
|
||||||
),
|
|
||||||
))
|
))
|
||||||
.add_service(tonic_web::enable(
|
.add_service(DeviceProfileTemplateServiceServer::with_interceptor(
|
||||||
DeviceProfileTemplateServiceServer::with_interceptor(
|
|
||||||
device_profile_template::DeviceProfileTemplate::new(
|
device_profile_template::DeviceProfileTemplate::new(
|
||||||
validator::RequestValidator::new(),
|
validator::RequestValidator::new(),
|
||||||
),
|
),
|
||||||
auth::auth_interceptor,
|
auth::auth_interceptor,
|
||||||
),
|
|
||||||
))
|
))
|
||||||
.add_service(tonic_web::enable(TenantServiceServer::with_interceptor(
|
.add_service(TenantServiceServer::with_interceptor(
|
||||||
tenant::Tenant::new(validator::RequestValidator::new()),
|
tenant::Tenant::new(validator::RequestValidator::new()),
|
||||||
auth::auth_interceptor,
|
auth::auth_interceptor,
|
||||||
)))
|
))
|
||||||
.add_service(tonic_web::enable(DeviceServiceServer::with_interceptor(
|
.add_service(DeviceServiceServer::with_interceptor(
|
||||||
device::Device::new(validator::RequestValidator::new()),
|
device::Device::new(validator::RequestValidator::new()),
|
||||||
auth::auth_interceptor,
|
auth::auth_interceptor,
|
||||||
)))
|
))
|
||||||
.add_service(tonic_web::enable(UserServiceServer::with_interceptor(
|
.add_service(UserServiceServer::with_interceptor(
|
||||||
user::User::new(validator::RequestValidator::new()),
|
user::User::new(validator::RequestValidator::new()),
|
||||||
auth::auth_interceptor,
|
auth::auth_interceptor,
|
||||||
)))
|
))
|
||||||
.add_service(tonic_web::enable(GatewayServiceServer::with_interceptor(
|
.add_service(GatewayServiceServer::with_interceptor(
|
||||||
gateway::Gateway::new(validator::RequestValidator::new()),
|
gateway::Gateway::new(validator::RequestValidator::new()),
|
||||||
auth::auth_interceptor,
|
auth::auth_interceptor,
|
||||||
)))
|
))
|
||||||
.add_service(tonic_web::enable(
|
.add_service(MulticastGroupServiceServer::with_interceptor(
|
||||||
MulticastGroupServiceServer::with_interceptor(
|
|
||||||
multicast::MulticastGroup::new(validator::RequestValidator::new()),
|
multicast::MulticastGroup::new(validator::RequestValidator::new()),
|
||||||
auth::auth_interceptor,
|
auth::auth_interceptor,
|
||||||
),
|
|
||||||
))
|
))
|
||||||
.into_service();
|
.into_service();
|
||||||
let mut tonic_service = ServiceBuilder::new()
|
let mut tonic_service = ServiceBuilder::new()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user