Commit Graph

6 Commits (e7b2fad441fd6092354f47764d340e1223da290e)

Author SHA1 Message Date
alex e7b2fad441
verifyEventLink: check cache first to allow more valid URLs
previously, a request to an open graph image reported from say
https://github.com/example/some.repo would result in 404 not found, a
false negative because "is link in event?" verification would fail:
"some.repo" looks like a file with .repo extension, not an html page.

in this commit, if a client already requested example/some.repo
before, and it is cached, the response to the OGP image is successful.
2022-12-10 17:58:47 +01:00
alex 78a1aae7e8
cmd/noxy: add CORS headers to all endpoints
the simplest approach at the moment: allow requests from all origins,
only GET and OPTIONS methods.

allowed headers are '*'. this prevents clients from providing
credentials via cookies which isn't used anyway. nuff cookies.
2022-12-09 23:57:18 +01:00
alex 813d0501bd
basic implementation of the last api version
the meat is in Noxer struct, in noxy.go.
executable server entry point is in cmd/noxy/main.go.

all request responses are cached using a rudimentary filesystem
based caching. a max storage quota is not implemented yet.
2022-12-09 23:50:26 +01:00
alex 8dc6a62eb8
docs: replace api with a simpler version
the previous design was too complex to implement due its double
roundtrip: first JSON, then data.

in this new design, the client gets the data right away, single
roundtrip.
2022-12-05 23:38:40 +01:00
alex 8d1e0c3520
docs: change api response format from objects to arrays
a possibly better data format to work with in javascript.
2022-11-20 18:06:13 +01:00
alex 780b16cf5f
initial: api v1 draft 2022-11-17 22:06:41 +01:00