mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-23 05:02:17 +00:00
feat: Add comprehensive API client modules and JWT authentication to Rust SDK
- Add hmac, sha2, and base64 dependencies to Cargo.toml for JWT support - Add README.md with installation instructions, architecture overview, and API examples for all SDK modules - Add AuthProvider class with API key and JWT token support (generate_jwt_token, validate_jwt_token, get_headers, clear_token_cache methods) - Add HTTPClient base class with retry logic, error handling, and timeout management - Add SubscriberAPI module
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
use reqwest::StatusCode;
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum TelecomError {
|
||||
#[error("Authentication failed")]
|
||||
AuthenticationError,
|
||||
#[error("API error: {0}")]
|
||||
APIError(String),
|
||||
#[error("Network error: {0}")]
|
||||
NetworkError(#[from] reqwest::Error),
|
||||
#[error("Validation error: {0}")]
|
||||
ValidationError(String),
|
||||
#[error("Rate limit exceeded")]
|
||||
RateLimitError,
|
||||
#[error("Server error: {0}")]
|
||||
ServerError(StatusCode),
|
||||
#[error("WebSocket error: {0}")]
|
||||
WebSocketError(String),
|
||||
#[error("JSON error: {0}")]
|
||||
JsonError(#[from] serde_json::Error),
|
||||
}
|
||||
Reference in New Issue
Block a user