Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

Update to go 1.26, and other various backend updates (#1364)

Matt9de193bf7c27
diff --git a/.github/instructions/code.instructions.md b/.github/instructions/code.instructions.md
index 4e3fa228..51c90cbd 100644
--- a/.github/instructions/code.instructions.md
+++ b/.github/instructions/code.instructions.md
@@ -8,7 +8,7 @@
**Database**: SQLite (default) or PostgreSQL
### Stack
-- **Backend** (`/backend`): Go 1.24+, Chi router, Ent ORM, port 7745
+- **Backend** (`/backend`): Go 1.26+, Chi router, Ent ORM, port 7745
- **Frontend** (`/frontend`): Nuxt 4, Vue 3, TypeScript, Tailwind CSS, pnpm 9.1.4+, dev proxies to backend
## Critical Build & Validation Commands
diff --git a/.github/workflows/binaries-publish.yaml b/.github/workflows/binaries-publish.yaml
index 8ce1b7d4..4a9bb5e7 100644
--- a/.github/workflows/binaries-publish.yaml
+++ b/.github/workflows/binaries-publish.yaml
@@ -52,7 +52,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c
with:
- go-version: "1.25"
+ go-version: "1.26"
cache-dependency-path: backend/go.mod
- name: Download Frontend Artifacts
@@ -111,7 +111,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c
with:
- go-version: "1.25"
+ go-version: "1.26"
- name: Combine checksums
working-directory: dist
diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml
index 10570a3f..61bdc78a 100644
--- a/.github/workflows/copilot-setup-steps.yml
+++ b/.github/workflows/copilot-setup-steps.yml
@@ -4,9 +4,6 @@ name: "Copilot Setup Steps"
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
- push:
- paths:
- - .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
@@ -34,11 +31,13 @@ jobs:
node-version: "24"
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
+ with:
+ version: 10
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c
with:
- go-version: "1.25"
+ go-version: "1.26"
cache-dependency-path: backend/go.mod
- name: Install Task
diff --git a/.github/workflows/e2e-partial.yaml b/.github/workflows/e2e-partial.yaml
index 7f333973..ec0e8a24 100644
--- a/.github/workflows/e2e-partial.yaml
+++ b/.github/workflows/e2e-partial.yaml
@@ -33,7 +33,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c
with:
- go-version: "1.25"
+ go-version: "1.26"
cache-dependency-path: backend/go.mod
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
diff --git a/.github/workflows/partial-backend.yaml b/.github/workflows/partial-backend.yaml
index a0f59b25..08cb9888 100644
--- a/.github/workflows/partial-backend.yaml
+++ b/.github/workflows/partial-backend.yaml
@@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c
with:
- go-version: "1.25"
+ go-version: "1.26"
cache-dependency-path: backend/go.mod
- name: Install Task
diff --git a/.github/workflows/partial-frontend.yaml b/.github/workflows/partial-frontend.yaml
index 08e2f18c..43722d6e 100644
--- a/.github/workflows/partial-frontend.yaml
+++ b/.github/workflows/partial-frontend.yaml
@@ -66,7 +66,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c
with:
- go-version: "1.25"
+ go-version: "1.26"
cache-dependency-path: backend/go.mod
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
@@ -117,7 +117,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c
with:
- go-version: "1.25"
+ go-version: "1.26"
cache-dependency-path: backend/go.mod
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
diff --git a/.scaffold/go.sum b/.scaffold/go.sum
index 16f190a2..e69de29b 100644
--- a/.scaffold/go.sum
+++ b/.scaffold/go.sum
@@ -1,14 +0,0 @@
-entgo.io/ent v0.14.5 h1:Rj2WOYJtCkWyFo6a+5wB3EfBRP0rnx1fMk6gGA0UUe4=
-entgo.io/ent v0.14.5/go.mod h1:zTzLmWtPvGpmSwtkaayM2cm5m819NdM7z7tYPq3vN0U=
-github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
-github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
-github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
-github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
-github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
-github.com/sysadminsmedia/homebox/backend v0.0.0-20260205022116-745fac6438b1 h1:A7TT5wp8hfU/2k/n/toPky4H3dv3Jhza0x3nriiK10E=
-github.com/sysadminsmedia/homebox/backend v0.0.0-20260205022116-745fac6438b1/go.mod h1:70G3l97IfOTqHgM4G2fCTsR/kY087J6k/d1iS3D3D3g=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/backend/app/api/main.go b/backend/app/api/main.go
index 0b28c089..17dc466e 100644
--- a/backend/app/api/main.go
+++ b/backend/app/api/main.go
@@ -2,6 +2,7 @@ package main
import (
"context"
+ "database/sql"
"errors"
"fmt"
"net/http"
@@ -28,7 +29,10 @@ import (
"github.com/sysadminsmedia/homebox/backend/internal/web/mid"
"go.balki.me/anyhttp"
- _ "github.com/lib/pq"
+ "entgo.io/ent/dialect"
+ entsql "entgo.io/ent/dialect/sql"
+
+ _ "github.com/jackc/pgx/v5/stdlib"
_ "github.com/sysadminsmedia/homebox/backend/internal/data/migrations/postgres"
_ "github.com/sysadminsmedia/homebox/backend/internal/data/migrations/sqlite3"
_ "github.com/sysadminsmedia/homebox/backend/pkgs/cgofreesqlite"
@@ -120,7 +124,20 @@ func run(cfg *config.Config) error {
return err
}
- c, err := ent.Open(strings.ToLower(cfg.Database.Driver), databaseURL)
+ sqlDriver := strings.ToLower(cfg.Database.Driver)
+ var driverName string
+ switch sqlDriver {
+ case config.DriverPostgres:
+ driverName = "pgx"
+ sqlDriver = dialect.Postgres
+ case config.DriverSqlite3, "sqlite":
+ driverName = "sqlite3"
+ sqlDriver = dialect.SQLite
+ default:
+ return fmt.Errorf("unsupported driver: %s", sqlDriver)
+ }
+
+ db, err := sql.Open(driverName, databaseURL)
if err != nil {
log.Error().
Err(err).
@@ -138,6 +155,15 @@ func run(cfg *config.Config) error {
)
}
+ drv := entsql.OpenDB(sqlDriver, db)
+ c := ent.NewClient(ent.Driver(drv))
+ defer func(c *ent.Client) {
+ err := c.Close()
+ if err != nil {
+ log.Error().Err(err).Msg("failed to close database connection")
+ }
+ }(c)
+
migrationsFs, err := migrations.Migrations(strings.ToLower(cfg.Database.Driver))
if err != nil {
return fmt.Errorf("failed to get migrations for %s: %w", strings.ToLower(cfg.Database.Driver), err)
diff --git a/backend/app/api/middleware.go b/backend/app/api/middleware.go
index 81913923..9dd27f91 100644
--- a/backend/app/api/middleware.go
+++ b/backend/app/api/middleware.go
@@ -415,12 +415,6 @@ func (l *authRateLimiter) keyForRequest(r *http.Request, trustProxy bool) string
return extractClientIP(r, trustProxy) + "|" + r.URL.Path
}
-// clientIP returns the client IP address for the given request.
-// It only uses proxy headers (X-Real-IP, X-Forwarded-For) if TrustProxy is enabled.
-func (l *authRateLimiter) clientIP(r *http.Request, trustProxy bool) string {
- return extractClientIP(r, trustProxy)
-}
-
// simpleRateLimiter provides token bucket rate limiting per client IP.
type simpleRateLimiter struct {
mu sync.Mutex
diff --git a/backend/app/api/middleware_ratelimit_test.go b/backend/app/api/middleware_ratelimit_test.go
index 3dec7e7c..1503e6b0 100644
--- a/backend/app/api/middleware_ratelimit_test.go
+++ b/backend/app/api/middleware_ratelimit_test.go
@@ -1,6 +1,8 @@
package main
import (
+ "net/http"
+ "net/http/httptest"
"sync/atomic"
"testing"
"time"
@@ -8,154 +10,349 @@ import (
"github.com/sysadminsmedia/homebox/backend/internal/sys/config"
)
+const proxyRemoteAddr = "10.0.0.1:1234"
+
func TestSimpleRateLimiter(t *testing.T) {
- // Create a rate limiter that allows 3 requests per 10 seconds
- limiter := newSimpleRateLimiter(3, 10*time.Second)
- clientIP := "192.168.1.1"
-
- // First 3 requests should succeed
- for i := 0; i < 3; i++ {
- if !limiter.allow(clientIP) {
- t.Errorf("Request %d should have been allowed", i+1)
- }
+ type testCase struct {
+ name string
+ trustProxy bool
+ setupReq func(*http.Request, string)
}
- // 4th request should be blocked
- if limiter.allow(clientIP) {
- t.Error("4th request should have been blocked")
+ tests := []testCase{
+ {
+ name: "DirectConnection",
+ trustProxy: false,
+ setupReq: func(r *http.Request, ip string) { r.RemoteAddr = ip + ":1234" },
+ },
+ {
+ name: "ProxyXRealIP",
+ trustProxy: true,
+ setupReq: func(r *http.Request, ip string) {
+ r.RemoteAddr = proxyRemoteAddr // Proxy IP
+ r.Header.Set("X-Real-IP", ip)
+ },
+ },
+ {
+ name: "ProxyXForwardedFor",
+ trustProxy: true,
+ setupReq: func(r *http.Request, ip string) {
+ r.RemoteAddr = proxyRemoteAddr // Proxy IP
+ r.Header.Set("X-Forwarded-For", ip+", 10.0.0.2")
+ },
+ },
}
- // Different client should not be affected
- otherClient := "192.168.1.2"
- if !limiter.allow(otherClient) {
- t.Error("Different client should be allowed")
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ // Create a rate limiter that allows 3 requests per 10 seconds
+ limiter := newSimpleRateLimiter(3, 10*time.Second, tc.trustProxy)
+ t.Cleanup(func() { limiter.Stop() })
+ clientIP := "192.168.1.1"
+
+ // Helper to get IP
+ getIP := func(ip string) string {
+ req := httptest.NewRequest("GET", "/", nil)
+ tc.setupReq(req, ip)
+ return limiter.getClientIP(req, limiter.trustProxy)
+ }
+
+ // First 3 requests should succeed
+ for i := 0; i < 3; i++ {
+ ip := getIP(clientIP)
+ if !limiter.allow(ip) {
+ t.Errorf("Request %d should have been allowed", i+1)
+ }
+ }
+
+ // 4th request should be blocked
+ ip := getIP(clientIP)
+ if limiter.allow(ip) {
+ t.Error("4th request should have been blocked")
+ }
+
+ // Different client should not be affected
+ otherClient := "192.168.1.2"
+ otherIP := getIP(otherClient)
+ // Check if we are really testing a different IP
+ if otherIP == ip {
+ // This might happen if setupReq implementation is wrong or trustProxy logic is broken
+ t.Fatalf("Test setup error: otherClient IP resolved to same as clientIP: %s", otherIP)
+ }
+
+ if !limiter.allow(otherIP) {
+ t.Error("Different client should be allowed")
+ }
+ })
}
}
func TestSimpleRateLimiterRefill(t *testing.T) {
- // Create a rate limiter that allows 2 requests per 100ms
- limiter := newSimpleRateLimiter(2, 100*time.Millisecond)
- clientIP := "192.168.1.1"
-
- // Use up the tokens
- if !limiter.allow(clientIP) {
- t.Error("First request should be allowed")
+ type testCase struct {
+ name string
+ trustProxy bool
+ setupReq func(*http.Request, string)
}
- if !limiter.allow(clientIP) {
- t.Error("Second request should be allowed")
- }
- if limiter.allow(clientIP) {
- t.Error("Third request should be blocked")
+
+ tests := []testCase{
+ {
+ name: "DirectConnection",
+ trustProxy: false,
+ setupReq: func(r *http.Request, ip string) { r.RemoteAddr = ip + ":1234" },
+ },
+ {
+ name: "ProxyXRealIP",
+ trustProxy: true,
+ setupReq: func(r *http.Request, ip string) {
+ r.RemoteAddr = proxyRemoteAddr // Proxy IP
+ r.Header.Set("X-Real-IP", ip)
+ },
+ },
}
- // Wait for refill
- time.Sleep(150 * time.Millisecond)
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ // Create a rate limiter that allows 2 requests per 100ms
+ limiter := newSimpleRateLimiter(2, 100*time.Millisecond, tc.trustProxy)
+ t.Cleanup(func() { limiter.Stop() })
+ clientIP := "192.168.1.1"
+
+ // Helper to get IP
+ getIP := func(ip string) string {
+ req := httptest.NewRequest("GET", "/", nil)
+ tc.setupReq(req, ip)
+ return limiter.getClientIP(req, limiter.trustProxy)
+ }
+
+ ip := getIP(clientIP)
- // Should be allowed again after refill
- if !limiter.allow(clientIP) {
- t.Error("Request after refill should be allowed")
+ // Use up the tokens
+ if !limiter.allow(ip) {
+ t.Error("First request should be allowed")
+ }
+ if !limiter.allow(ip) {
+ t.Error("Second request should be allowed")
+ }
+ if limiter.allow(ip) {
+ t.Error("Third request should be blocked")
+ }
+
+ // Wait for refill
+ time.Sleep(150 * time.Millisecond)
+
+ // Should be allowed again after refill
+ if !limiter.allow(ip) {
+ t.Error("Request after refill should be allowed")
+ }
+ })
}
}
func TestSimpleRateLimiterConcurrent(t *testing.T) {
- limiter := newSimpleRateLimiter(10, time.Second)
- clientIP := "192.168.1.1"
+ type testCase struct {
+ name string
+ trustProxy bool
+ setupReq func(*http.Request, string)
+ }
- var allowed int32
- done := make(chan bool)
+ tests := []testCase{
+ {
+ name: "DirectConnection",
+ trustProxy: false,
+ setupReq: func(r *http.Request, ip string) { r.RemoteAddr = ip + ":1234" },
+ },
+ {
+ name: "ProxyXRealIP",
+ trustProxy: true,
+ setupReq: func(r *http.Request, ip string) {
+ r.RemoteAddr = proxyRemoteAddr // Proxy IP
+ r.Header.Set("X-Real-IP", ip)
+ },
+ },
+ }
- // Spawn multiple goroutines trying to access the limiter
- for i := 0; i < 20; i++ {
- go func() {
- if limiter.allow(clientIP) {
- atomic.AddInt32(&allowed, 1)
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ limiter := newSimpleRateLimiter(10, time.Second, tc.trustProxy)
+ t.Cleanup(func() { limiter.Stop() })
+ clientIP := "192.168.1.1"
+
+ // Helper to get IP
+ getIP := func(ip string) string {
+ req := httptest.NewRequest("GET", "/", nil)
+ tc.setupReq(req, ip)
+ return limiter.getClientIP(req, limiter.trustProxy)
}
- done <- true
- }()
- }
- // Wait for all goroutines
- for i := 0; i < 20; i++ {
- <-done
- }
+ ip := getIP(clientIP)
- // Should allow exactly 10 requests
- allowedCount := atomic.LoadInt32(&allowed)
- if allowedCount != 10 {
- t.Errorf("Expected 10 allowed requests, got %d", allowedCount)
+ var allowed int32
+ done := make(chan bool)
+
+ // Spawn multiple goroutines trying to access the limiter
+ for i := 0; i < 20; i++ {
+ go func() {
+ if limiter.allow(ip) {
+ atomic.AddInt32(&allowed, 1)
+ }
+ done <- true
+ }()
+ }
+
+ // Wait for all goroutines
+ for i := 0; i < 20; i++ {
+ <-done
+ }
+
+ // Should allow exactly 10 requests
+ allowedCount := atomic.LoadInt32(&allowed)
+ if allowedCount != 10 {
+ t.Errorf("Expected 10 allowed requests, got %d", allowedCount)
+ }
+ })
}
}
func TestSimpleRateLimiterCleanup(t *testing.T) {
- // Create a rate limiter with a short window
- limiter := newSimpleRateLimiter(5, 100*time.Millisecond)
- defer limiter.Stop()
+ type testCase struct {
+ name string
+ trustProxy bool
+ setupReq func(*http.Request, string)
+ }
- // Add entries for multiple IPs
- ips := []string{"192.168.1.1", "192.168.1.2", "192.168.1.3", "192.168.1.4", "192.168.1.5"}
- for _, ip := range ips {
- limiter.allow(ip)
+ tests := []testCase{
+ {
+ name: "DirectConnection",
+ trustProxy: false,
+ setupReq: func(r *http.Request, ip string) { r.RemoteAddr = ip + ":1234" },
+ },
+ {
+ name: "ProxyXRealIP",
+ trustProxy: true,
+ setupReq: func(r *http.Request, ip string) {
+ r.RemoteAddr = proxyRemoteAddr // Proxy IP
+ r.Header.Set("X-Real-IP", ip)
+ },
+ },
}
- // Verify entries exist
- limiter.mu.Lock()
- initialCount := len(limiter.limiters)
- limiter.mu.Unlock()
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ // Create a rate limiter with a short window
+ limiter := newSimpleRateLimiter(5, 100*time.Millisecond, tc.trustProxy)
+ defer limiter.Stop()
+
+ // Helper to get IP
+ getIP := func(ip string) string {
+ req := httptest.NewRequest("GET", "/", nil)
+ tc.setupReq(req, ip)
+ return limiter.getClientIP(req, limiter.trustProxy)
+ }
- if initialCount != len(ips) {
- t.Errorf("Expected %d entries, got %d", len(ips), initialCount)
- }
+ // Add entries for multiple IPs
+ ips := []string{"192.168.1.1", "192.168.1.2", "192.168.1.3", "192.168.1.4", "192.168.1.5"}
+ for _, ip := range ips {
+ limiter.allow(getIP(ip))
+ }
- // Wait for stale threshold (2x window = 200ms + buffer)
- time.Sleep(250 * time.Millisecond)
+ // Verify entries exist
+ limiter.mu.Lock()
+ initialCount := len(limiter.limiters)
+ limiter.mu.Unlock()
- // Trigger cleanup manually
- limiter.cleanup()
+ if initialCount != len(ips) {
+ t.Errorf("Expected %d entries, got %d", len(ips), initialCount)
+ }
- // Verify stale entries are removed
- limiter.mu.Lock()
- finalCount := len(limiter.limiters)
- limiter.mu.Unlock()
+ // Wait for stale threshold (2x window = 200ms + buffer)
+ time.Sleep(250 * time.Millisecond)
- if finalCount != 0 {
- t.Errorf("Expected 0 entries after cleanup, got %d", finalCount)
+ // Trigger cleanup manually
+ limiter.cleanup()
+
+ // Verify stale entries are removed
+ limiter.mu.Lock()
+ finalCount := len(limiter.limiters)
+ limiter.mu.Unlock()
+
+ if finalCount != 0 {
+ t.Errorf("Expected 0 entries after cleanup, got %d", finalCount)
+ }
+ })
}
}
func TestSimpleRateLimiterCleanupPreservesActive(t *testing.T) {
- limiter := newSimpleRateLimiter(5, 100*time.Millisecond)
- defer limiter.Stop()
+ type testCase struct {
+ name string
+ trustProxy bool
+ setupReq func(*http.Request, string)
+ }
- activeIP := "192.168.1.1"
- staleIP := "192.168.1.2"
+ tests := []testCase{
+ {
+ name: "DirectConnection",
+ trustProxy: false,
+ setupReq: func(r *http.Request, ip string) { r.RemoteAddr = ip + ":1234" },
+ },
+ {
+ name: "ProxyXRealIP",
+ trustProxy: true,
+ setupReq: func(r *http.Request, ip string) {
+ r.RemoteAddr = proxyRemoteAddr // Proxy IP
+ r.Header.Set("X-Real-IP", ip)
+ },
+ },
+ }
- // Create a stale entry
- limiter.allow(staleIP)
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ limiter := newSimpleRateLimiter(5, 100*time.Millisecond, tc.trustProxy)
+ defer limiter.Stop()
- // Wait for it to become stale
- time.Sleep(250 * time.Millisecond)
+ // Helper to get IP
+ getIP := func(ip string) string {
+ req := httptest.NewRequest("GET", "/", nil)
+ tc.setupReq(req, ip)
+ return limiter.getClientIP(req, limiter.trustProxy)
+ }
- // Create an active entry
- limiter.allow(activeIP)
+ activeIP := "192.168.1.1"
+ staleIP := "192.168.1.2"
- // Trigger cleanup
- limiter.cleanup()
+ // Create a stale entry
+ limiter.allow(getIP(staleIP))
- // Verify active entry is preserved and stale is removed
- limiter.mu.Lock()
- defer limiter.mu.Unlock()
+ // Wait for it to become stale
+ time.Sleep(250 * time.Millisecond)
- if _, exists := limiter.limiters[activeIP]; !exists {
- t.Error("Active entry should be preserved")
- }
+ // Create an active entry
+ limiter.allow(getIP(activeIP))
- if _, exists := limiter.limiters[staleIP]; exists {
- t.Error("Stale entry should be removed")
+ // Trigger cleanup
+ limiter.cleanup()
+
+ // Verify active entry is preserved and stale is removed
+ limiter.mu.Lock()
+ defer limiter.mu.Unlock()
+
+ // Check using the resolved IP keys
+ activeKey := getIP(activeIP)
+ staleKey := getIP(staleIP)
+
+ if _, exists := limiter.limiters[activeKey]; !exists {
+ t.Error("Active entry should be preserved")
+ }
+
+ if _, exists := limiter.limiters[staleKey]; exists {
+ t.Error("Stale entry should be removed")
+ }
+ })
}
}
func TestSimpleRateLimiterStop(t *testing.T) {
- limiter := newSimpleRateLimiter(5, time.Second)
+ limiter := newSimpleRateLimiter(5, time.Second, false)
// Stop the limiter
limiter.Stop()
diff --git a/backend/go.mod b/backend/go.mod
index 56c72c14..6e1cf8bb 100644
--- a/backend/go.mod
+++ b/backend/go.mod
@@ -1,6 +1,6 @@
module github.com/sysadminsmedia/homebox/backend
-go 1.25.0
+go 1.26.0
require (
entgo.io/ent v0.14.5
@@ -19,13 +19,12 @@ require (
github.com/google/uuid v1.6.0
github.com/gorilla/schema v1.4.1
github.com/hay-kot/httpkit v0.0.11
- github.com/lib/pq v1.11.2
- github.com/mattn/go-sqlite3 v1.14.34
+ github.com/jackc/pgx/v5 v5.8.0
github.com/olahol/melody v1.4.0
github.com/pkg/errors v0.9.1
github.com/pressly/goose/v3 v3.27.0
github.com/rs/zerolog v1.34.0
- github.com/samber/lo v1.52.0
+ github.com/samber/lo v1.53.0
github.com/shirou/gopsutil/v4 v4.26.2
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/stretchr/testify v1.11.1
@@ -41,7 +40,7 @@ require (
gocloud.dev/pubsub/rabbitpubsub v0.45.0
golang.org/x/crypto v0.48.0
golang.org/x/image v0.36.0
- golang.org/x/oauth2 v0.35.0
+ golang.org/x/oauth2 v0.36.0
golang.org/x/text v0.34.0
modernc.org/sqlite v1.46.1
)
@@ -116,27 +115,30 @@ require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
- github.com/go-openapi/jsonpointer v0.22.4 // indirect
- github.com/go-openapi/jsonreference v0.21.4 // indirect
- github.com/go-openapi/spec v0.22.3 // indirect
- github.com/go-openapi/swag/conv v0.25.4 // indirect
- github.com/go-openapi/swag/jsonname v0.25.4 // indirect
- github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
- github.com/go-openapi/swag/loading v0.25.4 // indirect
- github.com/go-openapi/swag/stringutils v0.25.4 // indirect
- github.com/go-openapi/swag/typeutils v0.25.4 // indirect
- github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
+ github.com/go-openapi/jsonpointer v0.22.5 // indirect
+ github.com/go-openapi/jsonreference v0.21.5 // indirect
+ github.com/go-openapi/spec v0.22.4 // indirect
+ github.com/go-openapi/swag/conv v0.25.5 // indirect
+ github.com/go-openapi/swag/jsonname v0.25.5 // indirect
+ github.com/go-openapi/swag/jsonutils v0.25.5 // indirect
+ github.com/go-openapi/swag/loading v0.25.5 // indirect
+ github.com/go-openapi/swag/stringutils v0.25.5 // indirect
+ github.com/go-openapi/swag/typeutils v0.25.5 // indirect
+ github.com/go-openapi/swag/yamlutils v0.25.5 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/s2a-go v0.1.9 // indirect
github.com/google/wire v0.7.0 // indirect
- github.com/googleapis/enterprise-certificate-proxy v0.3.12 // indirect
- github.com/googleapis/gax-go/v2 v2.17.0 // indirect
+ github.com/googleapis/enterprise-certificate-proxy v0.3.14 // indirect
+ github.com/googleapis/gax-go/v2 v2.18.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/hcl/v2 v2.18.1 // indirect
+ github.com/jackc/pgpassfile v1.0.0 // indirect
+ github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
+ github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.7.6 // indirect
@@ -149,6 +151,7 @@ require (
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
+ github.com/mattn/go-sqlite3 v1.14.34 // indirect
github.com/mfridman/interpolate v0.0.2 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/nats-io/nats.go v1.49.0 // indirect
@@ -156,7 +159,7 @@ require (
github.com/nats-io/nuid v1.0.1 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/philhofer/fwd v1.2.0 // indirect
- github.com/pierrec/lz4/v4 v4.1.25 // indirect
+ github.com/pierrec/lz4/v4 v4.1.26 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
@@ -179,28 +182,28 @@ require (
go.opentelemetry.io/contrib/detectors/gcp v1.39.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 // indirect
- go.opentelemetry.io/otel v1.40.0 // indirect
- go.opentelemetry.io/otel/metric v1.40.0 // indirect
- go.opentelemetry.io/otel/sdk v1.40.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.40.0 // indirect
- go.opentelemetry.io/otel/trace v1.40.0 // indirect
+ go.opentelemetry.io/otel v1.42.0 // indirect
+ go.opentelemetry.io/otel/metric v1.42.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.42.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.42.0 // indirect
+ go.opentelemetry.io/otel/trace v1.42.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/mod v0.33.0 // indirect
golang.org/x/net v0.51.0 // indirect
- golang.org/x/sync v0.19.0 // indirect
- golang.org/x/sys v0.41.0 // indirect
- golang.org/x/time v0.14.0 // indirect
+ golang.org/x/sync v0.20.0 // indirect
+ golang.org/x/sys v0.42.0 // indirect
+ golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.42.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
- google.golang.org/api v0.269.0 // indirect
- google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect
+ google.golang.org/api v0.271.0 // indirect
+ google.golang.org/genproto v0.0.0-20260217215200-42d3e9bedb6d // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20260217215200-42d3e9bedb6d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
- google.golang.org/grpc v1.79.1 // indirect
+ google.golang.org/grpc v1.79.2 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- modernc.org/libc v1.69.0 // indirect
+ modernc.org/libc v1.70.0 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
)
diff --git a/backend/go.sum b/backend/go.sum
index ed10a866..9708f244 100644
--- a/backend/go.sum
+++ b/backend/go.sum
@@ -12,8 +12,8 @@ cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdB
cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10=
cloud.google.com/go/iam v1.5.3 h1:+vMINPiDF2ognBJ97ABAYYwRgsaqxPbQDlMnbHMjolc=
cloud.google.com/go/iam v1.5.3/go.mod h1:MR3v9oLkZCTlaqljW6Eb2d3HGDGK5/bDv93jhfISFvU=
-cloud.google.com/go/logging v1.13.1 h1:O7LvmO0kGLaHY/gq8cV7T0dyp6zJhYAOtZPX4TF3QtY=
-cloud.google.com/go/logging v1.13.1/go.mod h1:XAQkfkMBxQRjQek96WLPNze7vsOmay9H5PqfsNYDqvw=
+cloud.google.com/go/logging v1.13.2 h1:qqlHCBvieJT9Cdq4QqYx1KPadCQ2noD4FK02eNqHAjA=
+cloud.google.com/go/logging v1.13.2/go.mod h1:zaybliM3yun1J8mU2dVQ1/qDzjbOqEijZCn6hSBtKak=
cloud.google.com/go/longrunning v0.8.0 h1:LiKK77J3bx5gDLi4SMViHixjD2ohlkwBi+mKA7EhfW8=
cloud.google.com/go/longrunning v0.8.0/go.mod h1:UmErU2Onzi+fKDg2gR7dusz11Pe26aknR4kHmJJqIfk=
cloud.google.com/go/monitoring v1.24.3 h1:dde+gMNc0UhPZD1Azu6at2e79bfdztVDS5lvhOdsgaE=
@@ -195,33 +195,33 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
-github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4=
-github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80=
-github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8=
-github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4=
-github.com/go-openapi/spec v0.22.3 h1:qRSmj6Smz2rEBxMnLRBMeBWxbbOvuOoElvSvObIgwQc=
-github.com/go-openapi/spec v0.22.3/go.mod h1:iIImLODL2loCh3Vnox8TY2YWYJZjMAKYyLH2Mu8lOZs=
+github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA=
+github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0=
+github.com/go-openapi/jsonreference v0.21.5 h1:6uCGVXU/aNF13AQNggxfysJ+5ZcU4nEAe+pJyVWRdiE=
+github.com/go-openapi/jsonreference v0.21.5/go.mod h1:u25Bw85sX4E2jzFodh1FOKMTZLcfifd1Q+iKKOUxExw=
+github.com/go-openapi/spec v0.22.4 h1:4pxGjipMKu0FzFiu/DPwN3CTBRlVM2yLf/YTWorYfDQ=
+github.com/go-openapi/spec v0.22.4/go.mod h1:WQ6Ai0VPWMZgMT4XySjlRIE6GP1bGQOtEThn3gcWLtQ=
github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM=
-github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4=
-github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU=
-github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI=
-github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag=
-github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA=
-github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY=
-github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo=
-github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM=
-github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s=
-github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE=
-github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8=
-github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0=
-github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw=
-github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE=
-github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw=
-github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc=
-github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4=
-github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg=
-github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls=
-github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54=
+github.com/go-openapi/swag/conv v0.25.5 h1:wAXBYEXJjoKwE5+vc9YHhpQOFj2JYBMF2DUi+tGu97g=
+github.com/go-openapi/swag/conv v0.25.5/go.mod h1:CuJ1eWvh1c4ORKx7unQnFGyvBbNlRKbnRyAvDvzWA4k=
+github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo=
+github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU=
+github.com/go-openapi/swag/jsonutils v0.25.5 h1:XUZF8awQr75MXeC+/iaw5usY/iM7nXPDwdG3Jbl9vYo=
+github.com/go-openapi/swag/jsonutils v0.25.5/go.mod h1:48FXUaz8YsDAA9s5AnaUvAmry1UcLcNVWUjY42XkrN4=
+github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5 h1:SX6sE4FrGb4sEnnxbFL/25yZBb5Hcg1inLeErd86Y1U=
+github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5/go.mod h1:/2KvOTrKWjVA5Xli3DZWdMCZDzz3uV/T7bXwrKWPquo=
+github.com/go-openapi/swag/loading v0.25.5 h1:odQ/umlIZ1ZVRteI6ckSrvP6e2w9UTF5qgNdemJHjuU=
+github.com/go-openapi/swag/loading v0.25.5/go.mod h1:I8A8RaaQ4DApxhPSWLNYWh9NvmX2YKMoB9nwvv6oW6g=
+github.com/go-openapi/swag/stringutils v0.25.5 h1:NVkoDOA8YBgtAR/zvCx5rhJKtZF3IzXcDdwOsYzrB6M=
+github.com/go-openapi/swag/stringutils v0.25.5/go.mod h1:PKK8EZdu4QJq8iezt17HM8RXnLAzY7gW0O1KKarrZII=
+github.com/go-openapi/swag/typeutils v0.25.5 h1:EFJ+PCga2HfHGdo8s8VJXEVbeXRCYwzzr9u4rJk7L7E=
+github.com/go-openapi/swag/typeutils v0.25.5/go.mod h1:itmFmScAYE1bSD8C4rS0W+0InZUBrB2xSPbWt6DLGuc=
+github.com/go-openapi/swag/yamlutils v0.25.5 h1:kASCIS+oIeoc55j28T4o8KwlV2S4ZLPT6G0iq2SSbVQ=
+github.com/go-openapi/swag/yamlutils v0.25.5/go.mod h1:Gek1/SjjfbYvM+Iq4QGwa/2lEXde9n2j4a3wI3pNuOQ=
+github.com/go-openapi/testify/enable/yaml/v2 v2.4.0 h1:7SgOMTvJkM8yWrQlU8Jm18VeDPuAvB/xWrdxFJkoFag=
+github.com/go-openapi/testify/enable/yaml/v2 v2.4.0/go.mod h1:14iV8jyyQlinc9StD7w1xVPW3CO3q1Gj04Jy//Kw4VM=
+github.com/go-openapi/testify/v2 v2.4.0 h1:8nsPrHVCWkQ4p8h1EsRVymA2XABB4OT40gcvAu+voFM=
+github.com/go-openapi/testify/v2 v2.4.0/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
@@ -265,10 +265,10 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/wire v0.7.0 h1:JxUKI6+CVBgCO2WToKy/nQk0sS+amI9z9EjVmdaocj4=
github.com/google/wire v0.7.0/go.mod h1:n6YbUQD9cPKTnHXEBN2DXlOp/mVADhVErcMFb0v3J18=
-github.com/googleapis/enterprise-certificate-proxy v0.3.12 h1:Fg+zsqzYEs1ZnvmcztTYxhgCBsx3eEhEwQ1W/lHq/sQ=
-github.com/googleapis/enterprise-certificate-proxy v0.3.12/go.mod h1:vqVt9yG9480NtzREnTlmGSBmFrA+bzb0yl0TxoBQXOg=
-github.com/googleapis/gax-go/v2 v2.17.0 h1:RksgfBpxqff0EZkDWYuz9q/uWsTVz+kf43LsZ1J6SMc=
-github.com/googleapis/gax-go/v2 v2.17.0/go.mod h1:mzaqghpQp4JDh3HvADwrat+6M3MOIDp5YKHhb9PAgDY=
+github.com/googleapis/enterprise-certificate-proxy v0.3.14 h1:yh8ncqsbUY4shRD5dA6RlzjJaT4hi3kII+zYw8wmLb8=
+github.com/googleapis/enterprise-certificate-proxy v0.3.14/go.mod h1:vqVt9yG9480NtzREnTlmGSBmFrA+bzb0yl0TxoBQXOg=
+github.com/googleapis/gax-go/v2 v2.18.0 h1:jxP5Uuo3bxm3M6gGtV94P4lliVetoCB4Wk2x8QA86LI=
+github.com/googleapis/gax-go/v2 v2.18.0/go.mod h1:uSzZN4a356eRG985CzJ3WfbFSpqkLTjsnhWGJR6EwrE=
github.com/gorilla/schema v1.4.1 h1:jUg5hUjCSDZpNGLuXQOgIWGdlgrIdYvgQ0wZtdK1M3E=
github.com/gorilla/schema v1.4.1/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM=
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
@@ -284,6 +284,14 @@ github.com/hashicorp/hcl/v2 v2.18.1 h1:6nxnOJFku1EuSawSD81fuviYUV8DxFr3fp2dUi3ZY
github.com/hashicorp/hcl/v2 v2.18.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE=
github.com/hay-kot/httpkit v0.0.11 h1:ZdB2uqsFBSDpfUoClGK5c5orjBjQkEVSXh7fZX5FKEk=
github.com/hay-kot/httpkit v0.0.11/go.mod h1:0kZdk5/swzdfqfg2c6pBWimcgeJ9PTyO97EbHnYl2Sw=
+github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
+github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
+github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
+github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
+github.com/jackc/pgx/v5 v5.8.0 h1:TYPDoleBBme0xGSAX3/+NujXXtpZn9HBONkQC7IEZSo=
+github.com/jackc/pgx/v5 v5.8.0/go.mod h1:QVeDInX2m9VyzvNeiCJVjCkNFqzsNb43204HshNSZKw=
+github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
+github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jarcoal/httpmock v1.3.0 h1:2RJ8GP0IIaWwcC9Fp2BmVi8Kog3v2Hn7VXM3fTd+nuc=
github.com/jarcoal/httpmock v1.3.0/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg=
github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
@@ -314,8 +322,6 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
-github.com/lib/pq v1.11.2 h1:x6gxUeu39V0BHZiugWe8LXZYZ+Utk7hSJGThs8sdzfs=
-github.com/lib/pq v1.11.2/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
@@ -353,8 +359,8 @@ github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
github.com/philhofer/fwd v1.2.0 h1:e6DnBTl7vGY+Gz322/ASL4Gyp1FspeMvx1RNDoToZuM=
github.com/philhofer/fwd v1.2.0/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM=
-github.com/pierrec/lz4/v4 v4.1.25 h1:kocOqRffaIbU5djlIBr7Wh+cx82C0vtFb0fOurZHqD0=
-github.com/pierrec/lz4/v4 v4.1.25/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4=
+github.com/pierrec/lz4/v4 v4.1.26 h1:GrpZw1gZttORinvzBdXPUXATeqlJjqUG/D87TKMnhjY=
+github.com/pierrec/lz4/v4 v4.1.26/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -379,8 +385,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
-github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw=
-github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
+github.com/samber/lo v1.53.0 h1:t975lj2py4kJPQ6haz1QMgtId2gtmfktACxIXArw3HM=
+github.com/samber/lo v1.53.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE=
@@ -397,6 +403,7 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
@@ -445,18 +452,18 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 h1:7iP2uCb7sGddAr30RRS6xjKy7AZ2JtTOPA3oolgVSw8=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0/go.mod h1:c7hN3ddxs/z6q9xwvfLPk+UHlWRQyaeR1LdgfL/66l0=
-go.opentelemetry.io/otel v1.40.0 h1:oA5YeOcpRTXq6NN7frwmwFR0Cn3RhTVZvXsP4duvCms=
-go.opentelemetry.io/otel v1.40.0/go.mod h1:IMb+uXZUKkMXdPddhwAHm6UfOwJyh4ct1ybIlV14J0g=
+go.opentelemetry.io/otel v1.42.0 h1:lSQGzTgVR3+sgJDAU/7/ZMjN9Z+vUip7leaqBKy4sho=
+go.opentelemetry.io/otel v1.42.0/go.mod h1:lJNsdRMxCUIWuMlVJWzecSMuNjE7dOYyWlqOXWkdqCc=
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.37.0 h1:6VjV6Et+1Hd2iLZEPtdV7vie80Yyqf7oikJLjQ/myi0=
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.37.0/go.mod h1:u8hcp8ji5gaM/RfcOo8z9NMnf1pVLfVY7lBY2VOGuUU=
-go.opentelemetry.io/otel/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g=
-go.opentelemetry.io/otel/metric v1.40.0/go.mod h1:ib/crwQH7N3r5kfiBZQbwrTge743UDc7DTFVZrrXnqc=
-go.opentelemetry.io/otel/sdk v1.40.0 h1:KHW/jUzgo6wsPh9At46+h4upjtccTmuZCFAc9OJ71f8=
-go.opentelemetry.io/otel/sdk v1.40.0/go.mod h1:Ph7EFdYvxq72Y8Li9q8KebuYUr2KoeyHx0DRMKrYBUE=
-go.opentelemetry.io/otel/sdk/metric v1.40.0 h1:mtmdVqgQkeRxHgRv4qhyJduP3fYJRMX4AtAlbuWdCYw=
-go.opentelemetry.io/otel/sdk/metric v1.40.0/go.mod h1:4Z2bGMf0KSK3uRjlczMOeMhKU2rhUqdWNoKcYrtcBPg=
-go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZYblVjw=
-go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA=
+go.opentelemetry.io/otel/metric v1.42.0 h1:2jXG+3oZLNXEPfNmnpxKDeZsFI5o4J+nz6xUlaFdF/4=
+go.opentelemetry.io/otel/metric v1.42.0/go.mod h1:RlUN/7vTU7Ao/diDkEpQpnz3/92J9ko05BIwxYa2SSI=
+go.opentelemetry.io/otel/sdk v1.42.0 h1:LyC8+jqk6UJwdrI/8VydAq/hvkFKNHZVIWuslJXYsDo=
+go.opentelemetry.io/otel/sdk v1.42.0/go.mod h1:rGHCAxd9DAph0joO4W6OPwxjNTYWghRWmkHuGbayMts=
+go.opentelemetry.io/otel/sdk/metric v1.42.0 h1:D/1QR46Clz6ajyZ3G8SgNlTJKBdGp84q9RKCAZ3YGuA=
+go.opentelemetry.io/otel/sdk/metric v1.42.0/go.mod h1:Ua6AAlDKdZ7tdvaQKfSmnFTdHx37+J4ba8MwVCYM5hc=
+go.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4LenLmOYY=
+go.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
@@ -491,12 +498,12 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo=
golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y=
-golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ=
-golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
+golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
+golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
-golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
+golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
+golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -510,8 +517,8 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
-golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
+golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
+golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@@ -521,8 +528,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
-golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
-golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
+golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
+golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
@@ -534,16 +541,16 @@ golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhS
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
-google.golang.org/api v0.269.0 h1:qDrTOxKUQ/P0MveH6a7vZ+DNHxJQjtGm/uvdbdGXCQg=
-google.golang.org/api v0.269.0/go.mod h1:N8Wpcu23Tlccl0zSHEkcAZQKDLdquxK+l9r2LkwAauE=
-google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 h1:VQZ/yAbAtjkHgH80teYd2em3xtIkkHd7ZhqfH2N9CsM=
-google.golang.org/genproto v0.0.0-20260128011058-8636f8732409/go.mod h1:rxKD3IEILWEu3P44seeNOAwZN4SaoKaQ/2eTg4mM6EM=
-google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 h1:merA0rdPeUV3YIIfHHcH4qBkiQAc1nfCKSI7lB4cV2M=
-google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409/go.mod h1:fl8J1IvUjCilwZzQowmw2b7HQB2eAuYBabMXzWurF+I=
+google.golang.org/api v0.271.0 h1:cIPN4qcUc61jlh7oXu6pwOQqbJW2GqYh5PS6rB2C/JY=
+google.golang.org/api v0.271.0/go.mod h1:CGT29bhwkbF+i11qkRUJb2KMKqcJ1hdFceEIRd9u64Q=
+google.golang.org/genproto v0.0.0-20260217215200-42d3e9bedb6d h1:vsOm753cOAMkt76efriTCDKjpCbK18XGHMJHo0JUKhc=
+google.golang.org/genproto v0.0.0-20260217215200-42d3e9bedb6d/go.mod h1:0oz9d7g9QLSdv9/lgbIjowW1JoxMbxmBVNe8i6tORJI=
+google.golang.org/genproto/googleapis/api v0.0.0-20260217215200-42d3e9bedb6d h1:EocjzKLywydp5uZ5tJ79iP6Q0UjDnyiHkGRWxuPBP8s=
+google.golang.org/genproto/googleapis/api v0.0.0-20260217215200-42d3e9bedb6d/go.mod h1:48U2I+QQUYhsFrg2SY6r+nJzeOtjey7j//WBESw+qyQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 h1:ggcbiqK8WWh6l1dnltU4BgWGIGo+EVYxCaAPih/zQXQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
-google.golang.org/grpc v1.79.1 h1:zGhSi45ODB9/p3VAawt9a+O/MULLl9dpizzNNpq7flY=
-google.golang.org/grpc v1.79.1/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
+google.golang.org/grpc v1.79.2 h1:fRMD94s2tITpyJGtBBn7MkMseNpOZU8ZxgC3MMBaXRU=
+google.golang.org/grpc v1.79.2/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -555,8 +562,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/cc/v4 v4.27.1 h1:9W30zRlYrefrDV2JE2O8VDtJ1yPGownxciz5rrbQZis=
modernc.org/cc/v4 v4.27.1/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
-modernc.org/ccgo/v4 v4.31.0 h1:/bsaxqdgX3gy/0DboxcvWrc3NpzH+6wpFfI/ZaA/hrg=
-modernc.org/ccgo/v4 v4.31.0/go.mod h1:jKe8kPBjIN/VdGTVqARTQ8N1gAziBmiISY8j5HoKwjg=
+modernc.org/ccgo/v4 v4.32.0 h1:hjG66bI/kqIPX1b2yT6fr/jt+QedtP2fqojG2VrFuVw=
+modernc.org/ccgo/v4 v4.32.0/go.mod h1:6F08EBCx5uQc38kMGl+0Nm0oWczoo1c7cgpzEry7Uc0=
modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM=
modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU=
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
@@ -565,8 +572,8 @@ modernc.org/gc/v3 v3.1.2 h1:ZtDCnhonXSZexk/AYsegNRV1lJGgaNZJuKjJSWKyEqo=
modernc.org/gc/v3 v3.1.2/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
-modernc.org/libc v1.69.0 h1:YQJ5QMSReTgQ3QFmI0dudfjXIjCcYTUxcH8/9P9f0D8=
-modernc.org/libc v1.69.0/go.mod h1:YfLLduUEbodNV2xLU5JOnRHBTAHVHsVW3bVYGw0ZCV4=
+modernc.org/libc v1.70.0 h1:U58NawXqXbgpZ/dcdS9kMshu08aiA6b7gusEusqzNkw=
+modernc.org/libc v1.70.0/go.mod h1:OVmxFGP1CI/Z4L3E0Q3Mf1PDE0BucwMkcXjjLntvHJo=
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
diff --git a/backend/internal/core/services/main_test.go b/backend/internal/core/services/main_test.go
index 56dafb99..68e4f577 100644
--- a/backend/internal/core/services/main_test.go
+++ b/backend/internal/core/services/main_test.go
@@ -9,11 +9,11 @@ import (
"github.com/google/uuid"
"github.com/sysadminsmedia/homebox/backend/internal/sys/config"
- _ "github.com/mattn/go-sqlite3"
"github.com/sysadminsmedia/homebox/backend/internal/core/currencies"
"github.com/sysadminsmedia/homebox/backend/internal/core/services/reporting/eventbus"
"github.com/sysadminsmedia/homebox/backend/internal/data/ent"
"github.com/sysadminsmedia/homebox/backend/internal/data/repo"
+ _ "github.com/sysadminsmedia/homebox/backend/pkgs/cgofreesqlite"
"github.com/sysadminsmedia/homebox/backend/pkgs/faker"
)
@@ -40,11 +40,10 @@ func bootstrap() {
log.Fatal(err)
}
- password := fk.Str(10)
tUser, err = tRepos.Users.Create(ctx, repo.UserCreate{
Name: fk.Str(10),
Email: fk.Email(),
- Password: &password,
+ Password: new(fk.Str(10)),
IsSuperuser: fk.Bool(),
DefaultGroupID: tGroup.ID,
})
diff --git a/backend/internal/core/services/reporting/bill_of_materials.go b/backend/internal/core/services/reporting/bill_of_materials.go
index 8f1b6c67..b5b6eb08 100644
--- a/backend/internal/core/services/reporting/bill_of_materials.go
+++ b/backend/internal/core/services/reporting/bill_of_materials.go
@@ -24,7 +24,7 @@ type BillOfMaterialsEntry struct {
// BillOfMaterialsCSV returns a byte slice of the Bill of Materials for a given GID in CSV format
// See BillOfMaterialsEntry for the format of the output
func BillOfMaterialsCSV(entities []repo.ItemOut) ([]byte, error) {
- bomEntries := lo.Map(entities, func(entity repo.ItemOut, _ int) BillOfMaterialsEntry {
+ return gocsv.MarshalBytes(new(lo.Map(entities, func(entity repo.ItemOut, _ int) BillOfMaterialsEntry {
return BillOfMaterialsEntry{
PurchaseDate: entity.PurchaseTime,
Name: entity.Name,
@@ -36,7 +36,5 @@ func BillOfMaterialsCSV(entities []repo.ItemOut) ([]byte, error) {
Price: entity.PurchasePrice,
TotalPrice: entity.PurchasePrice * float64(entity.Quantity),
}
- })
-
- return gocsv.MarshalBytes(&bomEntries)
+ })))
}
diff --git a/backend/internal/core/services/service_items.go b/backend/internal/core/services/service_items.go
index bad49264..7b21638e 100644
--- a/backend/internal/core/services/service_items.go
+++ b/backend/internal/core/services/service_items.go
@@ -77,9 +77,7 @@ func (svc *ItemService) EnsureImportRef(ctx context.Context, gid uuid.UUID) (int
finished := 0
for _, itemID := range ids {
- ref := uuid.New().String()[0:8]
-
- err = svc.repo.Items.Patch(ctx, gid, itemID, repo.ItemPatch{ImportRef: &ref})
+ err = svc.repo.Items.Patch(ctx, gid, itemID, repo.ItemPatch{ImportRef: new(uuid.New().String()[0:8])})
if err != nil {
return 0, err
}
diff --git a/backend/internal/data/migrations/postgres/20250112202302_sync_children.go b/backend/internal/data/migrations/postgres/20250112202302_sync_children.go
index 592137be..eb04038d 100644
--- a/backend/internal/data/migrations/postgres/20250112202302_sync_children.go
+++ b/backend/internal/data/migrations/postgres/20250112202302_sync_children.go
@@ -13,13 +13,12 @@ func init() {
}
func Up20250112202302(ctx context.Context, tx *sql.Tx) error {
- columnName := "sync_child_items_locations"
query := `
SELECT column_name
FROM information_schema.columns
WHERE table_name = 'items' AND column_name = 'sync_child_items_locations';
`
- err := tx.QueryRowContext(ctx, query).Scan(&columnName)
+ err := tx.QueryRowContext(ctx, query).Scan(new("sync_child_items_locations"))
if err != nil {
// Column does not exist, proceed with migration
_, err = tx.ExecContext(ctx, `
diff --git a/backend/internal/data/migrations/sqlite3/20241226183416_sync_children.go b/backend/internal/data/migrations/sqlite3/20241226183416_sync_children.go
index 7ea34330..5414ef3c 100644
--- a/backend/internal/data/migrations/sqlite3/20241226183416_sync_children.go
+++ b/backend/internal/data/migrations/sqlite3/20241226183416_sync_children.go
@@ -14,13 +14,12 @@ func init() {
func Up20241226183416(ctx context.Context, tx *sql.Tx) error {
// Check if the 'sync_child_items_locations' column exists in the 'items' table
- columnName := "sync_child_items_locations"
query := `
SELECT name
FROM pragma_table_info('items')
WHERE name = 'sync_child_items_locations';
`
- err := tx.QueryRowContext(ctx, query).Scan(&columnName)
+ err := tx.QueryRowContext(ctx, query).Scan(new("sync_child_items_locations"))
if err != nil {
// Column does not exist, proceed with migration
_, err = tx.ExecContext(ctx, `
diff --git a/backend/internal/data/repo/main_test.go b/backend/internal/data/repo/main_test.go
index bf7d8bda..57c1ec84 100644
--- a/backend/internal/data/repo/main_test.go
+++ b/backend/internal/data/repo/main_test.go
@@ -2,15 +2,15 @@ package repo
import (
"context"
- "github.com/google/uuid"
- "github.com/sysadminsmedia/homebox/backend/internal/sys/config"
"log"
"os"
"testing"
- _ "github.com/mattn/go-sqlite3"
+ "github.com/google/uuid"
"github.com/sysadminsmedia/homebox/backend/internal/core/services/reporting/eventbus"
"github.com/sysadminsmedia/homebox/backend/internal/data/ent"
+ "github.com/sysadminsmedia/homebox/backend/internal/sys/config"
+ _ "github.com/sysadminsmedia/homebox/backend/pkgs/cgofreesqlite"
"github.com/sysadminsmedia/homebox/backend/pkgs/faker"
)
diff --git a/backend/internal/data/repo/repo_group_test.go b/backend/internal/data/repo/repo_group_test.go
index 644c39f3..6b8b8ee5 100644
--- a/backend/internal/data/repo/repo_group_test.go
+++ b/backend/internal/data/repo/repo_group_test.go
@@ -23,11 +23,10 @@ func Test_Group_Create(t *testing.T) {
func Test_Group_Create_WithUser(t *testing.T) {
// Create a test user first
- password := "password123"
user, err := tRepos.Users.Create(context.Background(), UserCreate{
Name: "test_user",
- Password: &password,
+ Password: new("password123"),
DefaultGroupID: tGroup.ID,
})
require.NoError(t, err)
diff --git a/backend/internal/data/repo/repo_item_templates.go b/backend/internal/data/repo/repo_item_templates.go
index 8fe4cbaa..3ad6e4ca 100644
--- a/backend/internal/data/repo/repo_item_templates.go
+++ b/backend/internal/data/repo/repo_item_templates.go
@@ -136,9 +136,8 @@ type (
)
func mapTemplateField(field *ent.TemplateField) TemplateField {
- id := field.ID
return TemplateField{
- ID: &id,
+ ID: new(field.ID),
Type: string(field.Type),
Name: field.Name,
TextValue: field.TextValue,
diff --git a/backend/internal/data/repo/repo_item_templates_test.go b/backend/internal/data/repo/repo_item_templates_test.go
index bc23896f..61359625 100644
--- a/backend/internal/data/repo/repo_item_templates_test.go
+++ b/backend/internal/data/repo/repo_item_templates_test.go
@@ -10,25 +10,18 @@ import (
)
func templateFactory() ItemTemplateCreate {
- qty := 1
- name := fk.Str(20)
- desc := fk.Str(50)
- mfr := fk.Str(15)
- model := fk.Str(10)
- warranty := ""
-
return ItemTemplateCreate{
Name: fk.Str(10),
Description: fk.Str(100),
Notes: fk.Str(50),
- DefaultQuantity: &qty,
+ DefaultQuantity: new(1),
DefaultInsured: false,
- DefaultName: &name,
- DefaultDescription: &desc,
- DefaultManufacturer: &mfr,
- DefaultModelNumber: &model,
+ DefaultName: new(fk.Str(20)),
+ DefaultDescription: new(fk.Str(50)),
+ DefaultManufacturer: new(fk.Str(15)),
+ DefaultModelNumber: new(fk.Str(10)),
DefaultLifetimeWarranty: false,
- DefaultWarrantyDetails: &warranty,
+ DefaultWarrantyDetails: new(""),
IncludeWarrantyFields: false,
IncludePurchaseFields: false,
IncludeSoldFields: false,
@@ -122,26 +115,19 @@ func TestItemTemplatesRepository_Update(t *testing.T) {
templates := useTemplates(t, 1)
template := templates[0]
- qty := 5
- defaultName := "Default Item Name"
- defaultDesc := "Default Item Description"
- defaultMfr := "Updated Manufacturer"
- defaultModel := "MODEL-123"
- defaultWarranty := "Lifetime coverage"
-
updateData := ItemTemplateUpdate{
ID: template.ID,
Name: "Updated Name",
Description: "Updated Description",
Notes: "Updated Notes",
- DefaultQuantity: &qty,
+ DefaultQuantity: new(5),
DefaultInsured: true,
- DefaultName: &defaultName,
- DefaultDescription: &defaultDesc,
- DefaultManufacturer: &defaultMfr,
- DefaultModelNumber: &defaultModel,
+ DefaultName: new("Default Item Name"),
+ DefaultDescription: new("Default Item Description"),
+ DefaultManufacturer: new("Updated Manufacturer"),
+ DefaultModelNumber: new("MODEL-123"),
DefaultLifetimeWarranty: true,
- DefaultWarrantyDetails: &defaultWarranty,
+ DefaultWarrantyDetails: new("Lifetime coverage"),
IncludeWarrantyFields: true,
IncludePurchaseFields: true,
IncludeSoldFields: false,
@@ -179,12 +165,11 @@ func TestItemTemplatesRepository_UpdateWithFields(t *testing.T) {
require.Len(t, template.Fields, 1)
// Update with new fields
- qty := template.DefaultQuantity
updateData := ItemTemplateUpdate{
ID: template.ID,
Name: template.Name,
Description: template.Description,
- DefaultQuantity: &qty,
+ DefaultQuantity: new(template.DefaultQuantity),
Fields: []TemplateField{
{ID: template.Fields[0].ID, Name: "Updated Field", Type: "text", TextValue: "Updated Value"},
{Name: "New Field", Type: "text", TextValue: "New Value"},
@@ -318,11 +303,10 @@ func TestItemTemplatesRepository_UpdateRemoveLocation(t *testing.T) {
require.NotNil(t, template.DefaultLocation)
// Update to remove location
- qty := template.DefaultQuantity
updateData := ItemTemplateUpdate{
ID: template.ID,
Name: template.Name,
- DefaultQuantity: &qty,
+ DefaultQuantity: new(template.DefaultQuantity),
DefaultLocationID: uuid.Nil, // Remove location
}
diff --git a/backend/internal/data/repo/repo_items.go b/backend/internal/data/repo/repo_items.go
index 178e481d..439ffa81 100644
--- a/backend/internal/data/repo/repo_items.go
+++ b/backend/internal/data/repo/repo_items.go
@@ -124,7 +124,7 @@ type (
ItemPatch struct {
ID uuid.UUID `json:"id"`
Quantity *int `json:"quantity,omitempty" extensions:"x-nullable,x-omitempty"`
- ImportRef *string `json:"-,omitempty" extensions:"x-nullable,x-omitempty"`
+ ImportRef *string `json:"-" extensions:"x-nullable,x-omitempty"`
LocationID uuid.UUID `json:"locationId" extensions:"x-nullable,x-omitempty"`
TagIDs []uuid.UUID `json:"tagIds" extensions:"x-nullable,x-omitempty"`
}
@@ -193,8 +193,7 @@ var mapItemsSummaryErr = mapTEachErrFunc(mapItemSummary)
func mapItemSummary(item *ent.Item) ItemSummary {
var location *LocationSummary
if item.Edges.Location != nil {
- loc := mapLocationSummary(item.Edges.Location)
- location = &loc
+ location = new(mapLocationSummary(item.Edges.Location))
}
tags := lo.Ternary(item.Edges.Tag != nil, mapEach(item.Edges.Tag, mapTagSummary), []TagSummary{})
@@ -267,8 +266,7 @@ func mapItemOut(item *ent.Item) ItemOut {
var parent *ItemSummary
if item.Edges.Parent != nil {
- v := mapItemSummary(item.Edges.Parent)
- parent = &v
+ parent = new(mapItemSummary(item.Edges.Parent))
}
return ItemOut{
diff --git a/backend/internal/data/repo/repo_locations.go b/backend/internal/data/repo/repo_locations.go
index a50ee651..0bfcb4f2 100644
--- a/backend/internal/data/repo/repo_locations.go
+++ b/backend/internal/data/repo/repo_locations.go
@@ -70,8 +70,7 @@ var mapLocationOutErr = mapTErrFunc(mapLocationOut)
func mapLocationOut(location *ent.Location) LocationOut {
var parent *LocationSummary
if location.Edges.Parent != nil {
- p := mapLocationSummary(location.Edges.Parent)
- parent = &p
+ parent = new(mapLocationSummary(location.Edges.Parent))
}
children := lo.Map(location.Edges.Children, func(c *ent.Location, _ int) LocationSummary {
diff --git a/backend/internal/data/repo/repo_tokens.go b/backend/internal/data/repo/repo_tokens.go
index 9b4c2466..5d3bba92 100644
--- a/backend/internal/data/repo/repo_tokens.go
+++ b/backend/internal/data/repo/repo_tokens.go
@@ -67,8 +67,7 @@ func (r *TokenRepository) GetRoles(ctx context.Context, token string) (*set.Set[
return role.Role.String()
})
- roleSet := set.New(roleStrings...)
- return &roleSet, nil
+ return new(set.New(roleStrings...)), nil
}
// CreateToken Creates a token for a user
diff --git a/backend/internal/data/repo/repo_users_test.go b/backend/internal/data/repo/repo_users_test.go
index 33ce67fa..94ffbc22 100644
--- a/backend/internal/data/repo/repo_users_test.go
+++ b/backend/internal/data/repo/repo_users_test.go
@@ -10,11 +10,10 @@ import (
)
func userFactory() UserCreate {
- password := fk.Str(10)
return UserCreate{
Name: fk.Str(10),
Email: fk.Email(),
- Password: &password,
+ Password: new(fk.Str(10)),
IsSuperuser: fk.Bool(),
DefaultGroupID: tGroup.ID,
}
diff --git a/backend/pkgs/labelmaker/labelmaker_test.go b/backend/pkgs/labelmaker/labelmaker_test.go
index 3ee3d73c..d8e05a96 100644
--- a/backend/pkgs/labelmaker/labelmaker_test.go
+++ b/backend/pkgs/labelmaker/labelmaker_test.go
@@ -53,10 +53,9 @@ func TestLoadFont_WithCustomFontPath(t *testing.T) {
}
func TestLoadFont_WithNonExistentFontPath(t *testing.T) {
- nonExistentPath := "/non/existent/path/font.ttf"
cfg := &config.Config{
LabelMaker: config.LabelMakerConf{
- RegularFontPath: &nonExistentPath,
+ RegularFontPath: new("/non/existent/path/font.ttf"),
},
}
@@ -92,10 +91,9 @@ func TestLoadFont_BoldFontWithCustomPath(t *testing.T) {
}
func TestLoadFont_EmptyStringPath(t *testing.T) {
- emptyPath := ""
cfg := &config.Config{
LabelMaker: config.LabelMakerConf{
- RegularFontPath: &emptyPath,
+ RegularFontPath: new(""),
},
}