SLOTS
SLOTS = 5
Subscriptions the form renders.
Fixed rather than unlimited, because a site needing more than this is integrating through something other than a settings form.
The endpoints that are told when something happens.
A secret already stored is never rendered back into the form. A configuration form that showed the current value would put every subscription's signing secret into the HTML of a page, into the browser's cache and into any proxy in between. So the field is left blank with a note that it is set, and an empty submission keeps what is there rather than clearing it - which means clearing a secret deliberately needs its own control.
The event list comes from StrataEvents::all(), so an event added in a later release appears here
without this form being edited.
secretFor(array$values, \Drupal\strata\Event\Webhook\WebhookSubscription|null $existing) : string
The secret to store for one slot.
| array |
$values | The submitted slot. |
| \Drupal\strata\Event\Webhook\WebhookSubscription|null | $existing | What was stored before, or NULL for a new endpoint. |
The secret to store, which may be what was already there.
at(list<\Drupal\strata\Event\Webhook\WebhookSubscription> $existing, int $slot) : \Drupal\strata\Event\Webhook\WebhookSubscription|null
The subscription filling one slot, if there is one.
A slot past the end of the stored list is empty, which is the normal case: the form always renders every slot and a site usually configures fewer.
| list<\Drupal\strata\Event\Webhook\WebhookSubscription> | $existing | What is stored. |
| int | $slot | The slot index. |
The subscription, or NULL when the slot is empty.