A continuation of HomeBox the inventory and organization system built for the Home User
fix: some bugs
Matthew Kilgore717133fffd3b
diff --git a/SECURITY.md b/SECURITY.mdindex 58af1f43..c5416736 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -2,10 +2,58 @@## Supported Versions-Since this software is still considered beta/WIP support is always only given for the latest version.+Homebox is maintained by [Sysadmins Media](https://github.com/sysadminsmedia), who took over the+project at **v0.11.0** (June 2024). Everything released before that came from the original upstream+project and is not maintained here.++Security reports are accepted for:++| Version | Supported |+| ------- | --------- |+| The latest release | Yes |+| The `main` branch | Yes |+| Any other older release | No |+| Anything before `v0.11.0` | No — not our code |++**We only issue security advisories, CVEs, and reporter credit for issues that are present on the+latest release or on `main` at the time of the report.** Nothing else is eligible.++In practice this means:++- **Check `main` before you report.** A large number of reports we receive describe bugs that were+ already fixed, sometimes years earlier. If the code you are looking at does not exist on `main`+ anymore, there is nothing for us to fix and nothing to credit.+- **Reports against pre-`v0.11.0` versions are closed without assessment.** That code predates our+ stewardship. This includes `v0.10.x` and earlier. We will not issue an advisory or credit for+ them under any circumstances, even if the same bug once existed here.+- **Reports against an old-but-supported-era release are only eligible if the issue still reproduces+ on the latest release or `main`.** "I found this in v0.20.0" is not by itself a valid report if+ the current code is fine. Please state which version or commit you tested.+- **Running an outdated version is not a vulnerability.** If the fix is to upgrade, upgrade.++We are happy to receive good reports and we do credit researchers who follow this. We are not able+to spend maintainer time re-triaging historical code, and automated scans of old container images+are not useful to us.## Reporting a Vulnerability-Please open a normal public issue for minor security issues or general security inquires.+Please open a normal public issue for minor security issues or general security inquiries.++For major or critical security issues, please+[open a private GitHub security advisory](https://github.com/sysadminsmedia/homebox/security/advisories/new).++Please include:++- The **version or commit hash** you tested against, and confirmation that you checked it still+ reproduces on the latest release or `main`.+- Steps to reproduce, ideally as concrete requests or a short script.+- What an attacker gains, and any preconditions required (e.g. multiple groups, a reverse proxy, a+ cache in front of the app).-For major or critical security issues, please open a private github security issue.\ No newline at end of file+We do not take reports at face value, however they were produced. If you used an AI assistant or an+automated scanner, you are accountable for every claim in the report you send: reproduce the issue+yourself against the latest release or `main`, confirm the code you describe still exists there, and+strip anything you have not personally verified. Reports that read as unreviewed tool output —+invented file paths, line numbers, or function names, findings already fixed upstream, or generic+scanner output with no working proof of concept — are closed without assessment. Repeated+submissions of that kind will be treated as spam.diff --git a/backend/app/api/routes.go b/backend/app/api/routes.goindex 4d301459..6d8266a0 100644--- a/backend/app/api/routes.go+++ b/backend/app/api/routes.go@@ -7,6 +7,7 @@ import ("io""mime""net/http"+ "net/url""path""path/filepath"@@ -37,23 +38,38 @@ func (a *app) debugRouter() *http.ServeMux {return dbg}+// swaggerDocHandler serves the OpenAPI document, rewriting its `host` so the+// Swagger UI's "Base URL" reflects the instance actually being used rather than+// a value baked in at build time.+//+// That host is the target of every "Try it out" request the Swagger UI issues,+// Authorization header included, and this route is unauthenticated. Honoring a+// raw X-Forwarded-Host therefore let any unauthenticated client mint a spec+// pointing wherever they liked; behind a cache that does not key on that header,+// the poisoned document would then be served to operators. Defer to+// SecureBaseURL, which prefers the operator's configured hostname and accepts+// X-Forwarded-Host only under TrustProxy, and only after validation. The+// fallback is r.Host, which caches already key on.+func (a *app) swaggerDocHandler(w http.ResponseWriter, r *http.Request) {+ host := r.Host+ if trusted := v1.SecureBaseURL(r, &a.conf.Options); trusted != "" {+ if u, err := url.Parse(trusted); err == nil && u.Host != "" {+ host = u.Host+ }+ }++ spec := *docs.SwaggerInfo+ spec.Host = host+ doc := spec.ReadDoc()+ w.Header().Set("Content-Type", "application/json; charset=utf-8")+ _, _ = w.Write([]byte(doc))+}+// registerRoutes registers all the routes for the APIfunc (a *app) mountRoutes(r *chi.Mux, chain *errchain.ErrChain, repos *repo.AllRepos) {registerMimes()- // Serve doc.json dynamically so the Swagger UI "Base URL" reflects the- // actual host of the user's instance rather than a hardcoded value.- r.Get("/swagger/doc.json", func(w http.ResponseWriter, r *http.Request) {- host := r.Host- if fwdHost := r.Header.Get("X-Forwarded-Host"); fwdHost != "" {- host = fwdHost- }- spec := *docs.SwaggerInfo- spec.Host = host- doc := spec.ReadDoc()- w.Header().Set("Content-Type", "application/json; charset=utf-8")- _, _ = w.Write([]byte(doc))- })+ r.Get("/swagger/doc.json", a.swaggerDocHandler)r.Get("/swagger/*", httpSwagger.Handler(httpSwagger.URL("/swagger/doc.json"),diff --git a/backend/app/api/routes_swagger_host_test.go b/backend/app/api/routes_swagger_host_test.gonew file mode 100644index 00000000..5589c757--- /dev/null+++ b/backend/app/api/routes_swagger_host_test.go@@ -0,0 +1,90 @@+package main++import (+ "encoding/json"+ "net/http"+ "net/http/httptest"+ "testing"++ "github.com/sysadminsmedia/homebox/backend/internal/sys/config"+)++// TestSwaggerDocHostNotAttackerControlled guards the unauthenticated+// /swagger/doc.json route. The `host` it emits is the target of every "Try it+// out" request the Swagger UI issues, Authorization header included. Honoring a+// raw X-Forwarded-Host let any unauthenticated client choose that host; behind a+// cache that does not key on the header, the poisoned spec would then be served+// to operators. X-Forwarded-Host must be ignored unless the operator opted into+// TrustProxy.+func TestSwaggerDocHostNotAttackerControlled(t *testing.T) {+ const (+ realHost = "homebox.example:3007"+ evilHost = "evil.attacker.example"+ )++ docHost := func(t *testing.T, opts config.Options, headers map[string]string) string {+ t.Helper()++ a := &app{conf: &config.Config{Options: opts}}++ req := httptest.NewRequest(http.MethodGet, "/swagger/doc.json", nil)+ req.Host = realHost+ for k, v := range headers {+ req.Header.Set(k, v)+ }++ w := httptest.NewRecorder()+ a.swaggerDocHandler(w, req)+ if w.Code != http.StatusOK {+ t.Fatalf("expected 200, got %d", w.Code)+ }++ var spec struct {+ Host string `json:"host"`+ }+ if err := json.Unmarshal(w.Body.Bytes(), &spec); err != nil {+ t.Fatalf("decode spec: %v", err)+ }+ return spec.Host+ }++ t.Run("NoHeaderUsesRequestHost", func(t *testing.T) {+ if got := docHost(t, config.Options{}, nil); got != realHost {+ t.Errorf("host = %q, want %q", got, realHost)+ }+ })++ t.Run("ForwardedHostIgnoredByDefault", func(t *testing.T) {+ got := docHost(t, config.Options{}, map[string]string{"X-Forwarded-Host": evilHost})+ if got == evilHost {+ t.Fatalf("X-Forwarded-Host was honored without TrustProxy: host = %q", got)+ }+ if got != realHost {+ t.Errorf("host = %q, want %q", got, realHost)+ }+ })++ t.Run("ConfiguredHostnameWins", func(t *testing.T) {+ opts := config.Options{Hostname: "https://canonical.example"}+ got := docHost(t, opts, map[string]string{"X-Forwarded-Host": evilHost})+ if got != "canonical.example" {+ t.Errorf("host = %q, want %q", got, "canonical.example")+ }+ })++ t.Run("ForwardedHostHonoredWithTrustProxy", func(t *testing.T) {+ opts := config.Options{TrustProxy: true}+ got := docHost(t, opts, map[string]string{"X-Forwarded-Host": "proxy.example"})+ if got != "proxy.example" {+ t.Errorf("host = %q, want %q", got, "proxy.example")+ }+ })++ t.Run("MalformedForwardedHostRejectedUnderTrustProxy", func(t *testing.T) {+ opts := config.Options{TrustProxy: true}+ got := docHost(t, opts, map[string]string{"X-Forwarded-Host": "evil.example/path?x=1"})+ if got != realHost {+ t.Errorf("host = %q, want fallback %q", got, realHost)+ }+ })+}diff --git a/backend/go.mod b/backend/go.modindex 4c50bae3..22b201ba 100644--- a/backend/go.mod+++ b/backend/go.mod@@ -12,7 +12,7 @@ require (github.com/gen2brain/heic v0.7.1github.com/gen2brain/jpegxl v0.6.0github.com/gen2brain/webp v0.6.4- github.com/go-chi/chi/v5 v5.3.1+ github.com/go-chi/chi/v5 v5.3.2github.com/go-playground/validator/v10 v10.30.3github.com/gocarina/gocsv v0.0.0-20260628180327-50907998929cgithub.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0@@ -20,7 +20,7 @@ require (github.com/gorilla/schema v1.4.1github.com/hay-kot/httpkit v0.0.11github.com/jackc/pgx/v5 v5.10.0- github.com/nicholas-fedor/shoutrrr v0.16.3+ github.com/nicholas-fedor/shoutrrr v0.17.1github.com/olahol/melody v1.4.0github.com/pkg/errors v0.9.1github.com/pressly/goose/v3 v3.27.3@@ -29,11 +29,11 @@ require (github.com/samber/lo v1.53.0github.com/shirou/gopsutil/v4 v4.26.7github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e- github.com/stretchr/testify v1.11.1+ github.com/stretchr/testify v1.12.1github.com/swaggo/http-swagger/v2 v2.0.2github.com/swaggo/swag v1.16.6- github.com/yeqown/go-qrcode/v2 v2.2.5- github.com/yeqown/go-qrcode/writer/standard v1.3.0+ github.com/yeqown/go-qrcode/v2 v2.3.0+ github.com/yeqown/go-qrcode/writer/standard v1.4.0github.com/zeebo/blake3 v0.2.4go.balki.me/anyhttp v0.5.2go.opentelemetry.io/otel v1.45.0@@ -58,26 +58,26 @@ require (gocloud.dev/pubsub/kafkapubsub v0.46.0gocloud.dev/pubsub/natspubsub v0.46.0gocloud.dev/pubsub/rabbitpubsub v0.46.0- golang.org/x/crypto v0.54.0- golang.org/x/image v0.44.0+ golang.org/x/crypto v0.55.0+ golang.org/x/image v0.45.0golang.org/x/oauth2 v0.36.0- golang.org/x/text v0.40.0- google.golang.org/grpc v1.83.0- google.golang.org/protobuf v1.36.11- modernc.org/sqlite v1.56.0+ golang.org/x/text v0.41.0+ google.golang.org/grpc v1.83.1+ google.golang.org/protobuf v1.36.12+ modernc.org/sqlite v1.57.0)require (ariga.io/atlas v0.36.2-0.20250730182955-2c6300d0a3e1 // indirectcel.dev/expr v0.25.2 // indirectcloud.google.com/go v0.123.0 // indirect- cloud.google.com/go/auth v0.22.0 // indirect+ cloud.google.com/go/auth v0.23.0 // indirectcloud.google.com/go/auth/oauth2adapt v0.2.8 // indirectcloud.google.com/go/compute/metadata v0.9.0 // indirect- cloud.google.com/go/iam v1.5.3 // indirect- cloud.google.com/go/monitoring v1.24.3 // indirect- cloud.google.com/go/pubsub v1.50.1 // indirect- cloud.google.com/go/pubsub/v2 v2.4.0 // indirect+ cloud.google.com/go/iam v1.12.0 // indirect+ cloud.google.com/go/monitoring v1.30.0 // indirect+ cloud.google.com/go/pubsub v1.51.0 // indirect+ cloud.google.com/go/pubsub/v2 v2.6.0 // indirectcloud.google.com/go/storage v1.61.3 // indirectgithub.com/Azure/azure-amqp-common-go/v3 v3.2.3 // indirectgithub.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 // indirect@@ -138,23 +138,23 @@ require (github.com/go-openapi/jsonpointer v1.0.0 // indirectgithub.com/go-openapi/jsonreference v1.0.0 // indirectgithub.com/go-openapi/spec v0.22.9 // indirect- github.com/go-openapi/swag/conv v0.28.0 // indirect- github.com/go-openapi/swag/jsonutils v0.28.0 // indirect- github.com/go-openapi/swag/loading v0.28.0 // indirect- github.com/go-openapi/swag/pools v0.28.0 // indirect- github.com/go-openapi/swag/stringutils v0.28.0 // indirect- github.com/go-openapi/swag/typeutils v0.28.0 // indirect- github.com/go-openapi/swag/yamlutils v0.28.0 // indirect+ github.com/go-openapi/swag/conv v0.29.1 // indirect+ github.com/go-openapi/swag/jsonutils v0.29.1 // indirect+ github.com/go-openapi/swag/loading v0.29.1 // indirect+ github.com/go-openapi/swag/pools v0.29.1 // indirect+ github.com/go-openapi/swag/stringutils v0.29.1 // indirect+ github.com/go-openapi/swag/typeutils v0.29.1 // indirect+ github.com/go-openapi/swag/yamlutils v0.29.1 // indirectgithub.com/go-playground/locales v0.14.1 // indirectgithub.com/go-playground/universal-translator v0.18.1 // indirectgithub.com/golang-jwt/jwt/v5 v5.3.1 // indirectgithub.com/google/go-cmp v0.7.0 // indirectgithub.com/google/s2a-go v0.1.9 // indirectgithub.com/google/wire v0.7.0 // indirect- github.com/googleapis/enterprise-certificate-proxy v0.3.19 // indirect- github.com/googleapis/gax-go/v2 v2.23.0 // indirect+ github.com/googleapis/enterprise-certificate-proxy v0.3.20 // indirect+ github.com/googleapis/gax-go/v2 v2.24.0 // indirectgithub.com/gorilla/websocket v1.5.3 // indirect- github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirectgithub.com/hashicorp/go-uuid v1.0.3 // indirectgithub.com/hashicorp/hcl/v2 v2.18.1 // indirectgithub.com/jackc/pgpassfile v1.0.0 // indirect@@ -165,7 +165,7 @@ require (github.com/jcmturner/gofork v1.7.6 // indirectgithub.com/jcmturner/gokrb5/v8 v8.4.4 // indirectgithub.com/jcmturner/rpc/v2 v2.0.3 // indirect- github.com/klauspost/compress v1.19.1 // indirect+ github.com/klauspost/compress v1.19.2 // indirectgithub.com/klauspost/cpuid/v2 v2.4.0 // indirectgithub.com/kylelemons/godebug v1.1.0 // indirectgithub.com/leodido/go-urn v1.5.0 // indirect@@ -175,17 +175,17 @@ require (github.com/mattn/go-sqlite3 v1.14.34 // indirectgithub.com/mfridman/interpolate v0.0.2 // indirectgithub.com/mitchellh/go-wordwrap v1.0.1 // indirect- github.com/nats-io/nats.go v1.52.0 // indirect+ github.com/nats-io/nats.go v1.53.1 // indirectgithub.com/nats-io/nkeys v0.4.16 // indirectgithub.com/nats-io/nuid v1.0.1 // indirectgithub.com/ncruces/go-strftime v1.0.0 // indirectgithub.com/philhofer/fwd v1.2.0 // indirect- github.com/pierrec/lz4/v4 v4.1.27 // indirect+ github.com/pierrec/lz4/v4 v4.1.29 // indirectgithub.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirectgithub.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirectgithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirectgithub.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect- github.com/rabbitmq/amqp091-go v1.13.0 // indirect+ github.com/rabbitmq/amqp091-go v1.14.0 // indirectgithub.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirectgithub.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirectgithub.com/sethvargo/go-retry v0.4.0 // indirect@@ -201,24 +201,24 @@ require (github.com/zclconf/go-cty-yaml v1.1.0 // indirectgo.opentelemetry.io/auto/sdk v1.2.1 // indirectgo.opentelemetry.io/contrib/detectors/gcp v1.44.0 // indirect- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 // indirect- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0 // indirect+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 // indirectgo.uber.org/multierr v1.11.0 // indirectgo.yaml.in/yaml/v3 v3.0.5 // indirect- golang.org/x/mod v0.38.0 // indirect- golang.org/x/net v0.57.0 // indirect+ golang.org/x/mod v0.40.0 // indirect+ golang.org/x/net v0.58.0 // indirectgolang.org/x/sync v0.22.0 // indirectgolang.org/x/sys v0.47.0 // indirectgolang.org/x/term v0.45.0 // indirectgolang.org/x/time v0.15.0 // indirect- golang.org/x/tools v0.48.0 // indirect+ golang.org/x/tools v0.49.0 // indirectgolang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect- google.golang.org/api v0.291.0 // indirect- google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 // indirect- google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d // indirect- google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d // indirect+ google.golang.org/api v0.293.0 // indirect+ google.golang.org/genproto v0.0.0-20260715232425-e75dac1f907d // indirect+ google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect+ google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirectgopkg.in/yaml.v3 v3.0.1 // indirect- modernc.org/libc v1.74.4 // indirect+ modernc.org/libc v1.75.4 // indirectmodernc.org/mathutil v1.7.1 // indirect- modernc.org/memory v1.11.0 // indirect+ modernc.org/memory v1.12.1 // indirect)diff --git a/backend/go.sum b/backend/go.sumindex f4bb7fdd..3255d8de 100644--- a/backend/go.sum+++ b/backend/go.sum@@ -6,26 +6,39 @@ cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE=cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU=cloud.google.com/go/auth v0.22.0 h1:Xp9wAKkLoeaYb5pYZZoQGz4E9sdPxIbzS3gywZE3ciQ=cloud.google.com/go/auth v0.22.0/go.mod h1:M9o2Oz+YI2jAfxewJgb1vyI3vceHF+eohmxyzmrl+9s=+cloud.google.com/go/auth v0.23.0 h1:6Gg1CMgpgubRG7DGz5Vf1pcoNo8RfiRiRAPS4crTp54=+cloud.google.com/go/auth v0.23.0/go.mod h1:4DhBRcqvtljQN3dJ57qtqbib5ZGCYE5f2crfiiC2EM0=cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc=cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c=cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs=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/iam v1.12.0 h1:Aki3bX9aHUDKPHfnRJfDcTdVedvy6quGBQcTqx3DRXk=+cloud.google.com/go/iam v1.12.0/go.mod h1:FEZ4lXpADAC2AIpQY7LANNjjwyQ2jK439CI2VaD+sLY=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/logging v1.19.0 h1:NCqhdVUg3wQ8Cobdf16FDSuTGi3+6+hdSBHrY5TsR6Q=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/longrunning v1.2.0 h1:WjYH3YHBGCxGJP9M4dWGHBfXr/cFIjMkNgWcJj7/iMM=cloud.google.com/go/monitoring v1.24.3 h1:dde+gMNc0UhPZD1Azu6at2e79bfdztVDS5lvhOdsgaE=cloud.google.com/go/monitoring v1.24.3/go.mod h1:nYP6W0tm3N9H/bOw8am7t62YTzZY+zUeQ+Bi6+2eonI=+cloud.google.com/go/monitoring v1.30.0 h1:r/d+JUbyKmJ8b07iznuKfzVzrIXTWxHQ3lBRm3x2LlY=+cloud.google.com/go/monitoring v1.30.0/go.mod h1:htlUR0QWVMrjFzZmN4LGnMAve9xB/eduwjmINxVZ8RM=cloud.google.com/go/pubsub v1.50.1 h1:fzbXpPyJnSGvWXF1jabhQeXyxdbCIkXTpjXHy7xviBM=cloud.google.com/go/pubsub v1.50.1/go.mod h1:6YVJv3MzWJUVdvQXG081sFvS0dWQOdnV+oTo++q/xFk=+cloud.google.com/go/pubsub v1.51.0 h1:XOaCejsqX7EEtUdQz+WPag66wWsUUGliyCOfGPKfo90=+cloud.google.com/go/pubsub v1.51.0/go.mod h1:NERXf11sd82UV3VnflcUj8POIyQUXT/QwrKlxD8di/I=cloud.google.com/go/pubsub/v2 v2.4.0 h1:oMKNiBQpXImRWnHYla9uSU66ZzByZwBSCJOEs/pTKVg=cloud.google.com/go/pubsub/v2 v2.4.0/go.mod h1:2lS/XQKq5qtOMs6kHBK+WX1ytUC36kLl2ig3zqsGUx8=+cloud.google.com/go/pubsub/v2 v2.6.0 h1:8pjR0id+GTB+krKx5G6AGJoYrHog58w2Q89PCOrfM64=+cloud.google.com/go/pubsub/v2 v2.6.0/go.mod h1:4anqvV/w8Pcgu2tO0qr2XgsF3GXHowzryfQ5gOnVmWY=cloud.google.com/go/storage v1.61.3 h1:VS//ZfBuPGDvakfD9xyPW1RGF1Vy3BWUoVZXgW1KMOg=cloud.google.com/go/storage v1.61.3/go.mod h1:JtqK8BBB7TWv0HVGHubtUdzYYrakOQIsMLffZ2Z/HWk=cloud.google.com/go/trace v1.11.7 h1:kDNDX8JkaAG3R2nq1lIdkb7FCSi1rCmsEtKVsty7p+U=cloud.google.com/go/trace v1.11.7/go.mod h1:TNn9d5V3fQVf6s4SCveVMIBS2LJUqo73GACmq/Tky0s=+cloud.google.com/go/trace v1.16.0 h1:GmQovzFc5F0CNfl0VLgL64aoTtu7xsM0YajW2GlG9+E=entgo.io/ent v0.14.6 h1:/f2696BpwuWAEEG6PVGWflg6+Inrpq4pRWuNlWz/Skk=entgo.io/ent v0.14.6/go.mod h1:z46QBUdGC+BATwsedbDuREfSS0oSCV+csdEYlL4p73s=github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk=@@ -182,6 +195,8 @@ github.com/gen2brain/webp v0.6.4 h1:SUDdmxADOAiPQ+5ylNmuHhuYf2dOi0KgKZHL5vpVCNU=github.com/gen2brain/webp v0.6.4/go.mod h1:iGWMaCSw7t3I/Cv9llzEKmpnR36S8lS8VL/ZVjxU0JE=github.com/go-chi/chi/v5 v5.3.1 h1:3j4HZLGZQ3JpMCrPJF/Jl3mYJfWLKBfNJ6quurUGCf8=github.com/go-chi/chi/v5 v5.3.1/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto=+github.com/go-chi/chi/v5 v5.3.2 h1:5YQkICvTCSZ25hoRsyJazN0scjzKGiu4VAUc7H1o1nY=+github.com/go-chi/chi/v5 v5.3.2/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto=github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA=github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=@@ -200,26 +215,44 @@ github.com/go-openapi/jsonreference v1.0.0/go.mod h1:jtwdyGbJk0Xhe5Y+rwtglQP6Sb1github.com/go-openapi/spec v0.22.9 h1:/vKIFDcGKp0ktZWGbym/tJEWbk6/XOEmAVU0kqKMH+w=github.com/go-openapi/spec v0.22.9/go.mod h1:b/mNUYIOQOyIiUzUzXEE8xzyZqf93KvM9hQGP91yfl0=github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM=+github.com/go-openapi/swag v0.28.0 h1:xkgbOSKj6DZziNpyqRRAOt3GJGtgjgsd2RoyT30VWuw=github.com/go-openapi/swag/conv v0.28.0 h1:GtqqbyFe7vR5Y7ehxG9W6/OvrSFdf1OLeTGp40TqxH8=github.com/go-openapi/swag/conv v0.28.0/go.mod h1:mbUE+mzctnhxi864m0Q07SpN8OowD9JhxmxuYvZZD/k=+github.com/go-openapi/swag/conv v0.29.1 h1:AC4Eh/5c/eUDOUCzzsRC9ghmFgOSBHeRMGIngY0ZUGA=+github.com/go-openapi/swag/conv v0.29.1/go.mod h1:S1X7/ZrBEZOC0Wc8AGxjbcGS92l3WEjA7aPtpl+RaqM=github.com/go-openapi/swag/jsonutils v0.28.0 h1:YIch6FwO7RXzeAnbO8Tu7dWBZeUEH+4nA0HXltVTnv4=github.com/go-openapi/swag/jsonutils v0.28.0/go.mod h1:CYM3WlTUcagR2ZoHdz54di/cbBqt82tuxuXgAjxw+mg=+github.com/go-openapi/swag/jsonutils v0.29.1 h1:AFCxs0eQZ24/QyfhVHM2t49rMz7Vv3XCsZQI6yrNy+c=+github.com/go-openapi/swag/jsonutils v0.29.1/go.mod h1:u3+sCfJpttDpcmS5kpm0yxL6GK0eWgODsx8Yw8fcqNM=github.com/go-openapi/swag/jsonutils/fixtures_test v0.28.0 h1:qV+VVUAx5Oro8WjVWpZeql7YReTKhT4smR4zhcOQZr0=github.com/go-openapi/swag/jsonutils/fixtures_test v0.28.0/go.mod h1:mofwUWx70wvskwESqRJ//k/9kURmCgyJl5m5Ppoh5kY=+github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.1 h1:BiiXE31Bx9SfpsMmOQj5KYpUhTZBpLVriVhJDuLuY2o=github.com/go-openapi/swag/loading v0.28.0 h1:td8QZdZC9MIYGGSnSPKShKiK22I2tU5UQvuUhIBPRLU=github.com/go-openapi/swag/loading v0.28.0/go.mod h1:rXB0QiQX5mMveXEA7ouM4KiiM9jVJe4K6BVbwhD1M4k=+github.com/go-openapi/swag/loading v0.29.1 h1:FCv5fG8UhTdDJa2R7w+5O9Ekpcbw7tt0nFWvmDKGBjc=+github.com/go-openapi/swag/loading v0.29.1/go.mod h1:N0ESuem4p2oedKal8EJhciqnJ9Q9Wmt83L1CRB3Fouw=github.com/go-openapi/swag/pools v0.28.0 h1:HPMZWSAfce3rdVTFcjFiCIBtDg9h4x2QlRrHipwhxeU=github.com/go-openapi/swag/pools v0.28.0/go.mod h1:kVQefhSK5RWuRe7BXsL8htgBPAMpN7HDGpGEknqugeE=+github.com/go-openapi/swag/pools v0.29.1 h1:NRogYxdEW9SjRM4mkAOji9iefO4MRXq3p/ZJcoQbUKg=+github.com/go-openapi/swag/pools v0.29.1/go.mod h1:leDcaghjkRAhCuCRv9NfJU5f0mjoU3cT/XZObhMk3pc=github.com/go-openapi/swag/stringutils v0.28.0 h1:ixsc9iYgDPubHL/8nSkbnryEHpD2VRlBMLKpQyPXcDU=github.com/go-openapi/swag/stringutils v0.28.0/go.mod h1:lzRN95CxXmA03XcDWHLOb6nOMcxCqR5rGY0lOgsfRoM=+github.com/go-openapi/swag/stringutils v0.29.1 h1:1ykunK7iJQk1uOO7+oUH1ukbsK85fFCOiCFMOVSY+F0=+github.com/go-openapi/swag/stringutils v0.29.1/go.mod h1:7fSqZ+z8Qc0tOfAAK0jVa5qFGrnIlRi6n7NeGGrr1vc=github.com/go-openapi/swag/typeutils v0.28.0 h1:nRBKSBXjDgf01VDPB3fWeD9nQuhCOVeIYAkUx2tbkyY=github.com/go-openapi/swag/typeutils v0.28.0/go.mod h1:Srm0xFNRZ1Y+vCxJclo5qzx8aj+1pAKda/YfFPrG0dQ=+github.com/go-openapi/swag/typeutils v0.29.1 h1:Nzv9nhnlLCRBPQqfOX+7lB6Guju370or8StT+lIOf6M=+github.com/go-openapi/swag/typeutils v0.29.1/go.mod h1:hxpgDZJVBkBsi/d3MIUosafoFdE5exaQRmVp0zwu3YE=github.com/go-openapi/swag/yamlutils v0.28.0 h1:TV3JXH6DS46KUroDtMLAYHGkdWf5VDq3wVWFirmzROY=github.com/go-openapi/swag/yamlutils v0.28.0/go.mod h1:x0q/yndZHEgk9Rx3DyDqzFUmHy55KTvIZldvF2dTJXs=+github.com/go-openapi/swag/yamlutils v0.29.1 h1:69w3tsBajm7MR/fejLy7HD/3J68Ys1SeeZMEzZ3w2sk=+github.com/go-openapi/swag/yamlutils v0.29.1/go.mod h1:rgsp3vT/QdWzKwn43CigDwjOGIenPyTZMKnxEM8jZOA=github.com/go-openapi/testify/enable/yaml/v2 v2.6.0 h1:gGHwAJ0R/5jU8BEGDbfRNR3hL68dAVi84WuOApp29B0=github.com/go-openapi/testify/enable/yaml/v2 v2.6.0/go.mod h1:tY+St1SGq4NFl0QIqdTY4aEdbChAHxhyB77XQi9iJCo=+github.com/go-openapi/testify/enable/yaml/v2 v2.6.1 h1:Jm+/ze2rMtbD98yen92AhATGLGREDYXG56Xr4gMjEtE=github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAgUEu3ug=github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=+github.com/go-openapi/testify/v2 v2.6.1 h1:6CNJhTjMzgaeaH8WhshcsZNPIvRemiOcFpU7seO/y7Q=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=@@ -264,8 +297,12 @@ 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.19 h1:mMOE7DN2+p76/EdIrmAy9B9bH+yC4563vmnJ34QR8i4=github.com/googleapis/enterprise-certificate-proxy v0.3.19/go.mod h1:rSEsBUemEBZEexP2y6jPp16LUmUbjmSbcPMQizR0o4k=+github.com/googleapis/enterprise-certificate-proxy v0.3.20 h1:t/xL64VUoN69MuMRQuJETqYGOw4Z9mSRJK9epIEtwFk=+github.com/googleapis/enterprise-certificate-proxy v0.3.20/go.mod h1:L3D/IQExI6LqEjBdXcZQ1WluSgigQmSwBboFstVPM4w=github.com/googleapis/gax-go/v2 v2.23.0 h1:Tchl7qkvE7Ip3y+ztvNufYFvkfqTe7NfLTYGIdJRLuE=github.com/googleapis/gax-go/v2 v2.23.0/go.mod h1:rBQKOVJCdb8IFEzg+FCwlt1LP/xMDGuqUXhUG+XMXEg=+github.com/googleapis/gax-go/v2 v2.24.0 h1:myMaPYyF9MecEmvQqMqomIwn9t/4KCZN9qnwsS76wlg=+github.com/googleapis/gax-go/v2 v2.24.0/go.mod h1:IaTHBDd7NHxSCiu0vEs8pQZu4dGZrWwuSoxCnk16OFM=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=@@ -274,6 +311,8 @@ github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNgithub.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk=github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs=+github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw=+github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY=github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=@@ -311,6 +350,8 @@ github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtgithub.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k=github.com/klauspost/compress v1.19.1 h1:VsB4HPswih7mmZ8WleSFQ75c/Ui1M4trX5oAsJnhSlk=github.com/klauspost/compress v1.19.1/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=+github.com/klauspost/compress v1.19.2 h1:hMRETovs/pu/dVWN7zIT1PGG8t509MwT6bO7XSi26R8=+github.com/klauspost/compress v1.19.2/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=github.com/klauspost/cpuid/v2 v2.4.0 h1:S6Hrbc7+ywsr0r+RLapfGBHfyefhCTwEh3A0tV913Dw=github.com/klauspost/cpuid/v2 v2.4.0/go.mod h1:19jmZ9mjzoF//ddRSUsv0zfBTJWh3QJh9FNxZTMrGxU=github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=@@ -341,6 +382,8 @@ github.com/nats-io/nats-server/v2 v2.11.15 h1:StSf9TINInaZtr4oww2+kXmfwa9SkN//g/github.com/nats-io/nats-server/v2 v2.11.15/go.mod h1:zwhv8Y0PE3KHyKgznJc/9Xoai638SaJd83zzJ5GJn74=github.com/nats-io/nats.go v1.52.0 h1:n3avV4VBsCgsdwh71TppsTwtv+QdPs7ntSKM8qJLGsc=github.com/nats-io/nats.go v1.52.0/go.mod h1:26HypzazeOkyO3/mqd1zZd53STJN0EjCYF9Uy2ZOBno=+github.com/nats-io/nats.go v1.53.1 h1:Otsq3uLc/kLdjmkNHkXH0jBqwUquwdKFoe3fq6/3/Xo=+github.com/nats-io/nats.go v1.53.1/go.mod h1:26HypzazeOkyO3/mqd1zZd53STJN0EjCYF9Uy2ZOBno=github.com/nats-io/nkeys v0.4.16 h1:rd5oAuLOb8mnAycB0xleuEBNS1pVVnN0fv/FF34Eypg=github.com/nats-io/nkeys v0.4.16/go.mod h1:llLgWoI0o4z/Q57q2R1kHfmocyhGV6VG/U18Glg1Afs=github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=@@ -349,16 +392,21 @@ github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFgithub.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=github.com/nicholas-fedor/shoutrrr v0.16.3 h1:8n2Sp6futI8Q/zEzQXQKUJhn1izZEwr4DGiLgeLdC5k=github.com/nicholas-fedor/shoutrrr v0.16.3/go.mod h1:XTUvtSfZxjo9f0mqk9W7ygAjfS9bw5Bhcvoz01Fk+Tc=+github.com/nicholas-fedor/shoutrrr v0.17.1 h1:tpIM/hBgM1RKmfcoGsVsfvra5EsQClH8qFkvMoP6fVs=+github.com/nicholas-fedor/shoutrrr v0.17.1/go.mod h1:vMer/4ey2s4xF8mHyeIOwq5ze8outIMvJZ0DuqE8kvc=github.com/olahol/melody v1.4.0 h1:Pa5SdeZL/zXPi1tJuMAPDbl4n3gQOThSL6G1p4qZ4SI=github.com/olahol/melody v1.4.0/go.mod h1:GgkTl6Y7yWj/HtfD48Q5vLKPVoZOH+Qqgfa7CvJgJM4=github.com/onsi/ginkgo/v2 v2.32.0 h1:Hw7s2pVrQo/8Yz5N77qdnpHaoc+c6cC9WIV1Jce+J6E=github.com/onsi/ginkgo/v2 v2.32.0/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44=+github.com/onsi/ginkgo/v2 v2.32.1 h1:6tlvcDm/3sE8lGJbZ4+d4mO3RLy24/tQWOFzVSQNIfw=github.com/onsi/gomega v1.42.1 h1:iN1rCUX+44NZ1Dc97MPoeFYbFR0vh8zxoxMFwKdyZ6I=github.com/onsi/gomega v1.42.1/go.mod h1:REff/hsDsodHoKlWsP2mAPhu1+5/6hVYNf9rIEBpeSg=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.27 h1:+PhzhWDrjRj89TH2sw43nE3+4+W8lSxIuQadEHZyjUk=github.com/pierrec/lz4/v4 v4.1.27/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4=+github.com/pierrec/lz4/v4 v4.1.29 h1:CDQY6qZOLI4DW0Nx6R1vRrifrCeQHnNXkMb0hZWXFjg=+github.com/pierrec/lz4/v4 v4.1.29/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=@@ -374,6 +422,8 @@ github.com/pressly/goose/v3 v3.27.3 h1:pIglVHjw99r4e/hDHHwbl9vfOsDMqUokfkXo6+n/Rgithub.com/pressly/goose/v3 v3.27.3/go.mod h1:Dag+xpV6o20HR2LFY1j0q6MDwc3f7vPUFDA77R+0yGY=github.com/rabbitmq/amqp091-go v1.13.0 h1:L8NA1WtF76C6KA3LAoufjfLgbist/If1UQYcsOjtxXA=github.com/rabbitmq/amqp091-go v1.13.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=+github.com/rabbitmq/amqp091-go v1.14.0 h1:RSaT7aOKt/OrkVUyswPDW29lnRz9psuGmfZFBmLqLek=+github.com/rabbitmq/amqp091-go v1.14.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 h1:bsUq1dX0N8AOIL7EB/X911+m4EHsnWEHeJ0c+3TTBrg=github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=@@ -410,6 +460,10 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoOgithub.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=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/stretchr/testify v1.12.0 h1:K6Mr6jO9JICuend/5xzTM03ydSV3vdNRYAdPSukj8uI=+github.com/stretchr/testify v1.12.0/go.mod h1:bOYBZb5qJ00vPzWfIqBUZPaxK8jWiXc6d3ErP4Ca9Gw=+github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=+github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=github.com/swaggo/files/v2 v2.0.2 h1:Bq4tgS/yxLB/3nwOMcul5oLEUKa877Ykgz3CJMVbQKU=github.com/swaggo/files/v2 v2.0.2/go.mod h1:TVqetIzZsO9OhHX1Am9sRf9LdrFZqoK49N37KON/jr0=github.com/swaggo/http-swagger/v2 v2.0.2 h1:FKCdLsl+sFCx60KFsyM0rDarwiUSZ8DqbfSyIKC9OBg=@@ -428,8 +482,12 @@ github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZgithub.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=github.com/yeqown/go-qrcode/v2 v2.2.5 h1:HCOe2bSjkhZyYoyyNaXNzh4DJZll6inVJQQw+8228Zk=github.com/yeqown/go-qrcode/v2 v2.2.5/go.mod h1:uHpt9CM0V1HeXLz+Wg5MN50/sI/fQhfkZlOM+cOTHxw=+github.com/yeqown/go-qrcode/v2 v2.3.0 h1:MMsNJgZrG95g8SOGGGaGcEZkOt1ByHjeCLSaymGm9aY=+github.com/yeqown/go-qrcode/v2 v2.3.0/go.mod h1:WBrb4qHlVtggZtquxDyMq+Uv+R4xtUaz4laG2iqG34s=github.com/yeqown/go-qrcode/writer/standard v1.3.0 h1:chdyhEfRtUPgQtuPeaWVGQ/TQx4rE1PqeoW3U+53t34=github.com/yeqown/go-qrcode/writer/standard v1.3.0/go.mod h1:O4MbzsotGCvy8upYPCR91j81dr5XLT7heuljcNXW+oQ=+github.com/yeqown/go-qrcode/writer/standard v1.4.0 h1:DccxxFt/Nu1gdL0kXf1dOwuqDeF3SM8evmfsvE5kMcE=+github.com/yeqown/go-qrcode/writer/standard v1.4.0/go.mod h1:PnbqAQGDQ/1osHXVfuDfc6UpCdXwBWoXkWn3HwUGgp4=github.com/yeqown/reedsolomon v1.0.0 h1:x1h/Ej/uJnNu8jaX7GLHBWmZKCAWjEJTetkqaabr4B0=github.com/yeqown/reedsolomon v1.0.0/go.mod h1:P76zpcn2TCuL0ul1Fso373qHRc69LKwAw/Iy6g1WiiM=github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=@@ -453,8 +511,12 @@ go.opentelemetry.io/contrib/detectors/gcp v1.44.0 h1:NmLfL734pJhM0JKaYd2Y28+nY9dgo.opentelemetry.io/contrib/detectors/gcp v1.44.0/go.mod h1:tNAsgd8avTGke1+MndXlU5Cru4PQ9Ai/cCNWQv/ZJ/s=go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 h1:yI1/OhfEPy7J9eoa6Sj051C7n5dvpj0QX8g4sRchg04=go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0/go.mod h1:NoUCKYWK+3ecatC4HjkRktREheMeEtrXoQxrqYFeHSc=+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0 h1:oECp5f+hN7nkwjU/8BxQ/q23bGPb8FIrD839owX222E=+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0/go.mod h1:DqEFwLumhzMBDQv9PcWbyoDxHI/4lAk6CM4nJBH39sc=go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo=go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI=+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 h1:LMuyCAyfalSjDyjdC65nK6N0zoTT63+E/u95X0JovZI=+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0/go.mod h1:085m8qbm4hgc8rZWGDEa4vmyyo2c3nPxUslYUKUIU04=go.opentelemetry.io/otel v1.45.0 h1:pdrWmLHofpubmArBv1LgFSv1Z0Ie/ppdZzu+kUN5EeU=go.opentelemetry.io/otel v1.45.0/go.mod h1:XZxIqPapzEYnhNSScF5DIqXhm/rYi0FzCe2XddAwZfQ=go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.21.0 h1:WseeVYf5dJZTsyPiyW5L14k5qsSibqXAMTSiFEDiWr0=@@ -515,11 +577,17 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ygolang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=+golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M=+golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis=golang.org/x/image v0.44.0 h1:+tDekMZED9+LrtB3G5xzRggpVh9CARjZqROla3R3R+I=golang.org/x/image v0.44.0/go.mod h1:V8K3KE9KKKE+pLpQDOeN18w9oacNSvy1tDOirTu4xtY=+golang.org/x/image v0.45.0 h1:FMb1nTbH5H9vF55SriQHgFw5GnNL9Jg6L25BwXKzhB0=+golang.org/x/image v0.45.0/go.mod h1:n62x/7RqlwXDvGsSU4u6IUTUf6KghUZ9Bt7cG/T9Fx4=golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk=golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40=+golang.org/x/mod v0.40.0 h1:hUv+3cXcdRHz08UmSiOob7sadHig73uo5bkXxQ/tvUs=+golang.org/x/mod v0.40.0/go.mod h1:0/weTWkPWGBikyTWAX3dkjVztMmBA5hM0DH6BElSupE=golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=@@ -529,6 +597,8 @@ 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.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=+golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To=+golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU=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=@@ -558,6 +628,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.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=+golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=+golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=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=@@ -565,6 +637,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtngolang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE=golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk=+golang.org/x/tools v0.49.0 h1:3NI7VXzL9+1WZD52Dx2ttoPwD5DWrFGpl9mFZDlmisI=+golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo=golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY=@@ -573,16 +647,28 @@ gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=google.golang.org/api v0.291.0 h1:wfPbbY+mr9c7wZLqqzrHJLft/q8iFKREd6IgTBUene0=google.golang.org/api v0.291.0/go.mod h1:at7kwWbuonglBFEBoeMDAV1bguHqL3qf0BHFsv3coa0=+google.golang.org/api v0.293.0 h1:p9XIWOf63U4OgYx120ZwVU8+vl4XTPmWfgVPnmOAS9w=+google.golang.org/api v0.293.0/go.mod h1:6n5tjEB1gzwniZTepZ0g5u+wM7Bof5GeULCx/zh8ZE0=google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 h1:XzmzkmB14QhVhgnawEVsOn6OFsnpyxNPRY9QV01dNB0=google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7/go.mod h1:L43LFes82YgSonw6iTXTxXUX1OlULt4AQtkik4ULL/I=+google.golang.org/genproto v0.0.0-20260715232425-e75dac1f907d h1:C9v1o0/4quuhOAfmRXA2j+we0PqZIp8traLdeogF3Ms=+google.golang.org/genproto v0.0.0-20260715232425-e75dac1f907d/go.mod h1:Wz2wFJntZFmLGo7pLDXZ3wYk5hyc0Mb+SkHhDDXT+lU=google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d h1:FarXi840EJWSHYTN3ERkADbPWjl307+FGrA22KAVjjc=google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d/go.mod h1:K/+WGbmBY7aNW1HDw1fJnKYo10i0DkAX6pows00dLig=+google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI=+google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI=google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d h1:IL4hdHzcUv2l/gcg98/Rj3FbtE6axwqslOW8SW0C+S0=google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=+google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 h1:cYNAzI2sUwhmCcoj9TxvihSrqsxt6uIkj3rDRhSDmW4=+google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA=google.golang.org/grpc v1.83.0 h1:JeNZEKJFbQxArAMl+hiytHauacDNqJUllNfmIMmpqnQ=google.golang.org/grpc v1.83.0/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ=+google.golang.org/grpc v1.83.1 h1:HIO0+BEtBP6soyqvqC8sNUjZ7bTs+0hFQuFF+RAy++Y=+google.golang.org/grpc v1.83.1/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ=google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=+google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=+google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=@@ -592,28 +678,37 @@ 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.29.1 h1:MKgdCV3WykTSPqpVrnxdEDS0HEd2FHpKZDzxzU5LyeI=modernc.org/cc/v4 v4.29.1/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI=+modernc.org/cc/v4 v4.29.2 h1:h6+9ciCnPKutf4I03CvheAvDLX7+IHlqR6Iy6J+cgd8=modernc.org/ccgo/v4 v4.34.6 h1:sBgfIwyN0TQ9C5hwIeuqyeAKyMWnbvj2fvpF4L11uzU=modernc.org/ccgo/v4 v4.34.6/go.mod h1:SZ8YcN9NG7XVsQYdm6jYBvi8PQP1qi+kqB6OhjqI3Fk=+modernc.org/ccgo/v4 v4.35.0 h1:F+TUsmw09QxLzmi3aeYYGxjAXarmZaKgj3mKQHNaA8w=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=modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=modernc.org/gc/v3 v3.1.4 h1:2g65LGVSmFQrXeITAw97x7hCRvZFcyE1uDP+7Vng7JI=modernc.org/gc/v3 v3.1.4/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=+modernc.org/gc/v3 v3.1.5 h1:21ldfPfRYE31Tb7B3mwAK8gy1AxP4+dKjrOQPfqakoc=modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=modernc.org/libc v1.74.4 h1:fX1Omw4o2/1C2iRkkIsrQTasJQldLhRmuPreXLoWs9k=modernc.org/libc v1.74.4/go.mod h1:eeQAS9W3sZeKYMFubydxJpII9ybHWshk+7or7bLG9co=+modernc.org/libc v1.75.4 h1:EHQJNYDC6LiDIOqM76862xe4frbDc7IzEOZTtGxZV8Q=+modernc.org/libc v1.75.4/go.mod h1:bO5o2ztHxBb2rjz0PgdHN0sSMw57CgxGFLZ3Qd/QpVQ=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=modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=+modernc.org/memory v1.12.1 h1:nFMiWrpStgZczNl6XI9GnIk/rWhYIyHGUaR04pGbp9g=+modernc.org/memory v1.12.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg=modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=modernc.org/sqlite v1.56.0 h1:/D8e2RfFqoy/Zc6PuC76U28zFwmI/sYx1Kjm4yEn9e0=modernc.org/sqlite v1.56.0/go.mod h1:yCJ2cmAaIkHQ25oXWrF8H4O1lIfPYPR26yCEDj2P3pQ=+modernc.org/sqlite v1.57.0 h1:qNQP6xnx5M0ISNtlnxoOX0+cD5bJ0/gr9aMmndFczzg=+modernc.org/sqlite v1.57.0/go.mod h1:yCJ2cmAaIkHQ25oXWrF8H4O1lIfPYPR26yCEDj2P3pQ=modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=diff --git a/backend/internal/core/services/service_user.go b/backend/internal/core/services/service_user.goindex 5aa4310d..2bfbe28a 100644--- a/backend/internal/core/services/service_user.go+++ b/backend/internal/core/services/service_user.go@@ -19,7 +19,13 @@ import ()var (- oneWeek = time.Hour * 24 * 7+ oneWeek = time.Hour * 24 * 7+ // defaultAPIKeyTTL bounds the lifetime of an API key created without an+ // explicit expiry. A password change revokes sessions but deliberately+ // leaves API keys alone (matching how API credentials behave elsewhere),+ // so without a default TTL a leaked key would stay valid for the life of+ // the account. Callers that need a longer-lived key pass ExpiresAt.+ defaultAPIKeyTTL = time.Hour * 24 * 30passwordResetTokenTTL = time.HourErrorInvalidLogin = errors.New("invalid username or password")ErrorInvalidToken = errors.New("invalid token")@@ -849,8 +855,18 @@ func (svc *UserService) CreateAPIKey(ctx context.Context, userID uuid.UUID, in r))defer span.End()+ expiresAt := in.ExpiresAt+ if expiresAt == nil {+ defaulted := time.Now().Add(defaultAPIKeyTTL)+ expiresAt = &defaulted+ }+ span.SetAttributes(+ attribute.Bool("api_key.expiration.defaulted", in.ExpiresAt == nil),+ attribute.String("api_key.expires_at", expiresAt.Format(time.RFC3339)),+ )+token := hasher.GenerateAPIKeyCtx(ctx)- out, err := svc.repos.APIKeys.Create(ctx, userID, in.Name, token.Hash, in.ExpiresAt)+ out, err := svc.repos.APIKeys.Create(ctx, userID, in.Name, token.Hash, expiresAt)if err != nil {recordServiceSpanError(span, err)return repo.APIKeyCreatedOut{}, errdiff --git a/backend/internal/core/services/service_user_api_key_expiry_test.go b/backend/internal/core/services/service_user_api_key_expiry_test.gonew file mode 100644index 00000000..23671c7f--- /dev/null+++ b/backend/internal/core/services/service_user_api_key_expiry_test.go@@ -0,0 +1,77 @@+package services++import (+ "context"+ "testing"+ "time"++ "github.com/stretchr/testify/assert"+ "github.com/stretchr/testify/require"+ "github.com/sysadminsmedia/homebox/backend/internal/data/repo"+ "github.com/sysadminsmedia/homebox/backend/pkgs/hasher"+)++// API key hashing is peppered and panics if the pepper was never configured+// (see hasher.HashAPIKey); the app sets it at startup, so tests must too.+func init() {+ hasher.SetAPIKeyPepper([]byte("test-api-key-pepper"))+}++// TestCreateAPIKey_DefaultsToBoundedLifetime pins the default API key TTL. A+// password change revokes sessions but intentionally leaves API keys alone, so+// a key created without an explicit expiry must not live forever — otherwise a+// leaked key stays valid for the life of the account with no lifecycle event+// that would ever retire it.+func TestCreateAPIKey_DefaultsToBoundedLifetime(t *testing.T) {+ ctx := context.Background()+ usr := newTestUserWithPassword(t, "api-key-default-ttl")++ before := time.Now()+ out, err := tSvc.User.CreateAPIKey(ctx, usr.ID, repo.APIKeyCreate{Name: "no-expiry-requested"})+ require.NoError(t, err)++ require.NotNil(t, out.ExpiresAt, "a key created without an explicit expiry must still expire")+ assert.WithinDuration(t, before.Add(defaultAPIKeyTTL), *out.ExpiresAt, time.Minute)+ assert.True(t, out.ExpiresAt.After(time.Now()), "default expiry must be in the future")++ // The key is usable now...+ _, _, err = tRepos.APIKeys.GetUserFromToken(ctx, hasher.HashAPIKey(out.Token))+ require.NoError(t, err, "key must be valid before its expiry")+}++// TestCreateAPIKey_HonorsExplicitExpiry ensures the default does not override a+// caller-supplied expiry in either direction.+func TestCreateAPIKey_HonorsExplicitExpiry(t *testing.T) {+ ctx := context.Background()+ usr := newTestUserWithPassword(t, "api-key-explicit-ttl")++ t.Run("LongerThanDefault", func(t *testing.T) {+ want := time.Now().Add(defaultAPIKeyTTL * 12).UTC()+ out, err := tSvc.User.CreateAPIKey(ctx, usr.ID, repo.APIKeyCreate{Name: "long", ExpiresAt: &want})+ require.NoError(t, err)+ require.NotNil(t, out.ExpiresAt)+ assert.WithinDuration(t, want, *out.ExpiresAt, time.Second)+ })++ t.Run("ShorterThanDefault", func(t *testing.T) {+ want := time.Now().Add(time.Hour).UTC()+ out, err := tSvc.User.CreateAPIKey(ctx, usr.ID, repo.APIKeyCreate{Name: "short", ExpiresAt: &want})+ require.NoError(t, err)+ require.NotNil(t, out.ExpiresAt)+ assert.WithinDuration(t, want, *out.ExpiresAt, time.Second)+ })+}++// TestCreateAPIKey_ExpiredKeyRejected confirms the stored expiry is actually+// enforced at authentication time, so the default TTL has teeth.+func TestCreateAPIKey_ExpiredKeyRejected(t *testing.T) {+ ctx := context.Background()+ usr := newTestUserWithPassword(t, "api-key-expired")++ past := time.Now().Add(-time.Hour).UTC()+ out, err := tSvc.User.CreateAPIKey(ctx, usr.ID, repo.APIKeyCreate{Name: "expired", ExpiresAt: &past})+ require.NoError(t, err)++ _, _, err = tRepos.APIKeys.GetUserFromToken(ctx, hasher.HashAPIKey(out.Token))+ require.Error(t, err, "an expired key must not authenticate")+}diff --git a/backend/internal/data/repo/repo_entities.go b/backend/internal/data/repo/repo_entities.goindex 8b894b2f..51baa435 100644--- a/backend/internal/data/repo/repo_entities.go+++ b/backend/internal/data/repo/repo_entities.go@@ -1520,6 +1520,23 @@ func (r *EntityRepository) UpdateByGroup(ctx context.Context, gid uuid.UUID, datreturn EntityOut{}, err}+ // The entity being updated must itself live in the caller's group. The+ // group predicate on the update below makes a cross-tenant ID a silent+ // no-op rather than an error, so without this guard execution falls+ // through to the field sync — which can only scope by entity ID — and+ // mutates a foreign group's fields before the scoped read at the end+ // turns the request into a 404. Fail closed up front instead, so any+ // edge added to this function later inherits the check.+ if data.ID == uuid.Nil {+ err := &ent.NotFoundError{}+ recordSpanError(span, err)+ return EntityOut{}, err+ }+ if err := assertEntityInGroup(ctx, r.db.Entity, gid, data.ID); err != nil {+ recordSpanError(span, err)+ return EntityOut{}, err+ }+// See EntityRepository.Create for the rationale on these cross-group// reference checks. Applied before the update so a rejected request never// mutates the row.@@ -1580,7 +1597,9 @@ func (r *EntityRepository) UpdateByGroup(ctx context.Context, gid uuid.UUID, dat}tagsCtx, tagsSpan := entityTracer().Start(ctx, "repo.EntityRepository.UpdateByGroup.tags")- currentTags, err := r.db.Entity.Query().Where(entity.ID(data.ID)).QueryTag().All(tagsCtx)+ currentTags, err := r.db.Entity.Query().+ Where(entity.ID(data.ID), entity.HasGroupWith(group.ID(gid))).+ QueryTag().All(tagsCtx)if err != nil {recordSpanError(tagsSpan, err)tagsSpan.End()@@ -1634,7 +1653,9 @@ func (r *EntityRepository) UpdateByGroup(ctx context.Context, gid uuid.UUID, datfieldsCtx, fieldsSpan := entityTracer().Start(ctx, "repo.EntityRepository.UpdateByGroup.fields",trace.WithAttributes(attribute.Int("fields.input.count", len(data.Fields))))- fields, err := r.db.EntityField.Query().Where(entityfield.HasEntityWith(entity.ID(data.ID))).All(fieldsCtx)+ fields, err := r.db.EntityField.Query().+ Where(entityfield.HasEntityWith(entity.ID(data.ID), entity.HasGroupWith(group.ID(gid)))).+ All(fieldsCtx)if err != nil {recordSpanError(fieldsSpan, err)fieldsSpan.End()@@ -1670,7 +1691,7 @@ func (r *EntityRepository) UpdateByGroup(ctx context.Context, gid uuid.UUID, datopt := r.db.EntityField.Update().Where(entityfield.ID(f.ID),- entityfield.HasEntityWith(entity.ID(data.ID)),+ entityfield.HasEntityWith(entity.ID(data.ID), entity.HasGroupWith(group.ID(gid))),).SetType(entityfield.Type(f.Type)).SetName(f.Name).@@ -1696,7 +1717,7 @@ func (r *EntityRepository) UpdateByGroup(ctx context.Context, gid uuid.UUID, datdeletedFields, err = r.db.EntityField.Delete().Where(entityfield.IDIn(fieldIds.Slice()...),- entityfield.HasEntityWith(entity.ID(data.ID)),+ entityfield.HasEntityWith(entity.ID(data.ID), entity.HasGroupWith(group.ID(gid))),).Exec(fieldsCtx)if err != nil {recordSpanError(fieldsSpan, err)diff --git a/backend/internal/data/repo/repo_entities_crosstenant_test.go b/backend/internal/data/repo/repo_entities_crosstenant_test.goindex 7339122b..93e698e0 100644--- a/backend/internal/data/repo/repo_entities_crosstenant_test.go+++ b/backend/internal/data/repo/repo_entities_crosstenant_test.go@@ -50,3 +50,79 @@ func TestEntityRepository_UpdateByGroup_CrossTenantLeak(t *testing.T) {require.NoError(t, err)assert.Equal(t, secretName, stillThere.Name, "victim entity must be unmodified")}++// TestEntityRepository_UpdateByGroup_CrossTenantFieldWrite guards the nested+// custom-field sync inside UpdateByGroup. The top-level record update is+// group-scoped and silently affects zero rows for a foreign entity ID, so+// execution used to fall through to the field block, which scoped its+// create/update/delete only by entity ID. An attacker could therefore wipe or+// inject fields on another tenant's entity — blindly, since the response is a+// 404 from the group-scoped read at the end.+func TestEntityRepository_UpdateByGroup_CrossTenantFieldWrite(t *testing.T) {+ ctx := context.Background()++ victimGroup, err := tRepos.Groups.GroupCreate(ctx, "victim-group-fields", uuid.Nil)+ require.NoError(t, err)++ victimET, err := tRepos.EntityTypes.GetDefault(ctx, victimGroup.ID, false)+ require.NoError(t, err)++ victim, err := tRepos.Entities.Create(ctx, victimGroup.ID, EntityCreate{+ Name: "victim-entity-with-fields",+ EntityTypeID: victimET.ID,+ })+ require.NoError(t, err)++ // Seed the victim entity with a custom field, as its own tenant would.+ const (+ fieldName = "license-key"+ fieldValue = "victim-secret-value"+ )+ seeded, err := tRepos.Entities.UpdateByGroup(ctx, victimGroup.ID, EntityUpdate{+ ID: victim.ID,+ Name: victim.Name,+ EntityTypeID: victimET.ID,+ Fields: []EntityFieldData{+ {Name: fieldName, Type: "text", TextValue: fieldValue},+ },+ })+ require.NoError(t, err)+ require.Len(t, seeded.Fields, 1)++ // Attacker (tGroup) submits an empty fields array against the victim's+ // entity UUID: the delete branch would remove every existing field.+ _, err = tRepos.Entities.UpdateByGroup(ctx, tGroup.ID, EntityUpdate{+ ID: victim.ID,+ Name: "poc-test",+ Fields: []EntityFieldData{},+ })+ require.Error(t, err, "cross-tenant update must be rejected")++ // Attacker attempts to inject a new field onto the victim's entity.+ _, err = tRepos.Entities.UpdateByGroup(ctx, tGroup.ID, EntityUpdate{+ ID: victim.ID,+ Name: "poc-test",+ Fields: []EntityFieldData{+ {Name: "attacker-injected", Type: "text", TextValue: "pwned"},+ },+ })+ require.Error(t, err, "cross-tenant update must be rejected")++ // Attacker attempts to overwrite the known field by ID.+ _, err = tRepos.Entities.UpdateByGroup(ctx, tGroup.ID, EntityUpdate{+ ID: victim.ID,+ Name: "poc-test",+ Fields: []EntityFieldData{+ {ID: seeded.Fields[0].ID, Name: fieldName, Type: "text", TextValue: "tampered"},+ },+ })+ require.Error(t, err, "cross-tenant update must be rejected")++ // The victim's fields must be exactly as seeded: not deleted, not added+ // to, and not modified.+ after, err := tRepos.Entities.GetOneByGroup(ctx, victimGroup.ID, victim.ID)+ require.NoError(t, err)+ require.Len(t, after.Fields, 1, "victim's custom fields must not be deleted or added to")+ assert.Equal(t, fieldName, after.Fields[0].Name)+ assert.Equal(t, fieldValue, after.Fields[0].TextValue, "victim's field value must not be tampered with")+}diff --git a/frontend/locales/en.json b/frontend/locales/en.jsonindex 40232f16..54dd117e 100644--- a/frontend/locales/en.json+++ b/frontend/locales/en.json@@ -798,7 +798,8 @@"api_key_name_placeholder": "e.g. Home Assistant","api_key_never_used": "Never","api_key_no_expiration": "No expiration",- "api_key_set_expiration": "Set an expiration date",+ "api_key_default_expiration": "Keys expire after 30 days unless you set a date.",+ "api_key_set_expiration": "Set a custom expiration date","api_key_token_label": "Your new API key","api_key_token_warning": "Copy this token now. For your security, it will not be shown again.","api_keys": "API Keys",diff --git a/frontend/pages/profile.vue b/frontend/pages/profile.vueindex 0af80bb1..dc9080fa 100644--- a/frontend/pages/profile.vue+++ b/frontend/pages/profile.vue@@ -259,6 +259,9 @@<div class="mb-2 max-w-[260px]"><FormCheckbox v-model="apiKeyForm.setExpiration" :label="$t('profile.api_key_set_expiration')" /></div>+ <p v-if="!apiKeyForm.setExpiration" class="mb-2 text-sm text-muted-foreground">+ {{ $t("profile.api_key_default_expiration") }}+ </p><div v-if="apiKeyForm.setExpiration" class="mb-2"><label class="mb-1 block text-sm font-medium">{{ $t("profile.api_key_expires_at") }}</label><input