{% extends "base.html" %} {% block title %}{{ t('webhook_secret.title') }} — painfree{% endblock %} {% block body %} {% if secret %}

{{ t('webhook_secret.heading_rotated') if rotated else t('webhook_secret.heading_new') }}

{{ t('webhook_secret.copy_now') }}

{{ t('webhook_secret.copy_now_why') }}

{{ secret }}
{% if rotated %}

{{ t('webhook_secret.old_still_signing') }}

{{ t('webhook_secret.old_still_signing_why') }}

{% endif %} {% else %}

{{ t('webhook_secret.already_registered') }}

{{ t('webhook_secret.already_registered_why') }} {{ subscription.url }}{{ t('webhook_secret.already_registered_tail') }}

{{ t('webhook_secret.rotate_instead') }}

{% endif %}
{{ t('webhooks.endpoint') }}{{ subscription.url }}
{{ t('webhook_secret.subscription') }}{{ subscription.subscription_id }}
{{ t('webhooks.events') }}{{ subscription.event_types | join(', ') }}
{{ t('webhook_secret.secret_generation') }}{{ subscription.secret_generation }}

{{ t('webhook_secret.verifying') }}

{# The header names, the `v1=` prefix and the HMAC construction are the webhook envelope's contract. The prose around them is translated; not one character inside them is. #}

{{ t('webhook_secret.verifying_body') }}

expected = "v1=" + HMAC_SHA256(secret, timestamp + "." + raw_request_body)

{{ t('webhook_secret.verifying_tail') }}

{{ t('webhook_secret.open_endpoint') }} {{ t('webhook_secret.all_webhooks') }}
{% endblock %}