latestOpenAPI 3.0.12026-08-1781258463.9 KB

2ecf51b1543e

AFNOR XP Z12-013/FlowService

🇫🇷 Norme · Subscribe to a webhook

This operation creates and configures a new webhook, providing:

  • The callback URL

  • The metadata to filter on subsets of events

The webhook belongs to the owner of the token and cannot be seen from others:

  • It returns an id and a signing key (256 or 512 bits) that should be kept

  • The signing key allows to validate the signature of each received event.

How the signature is managed:

  • At webhook creation a signing Key is randomly generated in a secure way

    • 256 bits are enough if the random generator is secure

    • 512 bits are necessary if the generator is not secure

  • Each time an event is sent:

    • a SHA-256 fingerprint is generated based on the concatenation of:

      • the JSON payload of the response (as is, no canonical format)

      • a separator : @

      • the current epoch time in seconds

    • a HMAC signature is computed over the fingerprint with the callback signing key

    • the signature is base64 encoded for the transport

The signature and the timestamp are returned in the following headers of the callback:

  • Afnor-Signature is the signature (base64)

  • Afnor-Signature-Timestamp is the epoch timestamp in seconds

post/flow-service/v1/webhooks

Headers

Request-Idstring uuid
Organization-Idstring

Request body

callbackUrlstring uri required
flowTypesFlowType[] nullable
flowDirection'In' | 'Out'

Direction of the flow:

  • In: Incoming flow, from the PDP to the OD

  • Out: Outgoing flow, from the OD to the PDP

ackStatus'Pending' | 'Ok' | 'Error'
  • Ok: the following checks have passed:

    • Anti virus

    • Integrity checks

    • Technical rules checks

    • Unicity checks

  • Error: one of the previous test has failed

  • Pending : the flow is not yet integrated

Response

OK

webhookIdstring uuid nullable
signingKeystring byte nullable
createdAtstring date-time nullable