Commit Graph
308 Commits
Author SHA1 Message Date
nutcas3 ea20dfb302 docs: Add Ruby SDK README with comprehensive API documentation and implement modular architecture with HTTParty integration
- Add README.md with installation instructions, architecture overview, and API examples for all SDK modules
- Refactor TelecomSDK::Client to use modular API clients (SubscriberAPI, UsageAPI, PaymentAPI, RatingPlanAPI, SystemAPI, GraphQLAPI)
- Add AuthProvider class with API key and JWT token support (generate_jwt_token, validate_jwt_token methods)
- Add HTTPClient base class with retry
2026-04-25 04:57:00 +03:00
nutcas3 d846c304a4 docs: Add Go SDK README with comprehensive API documentation and implement modular architecture with authentication provider
- 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 (GenerateJWTToken, ValidateJWTToken, GetHeaders, ClearTokenCache methods)
- Add HTTPClient base class with retry logic, error handling, and timeout management
- Add GraphQLAPI, PaymentsAPI, RatingPlansAPI
2026-04-25 04:56:33 +03:00
nutcas3 cfdbe92477 docs: Add Elixir SDK README with comprehensive API documentation and implement modular architecture with GenServer support
- Add README.md with installation instructions, architecture overview, and API examples for all SDK modules
- Refactor TelecomSDK main module to use modular API clients (SubscribersAPI, UsageAPI, PaymentAPI, RatingPlanAPI, SystemAPI, GraphQLAPI)
- Add AuthProvider class with API key and JWT token support (generate_jwt_token, validate_jwt_token methods)
- Add HTTPClient base
2026-04-25 04:55:06 +03:00
nutcas3 808afbc2be 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
2026-04-25 04:54:13 +03:00
nutcas3 f6590462f5 docs: Add Swift SDK README with comprehensive API documentation and implement authentication provider with 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 (generateJWTToken, validateJWTToken, getHeaders, clearTokenCache methods)
- Add HTTPClient base class with retry logic, error handling, and timeout management
- Add GraphQLAPI, PaymentAPI, RatingPlanAPI, SubscriberAPI, SystemAPI, and UsageAPI modules
- Add TelecomSDK main client integrating all API
2026-04-25 04:53:22 +03:00
nutcas3 511f7be357 docs: Add Kotlin SDK README with comprehensive API documentation and implement authentication provider with 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 (generateJWTToken, validateJWTToken, getHeaders, clearTokenCache methods)
- Add HTTPClient base class with retry logic, error handling, and timeout management
- Add GraphQLAPI, PaymentAPI, RatingPlanAPI, SubscriberAPI, System
2026-04-25 04:52:19 +03:00
nutcas3 8c4f4e17da docs: Update TypeScript SDK README with new API structure and improve authentication implementation
- Update README to reflect new modular API structure (subscribers, usage, payments, ratingPlans, system, graphql modules)
- Add Architecture section documenting SDK module organization
- Update all code examples to use new API module paths (sdk.subscribers instead of sdk.subscribersService)
- Remove deprecated methods (getSubscriberByImsi, terminateSubscriber, eSIM management, billing/invoices)
- Add GraphQL query execution examples
- Simplify usage examples to focus
2026-04-25 04:51:06 +03:00
nutcas3 fbc6acae11 feat: Add comprehensive API client modules and JWT authentication to TypeScript SDK
- Add AuthProvider class with API key and JWT token support (create_token, validate_token, refresh_token, get_headers methods)
- Add HTTPClient base class with retry logic, error handling, and timeout management
- Add SubscriberAPI module (get, list, create, update, suspend, activate, terminate methods)
- Add UsageAPI module (get_stats, list_events, get_realtime methods)
- Add PaymentAPI module (create_transaction
2026-04-25 04:03:08 +03:00
nutcas3 758bd5f075 feat: Add comprehensive API client modules and JWT authentication to Python SDK
- Add pyjwt>=2.10.0 dependency to requirements.txt
- Add AuthProvider class with API key and JWT token support (create_token, validate_token, refresh_token, get_headers methods)
- Add APIClient base class with retry logic, error handling, and async session management
- Add SubscriberAPI module (get, list, create, update, suspend, activate, terminate methods)
- Add UsageAPI module (get_stats, list_events, get_realtime methods
2026-04-25 03:56:56 +03:00
nutcas3 3b0f148265 chore: Update SDK dependencies across all language implementations
- Elixir: Update Elixir to 1.17, finch to 0.19, ex_doc to 0.37
- Kotlin: Update Kotlin to 2.1.0, kotlinx-coroutines to 1.10.1, kotlinx-serialization to 1.8.0, Ktor to 3.0.3
- Python: Update aiohttp to 3.10.0, websockets to 14.0.0, pydantic to 2.10.0, typing-extensions to 4.12.0
- Ruby: Update httparty to 0.23, websocket-client-simple to 0.4, json to 2.7, minitest to 5.25, rubocop to 1.72
- Rust: Update reqwest to 0.12, tokio-tungstenite
2026-04-25 03:53:19 +03:00
nutcas3 f90882b4b2 refactor: Extract health checks and utility modules from packet-gateway ebpf module
- Extract health check handlers to new health.rs module (health, liveness, readiness, metrics endpoints)
- Extract IP conversion utilities to new ip_utils.rs module (u32_to_ipv4_string, ipv4_string_to_u32)
- Extract Redis synchronization logic to new redis_sync.rs module (RedisSyncer with sync_packet_stats, sync_credit_info, sync_credits_from_redis, sync_blocked_from_redis, sync_batch_entry methods)
- Refactor EbpfManager
2026-04-25 03:51:23 +03:00
nutcas3 5467e22d22 feat: Add metrics endpoint to packet-gateway health check server
- Add MetricsResponse struct with status, service, timestamp, tracked_ips, total_bytes_processed, and low_credit_users fields
- Add metrics_handler function calculating tracked IPs count, total bytes processed sum, and low credit users count from EbpfManager stats
- Add GET /metrics route to health check server
- Add ebpf_manager_clone state to health check server for metrics access
2026-04-25 03:46:05 +03:00
nutcas3 d7e83c1f0d feat: Add API key authentication support to charging engine client
- Add APIKey field to ChargingEngineConfig struct
- Add apiKey field to ChargingEngineClient struct
- Add setAPIKeyHeader method to set X-API-Key header when API key is configured
- Call setAPIKeyHeader in CheckCredit, DeductCredit, AddCredit, GetBalance, and HealthCheck methods
2026-04-25 03:43:32 +03:00
nutcas3 7428ed2314 feat: Add API key authentication support to charging-engine auth middleware
- Add api_keys field to AuthConfig struct
- Parse API_KEYS environment variable as comma-separated list in from_env
- Add validate_api_key method to AuthConfig for key verification
- Add X-API-Key header check in auth_middleware before JWT validation
- Update comments to clarify development/testing mode for unauthenticated requests
2026-04-25 03:42:42 +03:00
nutcas3 919e9906e8 feat: Update Apollo Client configuration to use explicit constructors and fix context link implementation
- Replace createHttpLink with HttpLink constructor
- Replace setContext with SetContextLink constructor
- Update authLink to use prevContext parameter and spread operator for proper context merging
- Replace from with ApolloLink.from for link composition
- Remove ApolloProvider wrapper from Providers component (render children directly)
2026-04-25 03:40:28 +03:00
nutcas3 3cef1fbf03 feat: Add authentication middleware to charging-engine with public and protected route separation
- Add auth module import to main.rs
- Add AuthConfig initialization from environment in main function
- Add auth_config field to AppState struct
- Add auth_middleware layer to protected routes
- Move health check, credit check, deduct, balance, and usage recording to public routes (no auth required for packet-gateway integration)
- Move add credit, subscriber management, rating plans, monitoring, and engine
2026-04-25 03:38:14 +03:00
nutcas3 a41431c17a feat: Add jsonwebtoken dependency to charging-engine for JWT authentication support
- Add jsonwebtoken 10.3.0 dependency to Cargo.toml
2026-04-25 03:37:59 +03:00
nutcas3 c341f4462e feat: Add JWT authentication middleware and token management for charging engine
- Add Claims struct with sub and exp fields for JWT payload
- Add AuthConfig struct with secret field loaded from JWT_SECRET environment variable
- Add create_token function generating 24-hour expiration tokens
- Add validate_token function for JWT verification
- Add auth_middleware for Axum with Authorization header Bearer token validation
- Allow unauthenticated requests temporarily for packet-gateway integration
2026-04-25 03:36:52 +03:00
nutcas3 a8c6f9393f feat: Add Apollo Client integration to web-dashboard with GraphQL support
- Add @apollo/client ^4.1.9 and graphql ^16.10.0 dependencies to package.json
- Add apollo-client.ts with ApolloClient configuration, HTTP link to API server, and auth link for token-based authentication
- Add Providers component wrapping children with ApolloProvider
- Wrap Sidebar and main content with Providers in root layout
- Configure cache-and-network and network-only fetch policies for queries and mutations
2026-04-25 03:36:26 +03:00
nutcas3 201ecdf62f feat: Add auth module export to charging-engine library
- Add public auth module export to lib.rs
2026-04-25 03:33:56 +03:00
nutcas3 552d9d5e1f feat: Move charging routes to public v1 group and add health check endpoint
- Move charging routes from protected /api group to public /v1/charging group for packet-gateway integration
- Add GET /v1/health endpoint returning status ok
- Remove registerChargingRoutes function (routes now inline in registerV1Routes)
- Remove registerChargingRoutes call from apiProtected group
2026-04-25 03:33:08 +03:00
nutcas3 7aa582ee3d feat: Add charging routes and handler integration to API server
- Add chargingH field to serverDeps struct
- Add ChargingEngineClient initialization in buildDeps
- Add NewChargingHandler with chargingEngineClient dependency
- Add registerChargingRoutes function with /charging group
- Add POST /charging/credit/:ip/check endpoint
- Add GET /charging/credit/:ip/balance endpoint
- Add POST /charging/credit/:ip/add endpoint
- Add POST /charging/credit/:ip/deduct endpoint
- Call registerChargingRoutes in
2026-04-25 03:32:05 +03:00
nutcas3 6d0c0ced1b feat: Add charging handler with credit management endpoints for IP-based operations
- Add ChargingHandler struct with ChargingEngineClient dependency
- Add NewChargingHandler constructor
- Add CheckCredit endpoint to validate sufficient credit for requested bytes
- Add GetBalance endpoint to retrieve current balance for an IP
- Add AddCredit endpoint to add bytes to an IP's credit
- Add DeductCredit endpoint to deduct bytes from an IP's credit
- Add IP parameter validation and JSON request binding
2026-04-25 03:28:51 +03:00
nutcas3 fff289f957 feat: Add Prometheus metrics endpoint to carrier-connector
- Add prometheus/client_golang v1.20.5 dependency to go.mod
- Add /api/v1/metrics endpoint using promhttp.Handler() wrapped with gin.WrapH
2026-04-25 03:28:26 +03:00
nutcas3 121cb60a62 feat: Add HTTP health check endpoints with Redis and eBPF status validation for packet-gateway
- Add axum, serde, serde_json, and chrono dependencies to Cargo.toml
- Add health_port CLI argument (defaults to 8081)
- Add /health endpoint returning basic health status
- Add /health/live endpoint for liveness checks (always returns alive if service is running)
- Add /health/ready endpoint for readiness checks with Redis connectivity and eBPF attachment validation
- Add AtomicBool to track eBPF attachment status across
2026-04-25 03:25:01 +03:00
nutcas3 8e40a54d8b feat: Add liveness and readiness health check endpoints with database connectivity validation
- Add Ping method to PostgresProfileStore to check database connection status
- Add Ping method to ProfileRepository interface
- Add /api/v1/health/live endpoint for liveness checks (always returns alive if service is running)
- Add /api/v1/health/ready endpoint for readiness checks with database connectivity validation
- Add readinessHandler that returns SERVICE_UNAVAILABLE status when database ping fails
2026-04-25 03:23:01 +03:00
nutcas3 05eb31e117 feat: Add comprehensive unit tests for charging engine components
- Add credit_management_tests.rs with tests for SubscriberAccount, UsageEvent, UsageType, AccountStatus, and integer arithmetic operations
- Add error_tests.rs with tests for ChargingError Display implementation, cloning, and log_error function
- Add rating_billing_tests.rs with tests for ChargingRule variants, as_str conversion, billing period parsing, timestamp filtering, and cost calculations
- Add validation_tests.rs with tests for validate_bytes, validate
2026-04-25 03:17:21 +03:00
nutcas3 4cdecfc932 feat: Add library module exports for charging engine components
- Add public module exports for charging, errors, handlers, routes, models, and monitoring
2026-04-25 03:17:04 +03:00
nutcas3 379dc251d3 feat: Add library configuration and test dependencies to charging-engine
- Add [lib] section with charging_engine name and src/lib.rs path
- Add dev-dependencies: tokio-test 0.4, mockall 0.13, serial_test 3.2
2026-04-25 03:16:53 +03:00
nutcas3 2dd6c3304d feat: Add configurable expiration times for credit and block operations via environment variables
- Add CREDIT_EXPIRATION_SECONDS environment variable to configure credit key expiration (defaults to 86400)
- Add BLOCK_EXPIRATION_SECONDS environment variable to configure block key expiration (defaults to 86400)
- Replace hardcoded 86400 expiration values with configurable variables in add_credit and block_user
- Update block_user warning message to include expiration duration
2026-04-25 03:06:37 +03:00
nutcas3 ff33263df3 feat: Add configurable limits for bytes and amount validation via environment variables
- Add MAX_BYTES_LIMIT environment variable to configure bytes validation limit (defaults to 1TB)
- Add MAX_AMOUNT_LIMIT environment variable to configure amount validation limit (defaults to 10,000)
- Replace hardcoded 1_000_000_000_000 bytes limit with configurable max_bytes value
- Replace hardcoded 10_000.0 amount limit with configurable max_amount value
2026-04-25 03:05:40 +03:00
nutcas3 c4746970a2 feat: Add DatabaseError variant and improve error response handling
- Add DatabaseError(String) variant to ChargingError enum
- Add DatabaseError case to log_error helper with error-level logging
- Add DatabaseError Display implementation
- Refactor IntoResponse to use generic error messages instead of detailed strings
- Add detail field to error responses containing full error message via to_string()
- Change RedisConnection status code from INTERNAL_SERVER_ERROR to SERVICE_UNAVAILABLE
2026-04-25 03:04:25 +03:00
nutcas3 c9c493fd70 feat: Add ChargingRule enum with string conversion for charging decisions
- Add ChargingRule enum with 7 variants (Allowed, InsufficientCredit, DataLimitExceeded, VoiceLimitExceeded, SmsLimitExceeded, UserBlocked, Blocked)
- Add Debug, Clone, Serialize, Deserialize, PartialEq, Eq derives to ChargingRule
- Add as_str method to convert ChargingRule variants to uppercase string constants
2026-04-25 03:03:37 +03:00
nutcas3 7e47f09e54 feat: Replace RedisOperation with DatabaseError in rating_plans_repo error mapping
- Replace RedisOperation error variant with DatabaseError in new/get/list_map/add/remove methods
- Update 5 map_err calls to use DatabaseError for SQLx operation failures
2026-04-25 03:03:27 +03:00
nutcas3 69a84d85e6 feat: Improve rating_billing with integer arithmetic, overflow checks, and SCAN optimization
- Replace float division with integer arithmetic in calculate_usage_cost for data/voice conversions
- Add checked_add overflow protection for usage accumulation in apply_charging_rules and process_usage
- Replace String-based charging rules with ChargingRule enum variants
- Add Datelike import and implement billing period filtering in generate_invoice
- Replace blocking KEYS command with SCAN cursor iteration
2026-04-25 03:03:06 +03:00
nutcas3 3c5878d3cc feat: Replace unwrap_or with proper error handling in credit_management
- Replace unwrap_or(0) with map_err for get operation in deduct_credit
- Replace unwrap_or(0) with ? operator in check_credit
- Add RedisOperation error mapping for current_balance retrieval
2026-04-25 03:02:36 +03:00
nutcas3 40e9d1f221 remove comments 2026-04-25 02:52:41 +03:00
nutcas3 c37ba6c8f2 feat: Remove handlers module and relocate 25+ API handler functions
- Delete handlers.rs module containing credit management handlers (check_credit, deduct_credit, add_credit, get_balance)
- Remove subscriber account handlers (get_subscriber, update_subscriber)
- Remove usage event handlers (record_usage, calculate_usage_cost, rate_usage, process_usage)
- Remove rating plan handlers (list_rating_plans, get_rating_plan, add_rating_plan, remove_rating_plan)
- Remove user blocking handlers (block_user, unblock_user,
2026-04-25 02:52:27 +03:00
nutcas3 69c54c4a35 feat: Remove dead_code attributes and add duplicate block check to block_user
- Remove dead_code attributes from get_balance/add_credit/start/stop/uptime/rating plan methods in credit_management and engine
- Remove dead_code attributes from calculate_usage_cost in rating_billing
- Remove dead_code attributes from get/list_map/deactivate methods in rating_plans_repo and row_to_plan function
- Remove dead_code attributes from get_performance_metrics/start_background_sync in monitoring modules
2026-04-25 02:43:57 +03:00
nutcas3 607040da6c feat: Add usage processing and invoice generation API endpoints
- Add POST /v1/usage/calculate-cost endpoint to calculate usage cost for events
- Add POST /v1/usage/rate endpoint to rate usage events
- Add POST /v1/usage/process endpoint for full rating and billing processing
- Add GET /v1/invoice/:imsi/:period endpoint to generate invoices for billing periods
- Add list_map call to list_rating_plans handler for internal lookups
- Add session_id validation to all usage endpoints using validate_session_id helper
2026-04-25 02:43:22 +03:00
nutcas3 dcd1cdeca0 feat: Remove api module and relocate handlers, clean up unused code and dead_code attributes
- Delete api.rs module containing 20+ handler functions (credit management, subscriber accounts, rating plans, user blocking, system stats, metrics, engine control, error stats, sync control, health checks)
- Remove dead_code attributes from UsageEvent and UsageType in charging/types
- Remove validate_imsi helper function and dead_code attribute from errors/helpers
- Remove ConfigurationError logging case
2026-04-25 02:37:42 +03:00
nutcas3 231f03c903 feat: Extract API handlers from api module into dedicated handlers module
- Move all handler functions from api.rs to new handlers.rs module
- Add 20+ handler functions for credit management, subscriber accounts, rating plans, user blocking, system stats, metrics, engine control, error stats, sync control, and health checks
- Add input validation using validate_ip/validate_bytes/validate_amount/validate_session_id helpers
- Add error context and logging to all handlers using with_context and log
2026-04-25 02:14:23 +03:00
nutcas3 1ee156af75 feat: Add list_rating_plans error handling, dead_code attributes, and refactor monitoring/models
- Add error mapping to list_rating_plans in engine.rs
- Add dead_code attributes to get/list_map/deactivate methods in rating_plans_repo and row_to_plan function
- Add list method to RatingPlansRepo returning Vec<RatingPlan>
- Add dead_code attribute to validate_imsi in helpers
- Add UsageBlocked and ConfigurationError variants to ChargingError with Display/IntoResponse implementations
- Add Default
2026-04-25 02:14:10 +03:00
nutcas3 8b86e55226 feat: Refactor charging engine modules with dead_code annotations and error handling improvements
- Add AsyncCommands import and dead_code attributes to get_balance/add_credit/start/stop/uptime/rating plan methods
- Remove validate_imsi/validate_session_id calls from get_subscriber_account/record_usage_event
- Update logging in get_subscriber_account and simplify record_usage_event log message
- Remove usage event expiration logic from record_usage_event
- Reorder engine methods and add dead_code attributes
2026-04-25 02:10:24 +03:00
nutcas3 99943c769e feat: Extract router configuration from api module into dedicated routes module
- Move create_router function from api.rs to new routes.rs module
- Move routing imports (delete/get/post/put/Router/CorsLayer) from api to routes
- Add handler function imports to routes module
- Move AppState from api to models module
- Remove validation comments from check_credit/deduct_credit/add_credit/get_balance/record_usage handlers
- Add IntoResponse import to api module
2026-04-25 01:59:40 +03:00
nutcas3 67a2c807d1 feat: Remove unused imports and suppress dead_code warnings across charging engine modules
- Remove unused AsyncCommands/error/ChargingSession/ErrorContext imports from credit_management
- Remove unused ErrorContext/ChargingError imports from engine
- Remove unused ErrorContext import from rating_billing and prefix unused variables with underscore
- Remove unused ErrorContext import from rating_plans_repo
- Remove unused Context import from errors/helpers
- Remove unused info/debug/SystemTime imports from monitoring
- Remove unused sleep
2026-04-25 01:33:20 +03:00
nutcas3 4c14721dfc feat: Add error statistics, sync control, and detailed health check API endpoints
- Add GET /v1/errors endpoint to retrieve error statistics (total/types/last error)
- Add POST /v1/sync/start endpoint to start background sync
- Add GET /v1/health/detailed endpoint for detailed health checks (redis/sync/memory status)
2026-04-25 01:32:34 +03:00
nutcas3 ab986927d0 feat: Add error stats, sync control, detailed health endpoints and fix subscriber account balance type
- Add GET /v1/errors endpoint to retrieve error statistics
- Add POST /v1/sync/start endpoint for sync control
- Add GET /v1/health/detailed endpoint for detailed health checks
- Fix balance field type from u64 to i64 in update_subscriber
- Add status and last_updated fields to SubscriberAccount in update_subscriber
2026-04-25 01:30:39 +03:00
nutcas3 4c50359bdb feat: Add subscriber update, performance metrics, and engine control API endpoints
- Add PUT /v1/subscriber/:imsi endpoint to update subscriber account details (balance/data/voice/sms usage and limits)
- Add GET /v1/metrics endpoint to retrieve performance metrics (connected clients/memory/commands/RPS/response time)
- Add POST /v1/engine/start and POST /v1/engine/stop endpoints for engine lifecycle management
- Add GET /v1/engine/uptime endpoint to retrieve engine uptime in seconds
- Add put to
2026-04-25 01:28:13 +03:00
nutcas3 1b5ee4ad4a feat: Add rating plan management, user blocking, and system stats API endpoints
- Add GET/POST /v1/rating-plans and GET/DELETE /v1/rating-plans/:id endpoints for rating plan CRUD operations
- Add POST /v1/block/:ip, POST /v1/unblock/:ip, and GET /v1/blocked/:ip endpoints for user blocking management
- Add GET /v1/stats endpoint to retrieve system statistics (accounts/sessions/blocked users/alerts/uptime)
- Add delete to routing imports and remove unused IntoResponse/warn imports
- Add RatingPlan
2026-04-25 01:27:51 +03:00