Commit Graph

12 Commits

Author SHA1 Message Date
Peter Stuifzand
6fb4dc6ca8
Publish on hub.url, and answer with a status that means something
Some checks failed
continuous-integration/drone Build is failing
A publisher names the feed in hub.url (spec §7.1). This read hub.topic, which
belongs to subscribe and unsubscribe, so every compliant publisher sent a
notification the hub could not resolve: it logged "could not request topic :"
and returned 200 with an empty body. Nothing was ever delivered, and the
status said the opposite. hub.topic is still read, but only when hub.url is
missing.

The rest is the same class of bug — a response that reported success for work
that did not happen:

- a publish with no topic is 400, a topic that does not answer 2xx is 502,
  and a subscriber is told nothing about either;
- the fetched body is bounded, its response closed, and a callback is retried
  once with the outcome logged instead of assuming the first POST landed;
- unsubscribe wrote 200 and then an error body into the same response; it now
  answers once;
- the challenge comes from crypto/rand and must be echoed exactly, since a
  substring match let any page that mentioned it pass verification;
- pq.Error implements error on the pointer, so the value assertion never
  compiled; the statement now type-asserts the pointer;
- the database password can come from HUB_DB_PASSWORD instead of only being
  baked into the binary.

The build moves to go.mod and golang:1.22, because io.Discard does not exist
in the 1.12 image the pipeline was pinned to.
2026-11-08 01:20:53 +01:00
9ce5f6e6c6 Delete expired subscribers
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-21 22:50:13 +02:00
cae5011ff0 Improve loggin for publishing 2020-11-29 22:22:26 +01:00
4ef5b7b2dd Topic and callback should be absolute urls
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-20 00:00:00 +01:00
071bf66721 Fix error in unsubscriber
All checks were successful
continuous-integration/drone/push Build is passing
- wrong error checking
2019-03-19 07:28:32 +01:00
59668090df Clean up publish
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-19 07:24:13 +01:00
90cb4bc674 Cleanup more logging
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-18 22:51:22 +01:00
df9bb9396c Add more logging
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-18 22:47:05 +01:00
3c6a5ac4d0 Fix another logging call
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-18 22:13:39 +01:00
2cda6afee9 Fix logging
Some checks failed
continuous-integration/drone/push Build is failing
2019-03-18 22:12:50 +01:00
d58d21d491 Add some logging
Some checks failed
continuous-integration/drone/push Build is failing
2019-03-18 22:11:28 +01:00
ec510484d8 Cleanup websub hub (and use postgres) 2019-03-18 21:47:49 +01:00