mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
refactor: rename the Go module to github.com/J3vb/OwnCord/Server (RL-13)
`Server/go.mod` declared `github.com/owncord/server` while the public repository is `github.com/J3vb/OwnCord`. Nothing resolves that path — there is no `owncord` GitHub org and no vanity-import host serving go-import metadata for it — so every import line in the tree named a location that does not exist. It compiles because a main module's own path is never fetched, which is exactly why it went unnoticed. The obvious fix — an AST-aware import rewriter (`gomvpkg`, `go mod edit`) — is wrong here, and provably so. Six of the 722 occurrences are not imports at all: `api/main_test.go:20` (a goleak `IgnoreTopFunction` pattern), `telemetry/metrics.go:17-19` (three OTel instrumentation-scope names), `invariants/syncutil_locks.go:73` (a diagnostic message), and `invariants/syncutil_locks_test.go:56` (an import line inside a raw-string Go fixture). An import rewriter touches none of them, and the compiler cannot see any of them either. Done as one scripted substitution over `git ls-files`, anchored on the full `github.com/owncord/server` string. The anchor matters: `owncord-server` is a different identifier — the OTel `service.name` (`config/config.go`, `telemetry/telemetry_otel.go`) and the GHCR image name (`.github/workflows/release.yml`, `docker-compose.yml`) — and a looser pattern would have moved it. It is untouched: 10 occurrences across 9 files, before and after. 350 files, 728 insertions, 728 deletions. 722 occurrences in 344 Go files, plus `go.mod:1`, the `sed` at `Makefile:67`, `Server/CLAUDE.md:3`, `docs/architecture/server.md:5`, and the ledger pair (`findings-ledger.json:3758` plus a `render-ledger.mjs` re-render of `FINDINGS.md`). Zero in any workflow, zero in the Dockerfile, zero in `Server/.golangci.yml` (no `local-prefixes`, `gci`, `importas` or `depguard` rule keys on the module path, so import grouping is not configured anywhere). The plan's blast-radius estimate missed one thing, and it is the one that would have gone red: **gofmt**. `J` (0x4A) sorts before every lowercase letter, so in the 36 files where a module-local import shares a contiguous group with a third-party one, the module's imports must move above `github.com/go-chi/...`. `gofmt -l` was clean before the substitution and listed exactly 36 files after it; `gofmt -w` on those 36 restores it to clean. `gofmt` is an enforced gate — the `formatters` block in `Server/.golangci.yml`, which is S-05 — so a substitution-only commit fails Lint. Verified: both directions, and the line accounting is exact. Every added line in this diff contains the new module path (728) and every removed line contains the old one (728); the count of changed lines containing neither is **zero**, so the gofmt re-sort moved module-path lines only and touched no third-party import. The residual check (`git ls-files -z | xargs -0 grep -n 'github\.com/owncord/server'`) returns exactly two hits, both deliberately out of scope: the RL-13 row in `docs/audit-2026-08-23-repository-layout.md` and the measurement row in this phase's own plan. The compiler-invisible half was proven by reverting *only* `api/main_test.go:20` to the old path on the otherwise-renamed tree: `go build ./...` and `go vet ./api/` both still pass — they see nothing wrong — while `go test ./api/` FAILS, because the runtime function name now carries the new path and goleak stops ignoring `ws.(*Hub).Run.func1`. Restoring the line makes it pass. `go.sum` is byte-identical (no `go mod tidy` was run and none was needed). All four build-tag variants compile; `go vet ./...`, `go vet -tags otel,wazero ./...` and `go vet -tags deadlock ./...` pass; `go test -race ./...` is 16/16 packages green; `go test -tags deadlock ./...` passes; the tag-gated `./plugin/...` (wazero) and `./telemetry/...` (otel) runs pass. `golangci-lint` v2.11.3 — the pinned CI version, rebuilt locally against Go 1.26 because the packaged binary cannot load a 1.26 config — reports **0 issues**. `go run ./cmd/genprotocol` leaves `git diff --exit-code ws/message_types.go ../Client/src/lib/protocolTypes.ts` clean, so the rename does not reach the generated protocol constants. `npx prettier --check .` and `node .superpowers/render-ledger.mjs --check` pass. Not included: `docs/audit-2026-08-23-repository-layout.md` and `docs/plans/b1-repository-foundation-2026-08-25.md` keep the old path — they are the audit row and the measurement that motivated this change, and rewriting them would erase the record of what was measured. They are why the residual check needs a two-path allowance rather than being empty; that allowance is stated above rather than hidden in a pathspec. `telemetry/metrics.go:19` declares `scopeVoice` for a `Server/voice` package that does not exist; the substitution carried the dead path forward verbatim as `github.com/J3vb/OwnCord/Server/voice` rather than fixing it, because correcting a real observability bug inside a mechanical rename would hide it in a 350-file diff. It needs its own item. No `go.work`, no second module, and no vanity-import host was set up — the new path resolves against the real repository, but nothing imports this module as a library, so `go get` reachability was not exercised either way. Refs RL-13, L-12
This commit is contained in:
Generated
+1
-1
@@ -4722,7 +4722,7 @@ Server/api/auth_handler.go:470 user, err := database.GetUserByUsername(r.Context
|
|||||||
|
|
||||||
bluemonday v1.0.27 sanitize.go:417-443 — case html.TextToken: default: buff.WriteString(token.String()) // x/net/html TextToken.String() == EscapeString(Data)
|
bluemonday v1.0.27 sanitize.go:417-443 — case html.TextToken: default: buff.WriteString(token.String()) // x/net/html TextToken.String() == EscapeString(Data)
|
||||||
|
|
||||||
**Suggested fix:** In Server/admin/setup_handler.go:175 use the same fixpoint sanitizer as registration: `req.Username = strings.TrimSpace(service.SanitizeText(req.Username))` (Server/service/message.go:214). Server/admin already imports github.com/owncord/server/service (admin.go:12) and service does not import admin, so there is no cycle. One line, in the one place setup canonicalizes the username.
|
**Suggested fix:** In Server/admin/setup_handler.go:175 use the same fixpoint sanitizer as registration: `req.Username = strings.TrimSpace(service.SanitizeText(req.Username))` (Server/service/message.go:214). Server/admin already imports github.com/J3vb/OwnCord/Server/service (admin.go:12) and service does not import admin, so there is no cycle. One line, in the one place setup canonicalizes the username.
|
||||||
|
|
||||||
**Fixed:** `29619536` · test `Server/admin/setup_handler_test.go` · revert-proof pass
|
**Fixed:** `29619536` · test `Server/admin/setup_handler_test.go` · revert-proof pass
|
||||||
|
|
||||||
|
|||||||
@@ -3755,7 +3755,7 @@
|
|||||||
"test": "Server/admin/setup_handler_test.go",
|
"test": "Server/admin/setup_handler_test.go",
|
||||||
"revertProof": "pass"
|
"revertProof": "pass"
|
||||||
},
|
},
|
||||||
"suggestedFix": "In Server/admin/setup_handler.go:175 use the same fixpoint sanitizer as registration: `req.Username = strings.TrimSpace(service.SanitizeText(req.Username))` (Server/service/message.go:214). Server/admin already imports github.com/owncord/server/service (admin.go:12) and service does not import admin, so there is no cycle. One line, in the one place setup canonicalizes the username.",
|
"suggestedFix": "In Server/admin/setup_handler.go:175 use the same fixpoint sanitizer as registration: `req.Username = strings.TrimSpace(service.SanitizeText(req.Username))` (Server/service/message.go:214). Server/admin already imports github.com/J3vb/OwnCord/Server/service (admin.go:12) and service does not import admin, so there is no cycle. One line, in the one place setup canonicalizes the username.",
|
||||||
"fixedDate": "2026-08-19"
|
"fixedDate": "2026-08-19"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# OwnCord Server (Go)
|
# OwnCord Server (Go)
|
||||||
|
|
||||||
Go 1.26, module `github.com/owncord/server`. Key deps: chi (HTTP), koanf
|
Go 1.26, module `github.com/J3vb/OwnCord/Server`. Key deps: chi (HTTP), koanf
|
||||||
(config), sqlc-generated SQLite layer, LiveKit server SDK, coraza WAF,
|
(config), sqlc-generated SQLite layer, LiveKit server SDK, coraza WAF,
|
||||||
prometheus.
|
prometheus.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -64,7 +64,7 @@ cover-all:
|
|||||||
go test -count=1 -coverpkg=./... -coverprofile=coverage-all.out ./...
|
go test -count=1 -coverpkg=./... -coverprofile=coverage-all.out ./...
|
||||||
@echo
|
@echo
|
||||||
@echo "── functions with no coverage ──────────────────────────────────────"
|
@echo "── functions with no coverage ──────────────────────────────────────"
|
||||||
@go tool cover -func=coverage-all.out | awk '$$NF=="0.0%"' | sed 's|github.com/owncord/server/||'
|
@go tool cover -func=coverage-all.out | awk '$$NF=="0.0%"' | sed 's|github.com/J3vb/OwnCord/Server/||'
|
||||||
@echo
|
@echo
|
||||||
@go tool cover -func=coverage-all.out | tail -1
|
@go tool cover -func=coverage-all.out | tail -1
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import (
|
|||||||
"io/fs"
|
"io/fs"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
|
"github.com/J3vb/OwnCord/Server/updater"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
"github.com/owncord/server/updater"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed static
|
//go:embed static
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/updater"
|
"github.com/J3vb/OwnCord/Server/updater"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── NewHandler ───────────────────────────────────────────────────────────────
|
// ─── NewHandler ───────────────────────────────────────────────────────────────
|
||||||
|
|||||||
+5
-5
@@ -4,12 +4,12 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
|
"github.com/J3vb/OwnCord/Server/updater"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/permissions"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
"github.com/owncord/server/updater"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// setupLimiterReapInterval and setupLimiterReapMaxWindow control how often
|
// setupLimiterReapInterval and setupLimiterReapMaxWindow control how often
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── handlePatchUser — self-modification guard ─────────────────────────────
|
// ─── handlePatchUser — self-modification guard ─────────────────────────────
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"testing/fstest"
|
"testing/fstest"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
"github.com/owncord/server/service"
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
// newTestModService builds a real ModerationService over the test database so
|
// newTestModService builds a real ModerationService over the test database so
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Scheduled-backup intervals for the backup_schedule setting values the admin
|
// Scheduled-backup intervals for the backup_schedule setting values the admin
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func listBackupFiles(t *testing.T, dir string) []string {
|
func listBackupFiles(t *testing.T, dir string) []string {
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Archiving a voice channel hides it from every client the same way deleting
|
// Archiving a voice channel hides it from every client the same way deleting
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BroadcastRolesForTest exposes broadcastRoles for external tests. It builds
|
// BroadcastRolesForTest exposes broadcastRoles for external tests. It builds
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/db"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// backupBaseDir is the directory for backup files, resolved to an absolute
|
// backupBaseDir is the directory for backup files, resolved to an absolute
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// chdirTemp changes the working directory to a fresh temp directory for the
|
// chdirTemp changes the working directory to a fresh temp directory for the
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Channel Permission Override Handlers ────────────────────────────────────
|
// ─── Channel Permission Override Handlers ────────────────────────────────────
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// mockPermInvalidator records permission-cache invalidation calls.
|
// mockPermInvalidator records permission-cache invalidation calls.
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── PUT/DELETE /channels/{id}/user-permissions/{userId} ─────────────────────
|
// ─── PUT/DELETE /channels/{id}/user-permissions/{userId} ─────────────────────
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"slices"
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Channel Type Validation ─────────────────────────────────────────────────
|
// ─── Channel Type Validation ─────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Channel-type validation (via POST /channels) ───────────────────────────
|
// ─── Channel-type validation (via POST /channels) ───────────────────────────
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/service"
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Role Handlers ───────────────────────────────────────────────────────────
|
// ─── Role Handlers ───────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The admin test schema seeds Owner (id 1, pos 100, ADMINISTRATOR), Admin
|
// The admin test schema seeds Owner (id 1, pos 100, ADMINISTRATOR), Admin
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Settings Handlers ──────────────────────────────────────────────────────
|
// ─── Settings Handlers ──────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── API Token Handlers ──────────────────────────────────────────────────────
|
// ─── API Token Handlers ──────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
"github.com/owncord/server/service"
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── User Handlers ───────────────────────────────────────────────────────────
|
// ─── User Handlers ───────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A PATCH combining banned + role_id must be all-or-nothing: if the role
|
// A PATCH combining banned + role_id must be all-or-nothing: if the role
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// unbanMockHub wraps mockHub (admin/api_test.go) and additionally implements
|
// unbanMockHub wraps mockHub (admin/api_test.go) and additionally implements
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
"github.com/owncord/server/service"
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
// failingMembersStore makes exactly the role-member lookup fail, the way a
|
// failingMembersStore makes exactly the role-member lookup fail, the way a
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/db"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package admin
|
package admin
|
||||||
|
|
||||||
import "github.com/owncord/server/ws"
|
import "github.com/J3vb/OwnCord/Server/ws"
|
||||||
|
|
||||||
// OC-0058: handlePatchUser reaches BroadcastMemberUnban through a type
|
// OC-0058: handlePatchUser reaches BroadcastMemberUnban through a type
|
||||||
// assertion, which fails silently if *ws.Hub ever loses (or never had) the
|
// assertion, which fails silently if *ws.Hub ever loses (or never had) the
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
"github.com/owncord/server/syncutil"
|
"github.com/J3vb/OwnCord/Server/syncutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Ticket Store for SSE Log Stream ────────────────────────────────────────
|
// ─── Ticket Store for SSE Log Stream ────────────────────────────────────────
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestAdminAPI_LogStreamTicketFlow_APIToken verifies that an API-token
|
// TestAdminAPI_LogStreamTicketFlow_APIToken verifies that an API-token
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// handleLogStream's backfill loop does a DB round-trip per entry between
|
// handleLogStream's backfill loop does a DB round-trip per entry between
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
type revokingSSEWriter struct {
|
type revokingSSEWriter struct {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"go.uber.org/goleak"
|
"go.uber.org/goleak"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Middleware ───────────────────────────────────────────────────────────────
|
// ─── Middleware ───────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"testing/fstest"
|
"testing/fstest"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/updater"
|
"github.com/J3vb/OwnCord/Server/updater"
|
||||||
)
|
)
|
||||||
|
|
||||||
// openWhiteboxTestDB opens an in-memory SQLite database for whitebox tests.
|
// openWhiteboxTestDB opens an in-memory SQLite database for whitebox tests.
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── adminAuthMiddleware edge cases ──────────────────────────────────────────
|
// ─── adminAuthMiddleware edge cases ──────────────────────────────────────────
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestAdminAuthMiddleware_DBErrorIsNotUnauthorized verifies that when
|
// TestAdminAuthMiddleware_DBErrorIsNotUnauthorized verifies that when
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The multiHandler tees every server log record into the admin panel's live
|
// The multiHandler tees every server log record into the admin panel's live
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// moderatorMask is migration 001's seeded Moderator role: MANAGE_MESSAGES,
|
// moderatorMask is migration 001's seeded Moderator role: MANAGE_MESSAGES,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The admin panel's role editor renders one checkbox per permission bit from a
|
// The admin panel's role editor renders one checkbox per permission bit from a
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/updater"
|
"github.com/J3vb/OwnCord/Server/updater"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── The restart handoff: swap success paths and the serialization guard ────
|
// ─── The restart handoff: swap success paths and the serialization guard ────
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestSetup_HonoursTrustedProxies pins OC-0274: first-run setup must resolve
|
// TestSetup_HonoursTrustedProxies pins OC-0274: first-run setup must resolve
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/service"
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ownerRoleID is the role ID assigned to the first user (Owner).
|
// ownerRoleID is the role ID assigned to the first user (Owner).
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSetupStatus_NeedsSetup(t *testing.T) {
|
func TestSetupStatus_NeedsSetup(t *testing.T) {
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestSetupLimiter_ReapsStaleEntries pins OC-0076: setupLimiter — the
|
// TestSetupLimiter_ReapsStaleEntries pins OC-0076: setupLimiter — the
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
)
|
)
|
||||||
|
|
||||||
// These two tests pin OC-0253: once CreateOwnerIfEmpty has committed the
|
// These two tests pin OC-0253: once CreateOwnerIfEmpty has committed the
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/service"
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── SetupOptions ────────────────────────────────────────────────────────────
|
// ─── SetupOptions ────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// wizardRunningCfg mimics the config a fresh server boots with: file defaults
|
// wizardRunningCfg mimics the config a fresh server boots with: file defaults
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package admin
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Context keys ─────────────────────────────────────────────────────────────
|
// ─── Context keys ─────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/updater"
|
"github.com/J3vb/OwnCord/Server/updater"
|
||||||
"golang.org/x/mod/semver"
|
"golang.org/x/mod/semver"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/admin"
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/updater"
|
"github.com/J3vb/OwnCord/Server/updater"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAdminAPI_CheckUpdate_OK(t *testing.T) {
|
func TestAdminAPI_CheckUpdate_OK(t *testing.T) {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/permissions"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// maxLoginUsernameLen bounds the username accepted by handleLogin, mirroring
|
// maxLoginUsernameLen bounds the username accepted by handleLogin, mirroring
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// recordingAuthBroadcaster records BroadcastMemberBan calls so tests can
|
// recordingAuthBroadcaster records BroadcastMemberBan calls so tests can
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ import (
|
|||||||
"testing/fstest"
|
"testing/fstest"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// newAuthTestDB builds an in-memory DB with the full schema needed for auth tests.
|
// newAuthTestDB builds an in-memory DB with the full schema needed for auth tests.
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
|
"github.com/J3vb/OwnCord/Server/storage"
|
||||||
|
"github.com/J3vb/OwnCord/Server/ws"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
"github.com/owncord/server/storage"
|
|
||||||
"github.com/owncord/server/ws"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Avatar upload. The interesting properties are the ones a URL-only avatar
|
// Avatar upload. The interesting properties are the ones a URL-only avatar
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── GET /api/v1/channels/{id}/messages/around/{messageId} ───────────────────
|
// ─── GET /api/v1/channels/{id}/messages/around/{messageId} ───────────────────
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Authorization tests for channel read access (REST) ─────────────────────
|
// ─── Authorization tests for channel read access (REST) ─────────────────────
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"testing/fstest"
|
"testing/fstest"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── schema for channel tests ─────────────────────────────────────────────────
|
// ─── schema for channel tests ─────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── GET /api/v1/channels/{id}/messages/{messageId}/reactions/{emoji}/users ──
|
// ─── GET /api/v1/channels/{id}/messages/{messageId}/reactions/{emoji}/users ──
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/updater"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/updater"
|
|
||||||
"golang.org/x/mod/semver"
|
"golang.org/x/mod/semver"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/updater"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/updater"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// fakeGitHubRelease returns a test HTTP server that mimics the GitHub
|
// fakeGitHubRelease returns a test HTTP server that mimics the GitHub
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Rate limits ────────────────────────────────────────────────────────────
|
// ─── Rate limits ────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── handleCreateInvite: malformed JSON body ────────────────────────────────
|
// ─── handleCreateInvite: malformed JSON body ────────────────────────────────
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
"github.com/owncord/server/ws"
|
"github.com/J3vb/OwnCord/Server/ws"
|
||||||
)
|
)
|
||||||
|
|
||||||
// diagnosticsResponse is returned by GET /api/v1/diagnostics/connectivity.
|
// diagnosticsResponse is returned by GET /api/v1/diagnostics/connectivity.
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/api"
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// setupDiagnosticsRouter creates a full router with an authenticated user for
|
// setupDiagnosticsRouter creates a full router with an authenticated user for
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── helpers ────────────────────────────────────────────────────────────────
|
// ─── helpers ────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
|
"github.com/J3vb/OwnCord/Server/ws"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
"github.com/owncord/server/ws"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// DMBroadcaster is the interface needed to send WebSocket events from REST
|
// DMBroadcaster is the interface needed to send WebSocket events from REST
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// cancelAfterBlockStore wraps a real in-memory *db.DB and cancels an
|
// cancelAfterBlockStore wraps a real in-memory *db.DB and cancels an
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// OC-0304: POST /dms must apply the same "no live connection is offline,
|
// OC-0304: POST /dms must apply the same "no live connection is offline,
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// cancelAfterArm is a context.Context whose Done()/Err() behave as
|
// cancelAfterArm is a context.Context whose Done()/Err() behave as
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"testing/fstest"
|
"testing/fstest"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── DM test schema ─────────────────────────────────────────────────────────
|
// ─── DM test schema ─────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/api"
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/service"
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
// OC-0140: broadcastDMOpen is called with r.Context() by CreateGroupDM (and
|
// OC-0140: broadcastDMOpen is called with r.Context() by CreateGroupDM (and
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EmojiBroadcaster is the slice of the hub the emoji routes need: after every
|
// EmojiBroadcaster is the slice of the hub the emoji routes need: after every
|
||||||
|
|||||||
@@ -17,13 +17,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
|
"github.com/J3vb/OwnCord/Server/storage"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/permissions"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
"github.com/owncord/server/storage"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── harness ─────────────────────────────────────────────────────────────────
|
// ─── harness ─────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/owncord/server/service"
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/owncord/server/ws"
|
"github.com/J3vb/OwnCord/Server/ws"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BroadcastDMOpenForTest exposes broadcastDMOpen for external tests.
|
// BroadcastDMOpenForTest exposes broadcastDMOpen for external tests.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package api
|
|||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/owncord/server/storage"
|
"github.com/J3vb/OwnCord/Server/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FileStore is the consumer-side seam over blob storage, following the repo's
|
// FileStore is the consumer-side seam over blob storage, following the repo's
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/plugin"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/config"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/plugin"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// gifAPIBase is the upstream Klipy API root. It is a var only so tests can
|
// gifAPIBase is the upstream Klipy API root. It is a var only so tests can
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/config"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/permissions"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// createInviteRequest is the JSON body for POST /api/v1/invites.
|
// createInviteRequest is the JSON body for POST /api/v1/invites.
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/permissions"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// buildInviteRouter returns a chi router with invite routes and auth middleware.
|
// buildInviteRouter returns a chi router with invite routes and auth middleware.
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ import (
|
|||||||
"github.com/livekit/protocol/livekit"
|
"github.com/livekit/protocol/livekit"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
"github.com/owncord/server/api"
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
"github.com/owncord/server/ws"
|
"github.com/J3vb/OwnCord/Server/ws"
|
||||||
)
|
)
|
||||||
|
|
||||||
// proxyWebSocket and copyWS carry every LiveKit signaling frame between the
|
// proxyWebSocket and copyWS carry every LiveKit signaling frame between the
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
func okHandler(w http.ResponseWriter, r *http.Request) {
|
func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"go.uber.org/goleak"
|
"go.uber.org/goleak"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
@@ -17,6 +17,6 @@ func TestMain(m *testing.M) {
|
|||||||
// Hub.Run starts long-lived goroutines that are stopped via Hub.Stop().
|
// Hub.Run starts long-lived goroutines that are stopped via Hub.Stop().
|
||||||
// API tests create routers (which start hubs) but don't always call
|
// API tests create routers (which start hubs) but don't always call
|
||||||
// Stop() — these are expected background goroutines, not leaks.
|
// Stop() — these are expected background goroutines, not leaks.
|
||||||
goleak.IgnoreTopFunction("github.com/owncord/server/ws.(*Hub).Run.func1"),
|
goleak.IgnoreTopFunction("github.com/J3vb/OwnCord/Server/ws.(*Hub).Run.func1"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// buildMetricsRouter creates a chi router with the metrics endpoint behind AdminIPRestrict.
|
// buildMetricsRouter creates a chi router with the metrics endpoint behind AdminIPRestrict.
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// contextKey is an unexported type for context keys in this package.
|
// contextKey is an unexported type for context keys in this package.
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ import (
|
|||||||
"testing/fstest"
|
"testing/fstest"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/api"
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/permissions"
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/plugin"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/plugin"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// maxPluginUploadBytes caps the multipart upload at 16 MiB to match the
|
// maxPluginUploadBytes caps the multipart upload at 16 MiB to match the
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
"github.com/owncord/server/plugin"
|
"github.com/J3vb/OwnCord/Server/plugin"
|
||||||
)
|
)
|
||||||
|
|
||||||
// openPluginTestDB opens an in-memory database with the full migration set so
|
// openPluginTestDB opens an in-memory database with the full migration set so
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
|
"github.com/J3vb/OwnCord/Server/ws"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
"github.com/owncord/server/ws"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── Request / Response types ────────────────────────────────────────────────
|
// ─── Request / Response types ────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// identityKeyFailStore wraps a real *db.DB and fails only
|
// identityKeyFailStore wraps a real *db.DB and fails only
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/owncord/server/api"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// buildProfileRouter returns a chi router with profile routes mounted.
|
// buildProfileRouter returns a chi router with profile routes mounted.
|
||||||
|
|||||||
+14
-14
@@ -12,22 +12,22 @@ import (
|
|||||||
"slices"
|
"slices"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/J3vb/OwnCord/Server/admin"
|
||||||
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
|
"github.com/J3vb/OwnCord/Server/diskutil"
|
||||||
|
"github.com/J3vb/OwnCord/Server/permissions"
|
||||||
|
"github.com/J3vb/OwnCord/Server/plugin"
|
||||||
|
"github.com/J3vb/OwnCord/Server/service"
|
||||||
|
"github.com/J3vb/OwnCord/Server/stackutil"
|
||||||
|
"github.com/J3vb/OwnCord/Server/storage"
|
||||||
|
"github.com/J3vb/OwnCord/Server/syncutil"
|
||||||
|
"github.com/J3vb/OwnCord/Server/telemetry"
|
||||||
|
"github.com/J3vb/OwnCord/Server/updater"
|
||||||
|
"github.com/J3vb/OwnCord/Server/ws"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/go-chi/chi/v5/middleware"
|
"github.com/go-chi/chi/v5/middleware"
|
||||||
"github.com/owncord/server/admin"
|
|
||||||
"github.com/owncord/server/auth"
|
|
||||||
"github.com/owncord/server/config"
|
|
||||||
"github.com/owncord/server/db"
|
|
||||||
"github.com/owncord/server/diskutil"
|
|
||||||
"github.com/owncord/server/permissions"
|
|
||||||
"github.com/owncord/server/plugin"
|
|
||||||
"github.com/owncord/server/service"
|
|
||||||
"github.com/owncord/server/stackutil"
|
|
||||||
"github.com/owncord/server/storage"
|
|
||||||
"github.com/owncord/server/syncutil"
|
|
||||||
"github.com/owncord/server/telemetry"
|
|
||||||
"github.com/owncord/server/updater"
|
|
||||||
"github.com/owncord/server/ws"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewRouter builds and returns the fully configured HTTP handler, the
|
// NewRouter builds and returns the fully configured HTTP handler, the
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ import (
|
|||||||
|
|
||||||
"github.com/coder/websocket"
|
"github.com/coder/websocket"
|
||||||
|
|
||||||
"github.com/owncord/server/api"
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// dialAndAuthWS opens a WS connection against srv and completes the auth
|
// dialAndAuthWS opens a WS connection against srv and completes the auth
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ import (
|
|||||||
|
|
||||||
"github.com/coder/websocket"
|
"github.com/coder/websocket"
|
||||||
|
|
||||||
"github.com/owncord/server/api"
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// voiceJoinWSMsg builds a raw voice_join WebSocket frame for the given channel.
|
// voiceJoinWSMsg builds a raw voice_join WebSocket frame for the given channel.
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/api"
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// setupRouter creates a test router with an in-memory database.
|
// setupRouter creates a test router with an in-memory database.
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ package api_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/owncord/server/api"
|
"github.com/J3vb/OwnCord/Server/api"
|
||||||
"github.com/owncord/server/config"
|
"github.com/J3vb/OwnCord/Server/config"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestNewRouterRefusesToStartWithMalformedTOTPKey pins OC-0228: a malformed
|
// TestNewRouterRefusesToStartWithMalformedTOTPKey pins OC-0228: a malformed
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncord/server/auth"
|
"github.com/J3vb/OwnCord/Server/auth"
|
||||||
"github.com/owncord/server/db"
|
"github.com/J3vb/OwnCord/Server/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ─── TOTP request/response types ─────────────────────────────────────────────
|
// ─── TOTP request/response types ─────────────────────────────────────────────
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user