core-go/webhooks
Conrad Hoffmann cd87849358 webhooks: skip webhooks with expired credentials
The documentation states [1]:

> When the original authentication method becomes invalid (such as the
> expiration of or revocation of an OAuth 2.0 bearer token), the
> webhook is disabled.

However, this is currently not the case. Expired webhooks are indeed
filtered out in virtually all GraphQL queries (by means of core-go's
FilterWebhooks [2]), so users cannot see or delete them. They are _not_
filtered out upon scheduling, however. This commit fixes that.

The symptoms of this are that active webhooks may simply not be run - if
a user has both an expired and a valid, active webhook for some event,
the scheduling will retrieve both, fail on the expired one, and stop
processing, without any feedback to the user who scheduled the hooks.

This is a problem across all services, so core-go seems like the best
place to fix this.

[1]: https://man.sr.ht/graphql.md#webhook-authentication
[2]: https://git.sr.ht/~sircmpwn/core-go/tree/master/item/webhooks/config.go#L74,81
2023-12-04 21:14:55 +01:00
..
config.go Run `go fmt` 2022-08-29 11:03:46 +02:00
context.go webhooks: expand auth configuration 2021-08-24 15:59:35 +02:00
legacy.go webhooks/legacy: fetch subscriptions upfront 2021-09-09 10:42:13 +02:00
legacy_test.go webhooks: fix failing test 2021-09-24 13:12:16 +02:00
middleware.go webhooks: Add middleware 2022-02-17 14:37:55 +01:00
queue.go webhooks: skip webhooks with expired credentials 2023-12-04 21:14:55 +01:00