integrate telegram bot
This commit is contained in:
@@ -86,12 +86,17 @@ builder.Services.AddApplicationServices()
|
||||
.AddRateLimitingPolicies();
|
||||
|
||||
// Development-only: capture each OTP in-memory so GET /api/v1/dev/last_otp/{phone} can complete a login
|
||||
// without an SMS gateway. refinement-phase-8: the capture bridge runs ONLY while the log-only mock SMS sender is
|
||||
// selected — once a real gateway (Seams:Sms:Provider) ships, the OTP is delivered over the wire and never logged
|
||||
// or captured. Nothing here is wired in any other environment.
|
||||
// without an SMS gateway. refinement-phase-8: the capture bridge runs ONLY for a capture-safe sender — the
|
||||
// log-only mock, or the Development-only `telegram` relay (telegram-otp-bot/), which is a manual-testing
|
||||
// convenience rather than a gateway and keeps the helper (and its e2e tests) working. A real gateway
|
||||
// (kavenegar, and any future one) delivers over the wire and must never have the code logged or captured.
|
||||
// Nothing here is wired in any other environment.
|
||||
var smsProvider = configuration["Seams:Sms:Provider"];
|
||||
var usingMockSms = string.IsNullOrWhiteSpace(smsProvider) || smsProvider.Equals("mock", StringComparison.OrdinalIgnoreCase);
|
||||
if (builder.Environment.IsDevelopment() && usingMockSms)
|
||||
var otpCaptureAllowedProvider =
|
||||
string.IsNullOrWhiteSpace(smsProvider) ||
|
||||
smsProvider.Equals("mock", StringComparison.OrdinalIgnoreCase) ||
|
||||
smsProvider.Equals("telegram", StringComparison.OrdinalIgnoreCase);
|
||||
if (builder.Environment.IsDevelopment() && otpCaptureAllowedProvider)
|
||||
builder.Services.AddDevelopmentOtpCapture();
|
||||
|
||||
// The IPaymentCaptureSimulator + bookings/convert path is a Development/Testing affordance (b10's real webhook
|
||||
|
||||
@@ -19,6 +19,14 @@
|
||||
"ObjectStorage": {
|
||||
"RootPath": ""
|
||||
},
|
||||
"Sms": {
|
||||
"Provider": "telegram",
|
||||
"Telegram": {
|
||||
"BaseUrl": "http://127.0.0.1:5010",
|
||||
"ApiKey": "ab8984974bc1fe5ce514d0fd74f71c8738b3aed92a7e4d86",
|
||||
"TimeoutSeconds": 10
|
||||
}
|
||||
},
|
||||
"Geocoding": {
|
||||
"ReturnNullCoordinates": false,
|
||||
"LowConfidenceMarker": "NO_GEO",
|
||||
|
||||
Reference in New Issue
Block a user