Update kaigen credit private key

This commit is contained in:
2025-07-17 00:46:30 +07:00
parent 73ddbb0711
commit 3bd22922c7
3 changed files with 10 additions and 4 deletions

View File

@@ -36,7 +36,6 @@
"Kaigen": {
"BaseUrl": "https://api.kaigen.managing.live",
"DebitEndpoint": "/api/credits/debit",
"RefundEndpoint": "/api/credits/refund",
"PrivateKey": "${KAIGEN_PRIVATE_KEY}"
"RefundEndpoint": "/api/credits/refund"
}
}

View File

@@ -27,8 +27,7 @@
"Kaigen": {
"BaseUrl": "https://api.kaigen.managing.live",
"DebitEndpoint": "/api/credits/debit",
"RefundEndpoint": "/api/credits/refund",
"PrivateKey": "0x0fb7fbebde2b9a14b039fa974ad330dd693f91e783cd4ea13ed38be8706835a7"
"RefundEndpoint": "/api/credits/refund"
},
"N8n": {
"WebhookUrl": "https://n8n.kai.managing.live/webhook/fa9308b6-983b-42ec-b085-71599d655951"

View File

@@ -36,6 +36,14 @@ public class KaigenService : IKaigenService
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
};
// Always read from environment variable for security
var envPrivateKey = Environment.GetEnvironmentVariable("KAIGEN_PRIVATE_KEY");
if (!string.IsNullOrEmpty(envPrivateKey))
{
_settings.PrivateKey = envPrivateKey;
_logger.LogInformation("Using KAIGEN_PRIVATE_KEY from environment variable");
}
// Validate required settings
if (string.IsNullOrEmpty(_settings.PrivateKey))
{