From c4aa600096278ef76c6bd1b50725f23f17ee0273 Mon Sep 17 00:00:00 2001 From: reoring Date: Tue, 10 Nov 2026 12:46:30 +0900 Subject: [PATCH] appserver-go v0.5.0: read Project roles from the roles array Platform #6519 replaced the Project access response's role with roles[]. With the old SDK every user lost the admin and app-creation flags. --- cmd/server/internal/api/api_test.go | 2 +- cmd/server/server_test.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/server/internal/api/api_test.go b/cmd/server/internal/api/api_test.go index 455e743..6b56ac9 100644 --- a/cmd/server/internal/api/api_test.go +++ b/cmd/server/internal/api/api_test.go @@ -64,7 +64,7 @@ func newHarness(t *testing.T) *harness { w.WriteHeader(status) return } - httpx.WriteJSON(w, 200, map[string]any{"member": true, "role": role}) + httpx.WriteJSON(w, 200, map[string]any{"member": true, "roles": []string{role}, "actions": []string{}}) case "/api/v1/projects/pj-test/source-connections": httpx.WriteJSON(w, 200, map[string]any{"data": []any{map[string]string{"id": "pending", "status": "incomplete"}, map[string]string{"id": "github", "status": "ready"}}}) case "/api/v1/registry-connections": diff --git a/cmd/server/server_test.go b/cmd/server/server_test.go index 44899b0..6dc1bd0 100644 --- a/cmd/server/server_test.go +++ b/cmd/server/server_test.go @@ -525,7 +525,7 @@ func TestServedOpenAPIEqualsCommittedContract(t *testing.T) { w.WriteHeader(http.StatusForbidden) return } - writeJSON(w, 200, map[string]any{"member": true, "role": "Viewer"}) + writeJSON(w, 200, map[string]any{"member": true, "roles": []string{"Viewer"}, "actions": []string{}}) default: t.Errorf("unexpected platform route %s", r.URL.Path) w.WriteHeader(http.StatusNotFound) diff --git a/go.mod b/go.mod index 50cde9e..351e0cb 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/appthrust/builder-console go 1.26.0 require ( - github.com/appthrust/appserver-go v0.3.0 + github.com/appthrust/appserver-go v0.5.0 github.com/google/uuid v1.6.0 github.com/lib/pq v1.12.3 github.com/stretchr/testify v1.11.1 diff --git a/go.sum b/go.sum index 602d705..e72f653 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/appthrust/appserver-go v0.3.0 h1:zxOz0hkspZSXjLq3KWGDLkZIz42Jag6wqRujZ8lTru0= -github.com/appthrust/appserver-go v0.3.0/go.mod h1:0KSf9RQZ6OxBcE0lxYzzjKF37nfwbKps3wXUGlE0oFo= +github.com/appthrust/appserver-go v0.5.0 h1:MrQBL5rMvBEOsGc9vGiGV3cVOEZuSjIf2CkismPO2mo= +github.com/appthrust/appserver-go v0.5.0/go.mod h1:0KSf9RQZ6OxBcE0lxYzzjKF37nfwbKps3wXUGlE0oFo= github.com/coreos/go-oidc/v3 v3.20.0 h1:EtE0WIBHk03N+DqGkY4+UONzzZHk7amKt6IyNd7OsZE= github.com/coreos/go-oidc/v3 v3.20.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=