| Crates.io | grpc_gateway |
| lib.rs | grpc_gateway |
| version | 0.1.6 |
| created_at | 2025-08-30 07:15:47.906077+00 |
| updated_at | 2025-09-27 09:09:33.094586+00 |
| description | A GRPC Gateway which handle the http request and convert into GRPC |
| homepage | https://github.com/aniket0951/rust_grpc_gateway |
| repository | https://github.com/aniket0951/rust_grpc_gateway |
| max_upload_size | |
| id | 1817323 |
| size | 148,124 |
A lightweight SDK that allows you to expose your gRPC services over HTTP/JSON.
This SDK accepts HTTP requests, invokes the corresponding gRPC service methods, and returns JSON responses generated from protobuf messages.
👉 No .proto files are required to use your gRPC services with this SDK.
This release introduces JWT Token Authentication with automatic refresh capabilities alongside existing API Key authentication.
👉 See full details in the Authentication System README.
API_KEY - Simple static authenticationJWT_TOKEN - Dynamic authentication with auto-refreshThe Gateway now supports two authentication methods for secure service communication.
When a service registers itself, it can specify the authentication type and provide the required configuration.
let result = gateway.service_registry.register(ServiceRegisterRequest {
service_name: String::from("users.UserService"),
host: String::from("127.0.0.1"),
port: String::from("50051"),
health_check_endpoint: String::from("/health"),
oauth_config: InternalAuthConfig {
auth_type: AuthType::ApiKey,
auth_refresh_config: None,
},
});
let result = gateway.service_registry.register(ServiceRegisterRequest {
service_name: String::from("payment.PaymentService"),
host: String::from("127.0.0.1"),
port: String::from("50052"),
health_check_endpoint: String::from("/health"),
oauth_config: InternalAuthConfig {
auth_type: AuthType::JwtToken,
auth_refresh_config: Some(AuthRefreshConfig {
service_name: String::from("auth-service"),
method: String::from("RefreshAuth"),
header_name: String::from("Authorization"),
access_token: String::from("initial_jwt_token"),
expired_at: 1641024000, // Unix timestamp
refresh_token: String::from("refresh_jwt_token"),
}),
},
});
The new JWT authentication system features automatic token refresh:
All services using JWT authentication must implement this exact protobuf service:
syntax = "proto3";
package refresh;
message RefreshAuthTokenRequest {
string refresh_token = 1;
}
message RefreshAuthTokenResponse {
string access_token = 1;
string refresh_token = 2;
uint64 expired_at = 3;
}
service RefreshAuthService {
rpc RefreshAuth (RefreshAuthTokenRequest) returns (RefreshAuthTokenResponse);
}
For Simple Services (API Key):
AuthType::ApiKeyFor Production Services (JWT Token):
AuthType::JwtTokenServices must register before starting to enable Gateway communication.
Once registered, the Gateway will:
Version: v0.1.6
Compatibility: Supports both API Key and JWT Token authentication
Migration: Seamless upgrade path from API Key to JWT authentication