Add self-info endpoint for ProjectConfigurator discovery, sync shared updates
GET /api/info reports name/tabs/mount types (empty - state lives in Postgres, no shared file mounts) so ProjectConfigurator's Projects workspace can register this instance from just a URL. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
557a61b4ee
commit
bbf5d8bb05
126 files changed
+2897
-8542
No files matched your search
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
|
||||
"mediacollection/internal/database"
|
||||
"repos.gfranz.ch/Gabriel20xx/shared/media-backend/internal/database"
|
||||
)
|
||||
|
||||
// testPool returns a connection pool against a real (throwaway) Postgres
|
||||
@@ -129,7 +129,7 @@ func newRequest(method, target string, body string) *http.Request {
|
||||
}
|
||||
|
||||
func TestCurrentUserDisabledModeReturnsLocalSuperadmin(t *testing.T) {
|
||||
svc := New(nil, "mediacollection_session", false, "")
|
||||
svc := New(nil, "session", false, "")
|
||||
user, err := svc.CurrentUser(httptest.NewRequest(http.MethodGet, "/", nil))
|
||||
if err != nil {
|
||||
t.Fatalf("CurrentUser() error = %v", err)
|
||||
@@ -143,7 +143,7 @@ func TestSignupLoginLogoutProxyToAuthGuard(t *testing.T) {
|
||||
pool := testPool(t)
|
||||
guard := newFakeAuthGuard()
|
||||
defer guard.close()
|
||||
svc := New(pool, "mediacollection_session", false, guard.server.URL)
|
||||
svc := New(pool, "session", false, guard.server.URL)
|
||||
ctx := context.Background()
|
||||
|
||||
// Signup
|
||||
@@ -207,7 +207,7 @@ func TestSecondProjectSetupIsRejectedWhenAuthGuardAlreadyHasAnAccount(t *testing
|
||||
guard.hasAccount = true // simulate a different project (or AuthGuard's own web UI) having already created one
|
||||
guard.username, guard.email, guard.role, guard.password = "existing", "existing@example.com", "superadmin", "hunter2!!"
|
||||
|
||||
svc := New(pool, "mediacollection_session", false, guard.server.URL)
|
||||
svc := New(pool, "session", false, guard.server.URL)
|
||||
req := newRequest(http.MethodPost, "/auth/signup", `{"email":"new@example.com","username":"new","password":"correct horse battery staple"}`)
|
||||
rec := httptest.NewRecorder()
|
||||
svc.Signup(rec, req)
|
||||
@@ -223,7 +223,7 @@ func TestSecondProjectSetupIsRejectedWhenAuthGuardAlreadyHasAnAccount(t *testing
|
||||
|
||||
func TestLoginRequiredToggleIsIndependentOfAuthGuard(t *testing.T) {
|
||||
pool := testPool(t)
|
||||
svc := New(pool, "mediacollection_session", false, "")
|
||||
svc := New(pool, "session", false, "")
|
||||
|
||||
required, err := svc.LoginRequired(context.Background())
|
||||
if err != nil || !required {
|
||||
|
||||
Reference in new issue
Block a user