feat(backend): implement HTTP API, auth, chat, and admin surfaces

Expose learning, registration controls, mentor chat, realtime WebSocket, and staff administration.
This commit is contained in:
ahp
2026-10-07 19:40:26 +03:30
parent 3ee609337c
commit 422e6ed289
58 changed files with 11756 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
package api
import (
"net/http"
"testing"
)
func TestRouteLabelRedactsSecrets(t *testing.T) {
cases := []struct {
path string
want string
}{
{"/api/exports/chats/abcSecretTokenXYZ", "/api/exports/chats/{token}"},
{"/api/auth/register-invite/invitetokensecret", "/api/auth/register-invite/{token}"},
{"/api/admin/users/42", "/api/admin/users/{id}"},
{"/api/lessons/7/heartbeat", "/api/lessons/{id}/heartbeat"},
}
for _, tc := range cases {
req, _ := http.NewRequest("GET", tc.path, nil)
got := routeLabel(req)
if got != tc.want {
t.Fatalf("path %s: got %q want %q", tc.path, got, tc.want)
}
}
}