Skip to content

Commit

Permalink
Merge pull request #154 from FacturAPI/update/signature-validation-param
Browse files Browse the repository at this point in the history
rename signature validation param
  • Loading branch information
javorosas authored Nov 8, 2024
2 parents 6c52024 + 3c61244 commit d721214
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
20 changes: 11 additions & 9 deletions website/openapi_v2.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5744,7 +5744,9 @@ paths:
- webhooks
summary: Validate Webhook Signature
description: |
Validate the signature of a webhook event. This endpoint is used to verify the authenticity of the webhook event.
Validate the signature of an event object received through a Webhook.
Use this operation to verify the authenticity and integrity of the event
received, comparing the received signature with the one generated by Facturapi.
x-codeSamples:
- lang: Bash
label: cURL
Expand All @@ -5755,7 +5757,7 @@ paths:
-d '{
"secret": "wh_sec...",
"payload": "Object Response",
"facturapi-signature": "Signature_FROM_HEADER"
"signature": "Signature_FROM_HEADER"
}'
- lang: JavaScript
label: Node.js
Expand All @@ -5765,7 +5767,7 @@ paths:
const customer = await facturapi.webhooks.validateSignature({
secret: "wh_sec...",
payload: "Object Response",
'facturapi-signature': "Signature_FROM_HEADER"
signature: "Signature_FROM_HEADER"
});
- lang: csharp
label: C#
Expand All @@ -5775,15 +5777,15 @@ paths:
{
["secret"] = "wh_sec...",
["payload"] = new Dictionary<string>["Object Response"],
["facturapi-signature"] = "Signature_FROM_HEADER"
["signature"] = "Signature_FROM_HEADER"
});
- lang: PHP
source: |
$facturapi = new Facturapi( "sk_test_API_KEY" );
$customer = $facturapi->Webhooks->validateSignature([
"secret" => "wh_sec...",
"payload" => "Object Response",
"facturapi-signature" => "Signature_FROM_HEADER"
"signature" => "Signature_FROM_HEADER"
]);
requestBody:
content:
Expand All @@ -5793,15 +5795,15 @@ paths:
properties:
secret:
type: string
description: Secret key of the webhook
description: Secret key of the webhook, found in the webhook settings or upon creation.
required: true
payload:
type: object
description: Object response of webhook
description: Event object received through a webhook.
required: true
facturapi-signature:
signature:
type: string
description: Signature from header
description: Signature from the header "Facturapi-Signature".
required: true
security:
- "SecretLiveKey": []
Expand Down
22 changes: 12 additions & 10 deletions website/openapi_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5693,9 +5693,11 @@ paths:
operationId: validateWebhookSignature
tags:
- webhooks
summary: Validar response de webhook
summary: Validar evento de webhook
description: |
Valida la firma de un webhook recibido. Utiliza esta operación para verificar la autenticidad de un webhook recibido.
Valida la firma de un evento recibido mediante un Webhook.
Utiliza esta operación para verificar la autenticidad e integridad de
un evento recibido, comparando la firma recibida con la generada por Facturapi.
x-codeSamples:
- lang: Bash
label: cURL
Expand All @@ -5706,7 +5708,7 @@ paths:
-d '{
"secret": "wh_sec...",
"payload": "Object Response",
"facturapi-signature": "Signature_FROM_HEADER"
"signature": "Signature_FROM_HEADER"
}'
- lang: JavaScript
label: Node.js
Expand All @@ -5716,7 +5718,7 @@ paths:
const customer = await facturapi.webhooks.validateSignature({
secret: "wh_sec...",
payload: "Object Response",
'facturapi-signature': "Signature_FROM_HEADER"
signature: "Signature_FROM_HEADER"
});
- lang: csharp
label: C#
Expand All @@ -5726,15 +5728,15 @@ paths:
{
["secret"] = "wh_sec...",
["payload"] = new Dictionary<string>["Object Response"],
["facturapi-signature"] = "Signature_FROM_HEADER"
["signature"] = "Signature_FROM_HEADER"
});
- lang: PHP
source: |
$facturapi = new Facturapi( "sk_test_API_KEY" );
$customer = $facturapi->Webhooks->validateSignature([
"secret" => "wh_sec...",
"payload" => "Object Response",
"facturapi-signature" => "Signature_FROM_HEADER"
"signature" => "Signature_FROM_HEADER"
]);
requestBody:
content:
Expand All @@ -5744,15 +5746,15 @@ paths:
properties:
secret:
type: string
description: Llave secreta del webhook
description: Llave secreta del webhook. Se obtiene al crear un webhook o desde el dashboard de Facturapi.
required: true
payload:
type: object
description: Objeto de respuesta del webhook
description: Objeto ApiEvent recibido mediante el webhook
required: true
facturapi-signature:
signature:
type: string
description: Firma del webhook
description: Firma del webhook recibida en el header `Facturapi-Signature`
required: true
security:
- "SecretLiveKey": []
Expand Down

0 comments on commit d721214

Please sign in to comment.