Skip to content

Add the webhooks pages and delivery log of the admin - #3628

Merged
pournasserian merged 2 commits into
feature/a6from
3424-webhooks-admin-half
Nov 24, 2026
Merged

pournasserian merged 2 commits into
feature/a6from
3424-webhooks-admin-half

Conversation

@pournasserian

Copy link
Copy Markdown
Member

Closes #3424

Fills the webhooks half of the admin (spec 5.3), for a caller who holds webhooks.manage in the site. /webhooks lists the webhooks of the site with their address, events and state, and enables, disables and deletes them; one form below the list makes a new webhook or, after Edit, changes the chosen one: name, https address, the events from the half's own list in three groups, the content types of the schema, up to 20 headers, enabled, and a new secret. /webhooks/{id} shows the webhook and its delivery log, 20 attempts a page, each with its state, status and duration, and on Details its body, the start of the answer and the error; an attempt is sent again and the webhook is pinged, and the page follows the log until the new delivery has its result and says it.

Decisions that matter to a reader (all in the comment on #3424):

  • Secret. A create sends no secret, so the server makes it and answers it once. "Make a new secret" on an edit makes whsec_ and 64 hexadecimal digits in the browser and sends it; the server keeps the old secret signing for its overlap, and the list and the webhook's page show until when. Either secret is shown once by A-33's CmsSecretDialog and held in one field of the page until Done.
  • Stored header values. A stored header shows its name read-only and no value; an empty value sends ***, which keeps the stored one. Once the address has another scheme, host or port than when the form was loaded, the form says that each header needs its value again and marks it required, without stopping the save, so the server's FCMS1560 on headers.{name} shows under that header. Enable and disable send the webhook back whole with the headers redacted.
  • End-to-end case. The end-to-end host now lets webhooks reach private networks (FluentCms:Webhooks:AllowPrivateNetworks), and the case's receiver on the loopback address counts each connection and closes it: the host runs in Production, where a webhook takes https, and trusts no certificate of the run, so every attempt fails. The case makes the webhook in the page, copies the secret, which the page then holds nowhere, publishes an entry, reads the failed delivery with its body and error, sends it again and pings, each reaching the receiver; a second case checks that in a site where the plugin is disabled the half has no menu item, its page is not found and it is not fetched.
  • Only the component tests show a delivery that was answered, with its status and answer, and the result of a successful redelivery; the API tests use addresses under .invalid, which never resolve.
  • WebhookRecord and WebhookSaved are public, since the form, a Razor component, takes them; the half adds no stylesheet.

Size check: the first download is 3,593,587 B, 6,413 B under the budget of 3,600,000 B, measured on this branch with eng/check-admin-size.cs from a publish into an empty folder; the half's assembly is left out as lazy, and the first download grows by the second page of its manifest.

Shared files touched beyond the half and its tests: admin/tests/FluentCMS.Admin.ApiTests/FluentCMS.Admin.ApiTests.csproj (the half's project reference), admin/tests/FluentCMS.Admin.EndToEnd/EndToEndHost.cs (the setting above) and docs/planning/admin-technical-spec.md (the As built paragraph of 5.3).

Dependencies: none.

  • An administrator makes a webhook for a publish event, copies the secret made for it, and the secret cannot be read again
  • A publish shows as a delivery with its status, body and answer, and a failed one is sent again
  • A change of the address asks for each header's value again, and a save without them shows the refusal on the header
  • A ping shows its result
  • In a site where the plugin is disabled the pages and the menu item are absent, and the half is not fetched
  • Component tests cover the form, the headers and the log; the API tests check the records against the OpenAPI document; an end-to-end case makes a webhook against a receiver of the test and reads its delivery

Checked locally: dotnet build -c Release -warnaserror; the half's component tests (17); WebhooksTests of the API tests (4); the architecture tests; the end-to-end WebhooksTests (2) once in slow mode with its class alone; markdownlint-cli2 on the changed markdown. Only CI shows: the full suites, the end-to-end cases shuffled among the others, PostgreSQL and SQL Server, and Windows. Not checked: a screen reader.

@pournasserian pournasserian added type:feature New capability area:admin The Blazor WebAssembly admin and the admin halves of plugins labels Nov 24, 2026
@pournasserian
pournasserian merged commit 185736d into feature/a6 Nov 24, 2026
4 checks passed
@pournasserian
pournasserian deleted the 3424-webhooks-admin-half branch November 24, 2026 03:27
pournasserian added a commit that referenced this pull request Nov 24, 2026
Milestone A6 of the admin: nothing a Must row needs takes the CLI or a
direct API call. An administrator manages users, roles, keys, members,
settings, locales, sites and host names, webhooks, MCP clients, plugins
and jobs, and reads the startup report, from the admin alone; an editor
runs AI actions on the opted-in fields.

Closes #3419
Closes #3420
Closes #3421
Closes #3422
Closes #3423
Closes #3424
Closes #3425
Closes #3426
Closes #3427
Closes #3428
Closes #3429
Closes #3430
Closes #3431
Closes #3354
Closes #3446
Closes #3488
Closes #3504
Closes #3514
Closes #3630

## What is in it

- **A-51 (#3438): the administration area.** A lazy assembly of its own,
access for the instance, core's menu entries and the stubs of five
plugin halves.
- **A-31 (#3493): users and invitations.**
- **A-34 (#3498): the settings menu and the generated settings pages**,
with secrets and reset.
- **A-32 (#3503): roles**, with grants from the permission catalogue and
the site's Public role; **A-52 (#3532): the constraints of a grant**:
sites, locales, fields, resources and a row rule.
- **A-40 (#3508): members and member groups.**
- **A-33 (#3496): API keys**, with the secret shown once by one
component, which the webhooks and MCP halves use too.
- **A-35 (#3515): sites and locales, and the multi-site half.**
- **A-38 (#3509): field actions in the form and the AI assist half**,
with the usage page.
- **A-39 (#3541): plugins, jobs, event dead letters and diagnostics**,
and the search rebuild as a page of the search half.
- **A-36 (#3628): the webhooks half.** The list and one form, the secret
shown once on create and on rotation, header values asked again when the
address moves, the delivery log with send again, and ping.
- **A-37 (#3629): the MCP half.** The clients of the instance with
approve, role, reject, revoke and register; the guidelines and
instructions and the stored prompts of a site; the agent writes.

Fixed on the way:

- #3507: a sign-in completes only at the callback's own address (#3504).
- #3518: the not-found and no-access states follow the address (#3488).
- #3516: a page follows its query only at its own route while the router
waits (#3514).
- #3539: a loading state shows while a navigation waits for an assembly
or a locale's access (#3446).
- #3519: the component gallery and the JSON fast paths leave the first
download (#3354).
- #3510 and #3612: the tests of a half's first use count its configure
per admin and show that first uses in any order load it once (#3505).
- #3631: the test of the AI usage page writes the time as the runtime
does, so it passes on Linux (#3630).

## Decisions

The decisions of the milestone are in #3431 and in section 11 of
`docs/planning/admin-technical-spec.md`; each issue has its own in a
comment. The ones a reader meets first:

- Core's pages of administration load lazily, in an assembly of their
own, and so do the halves: the first download grows only by the gate of
A-51, the field actions of A-38 and the manifests.
- A page of an instance-only group (users, members, jobs, diagnostics,
the MCP clients, the multi-site pages) is gated by the grant for the
instance; roles, keys, settings and sites show what the caller may
manage in the site.
- The MCP half leaves out the bulk removal of #3397, which section 5.4
does not describe, and shows the agent writes on a page of its own.

## Dependencies

None: no NuGet package, npm package or GitHub Action, no migration and
no backend model change. Outside `admin/` the milestone changes
`FluentCMS.slnx` (the new projects), one `COPY` line of the host's
`Dockerfile`, `tests/FluentCMS.Architecture.Tests/AdminRulesTests.cs`, a
comment in `ci.yml` and the admin specification.

## Size

First download 3,594,429 B with every half, 5,571 B under the budget of
3,600,000 B.

## Verification

- `main` is merged in at c13af58 (#3627). The one conflict, a paragraph
of section 5.5 of the admin specification, kept the as-built text of
A-38.
- The manual CI on `feature/a6` at 7dd0d7c, the tree of this pull
request, passed: the quick run 45324672156 and the full run 45390713433.
- This pull request ran the full checks and the dry run of `Publish`,
and both passed.
- What the reviews of the last two halves left is on #3610 and #3611.
#3502 and #3511 of the milestone stay open.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:admin The Blazor WebAssembly admin and the admin halves of plugins type:feature New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant