aboutsummaryrefslogtreecommitdiff
path: root/go.mod
diff options
context:
space:
mode:
authorRasmus Dahlberg <rgdd@glasklarteknik.se>2025-01-06 13:21:47 +0100
committerRasmus Dahlberg <rgdd@glasklarteknik.se>2025-01-06 13:30:52 +0100
commit2d3b1f2cb0c05385c1702f1a7d74fa08d52c262f (patch)
tree6b5b1e9884ffb1f17629143e7c0d1bbfb1176ac1 /go.mod
parentee5c55d82ad70353e8203f6729d4325b59741bfa (diff)
fix: Ensure rate-limits are on for get-entriesmain
Backoff on 4XX and 5XX. See related issue: https://github.com/google/certificate-transparency-go/issues/898 Test manually hints: ``` $ cat srv.py from http.server import HTTPServer, BaseHTTPRequestHandler class RequestHandler(BaseHTTPRequestHandler): def do_GET(self): self.send_response(429) self.send_header("Content-Type", "text/plain") self.end_headers() self.wfile.write(b"429 something something...") def do_POST(self): self.do_GET() def do_PUT(self): self.do_GET() def do_DELETE(self): self.do_GET() if __name__ == "__main__": server_address = ('localhost', 9090) httpd = HTTPServer(server_address, RequestHandler) print("Server running on http://localhost:9090") httpd.serve_forever() ``` And a transport for http.Client that redirects to localhost: ``` type statusRR struct { inner http.RoundTripper } func (s *statusRR) RoundTrip(req *http.Request) (*http.Response, error) { if strings.Contains(req.URL.Path, "ct/v1/get-entries") { req.URL.Scheme = "http" req.URL.Host = "localhost:9090" } rsp, err := s.inner.RoundTrip(req) return rsp, err } ```
Diffstat (limited to 'go.mod')
-rw-r--r--go.mod2
1 files changed, 1 insertions, 1 deletions
diff --git a/go.mod b/go.mod
index b119535..41417c5 100644
--- a/go.mod
+++ b/go.mod
@@ -4,6 +4,7 @@ go 1.22.7
require (
github.com/google/certificate-transparency-go v1.3.0
+ github.com/google/trillian v1.7.0
github.com/prometheus/client_golang v1.20.5
github.com/transparency-dev/merkle v0.0.2
gitlab.torproject.org/rgdd/ct v0.0.0
@@ -14,7 +15,6 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
- github.com/google/trillian v1.7.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/prometheus/client_model v0.6.1 // indirect