mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
Fix update webhooks (#4011)
* Fix update webhooks * Update swagger for webhook update
This commit is contained in:
parent
bbce4451aa
commit
a753459a6d
@ -309,6 +309,12 @@ namespace BTCPayServer.Services.Stores
|
||||
.FirstOrDefaultAsync();
|
||||
if (hook is null)
|
||||
return;
|
||||
var currentBlob = hook.GetBlob();
|
||||
|
||||
if (string.IsNullOrEmpty(webhookBlob.Secret))
|
||||
{
|
||||
webhookBlob.Secret = currentBlob.Secret;
|
||||
}
|
||||
hook.SetBlob(webhookBlob);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
|
@ -152,7 +152,7 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/WebhookDataBase"
|
||||
"$ref": "#/components/schemas/WebhookDataUpdate"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -539,6 +539,23 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"WebhookDataUpdate": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/WebhookDataBase"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"secret": {
|
||||
"type": "string",
|
||||
"description": "Must be used by the callback receiver to ensure the delivery comes from BTCPay Server. BTCPay Server includes the `BTCPay-Sig` HTTP header, whose format is `sha256=HMAC256(UTF8(webhook's secret), body)`. The pattern to authenticate the webhook is similar to [how to secure webhooks in Github](https://docs.github.com/webhooks/securing/). If left out, null, or empty, the secret will not be changed.",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"WebhookDataBase": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
|
Loading…
Reference in New Issue
Block a user