From b1523f82c81320a56134f3b8016883a59532c370 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 28 Jun 2023 12:08:44 +1200 Subject: [PATCH] satellite/admin: add owner full name on /api/apikeys/{apikey} endpoint Updates storj/gateway-mt#321 Change-Id: I6759ec5dbba49261bb183e42d8cb333c326cb9e8 --- satellite/admin/README.md | 1 + satellite/admin/apikeys.go | 2 ++ satellite/admin/apikeys_test.go | 2 ++ 3 files changed, 5 insertions(+) diff --git a/satellite/admin/README.md b/satellite/admin/README.md index 3be60af33..ff0e01995 100644 --- a/satellite/admin/README.md +++ b/satellite/admin/README.md @@ -422,6 +422,7 @@ A successful response body: }, "owner": { "id": "12345678-1234-1234-1234-123456789abc", + "fullName": "test user", "email": "bob@example.test", "paidTier": true } diff --git a/satellite/admin/apikeys.go b/satellite/admin/apikeys.go index 22f7eaa2c..72feda81b 100644 --- a/satellite/admin/apikeys.go +++ b/satellite/admin/apikeys.go @@ -164,6 +164,7 @@ func (server *Server) getAPIKey(w http.ResponseWriter, r *http.Request) { } type ownerData struct { ID uuid.UUID `json:"id"` + FullName string `json:"fullName"` Email string `json:"email"` PaidTier bool `json:"paidTier"` } @@ -184,6 +185,7 @@ func (server *Server) getAPIKey(w http.ResponseWriter, r *http.Request) { }, Owner: ownerData{ ID: user.ID, + FullName: user.FullName, Email: user.Email, PaidTier: user.PaidTier, }, diff --git a/satellite/admin/apikeys_test.go b/satellite/admin/apikeys_test.go index 1f97dd801..afbf0f423 100644 --- a/satellite/admin/apikeys_test.go +++ b/satellite/admin/apikeys_test.go @@ -315,6 +315,7 @@ func TestAPIKeyManagementGet(t *testing.T) { } type ownerData struct { ID uuid.UUID `json:"id"` + FullName string `json:"fullName"` Email string `json:"email"` PaidTier bool `json:"paidTier"` } @@ -339,6 +340,7 @@ func TestAPIKeyManagementGet(t *testing.T) { }, Owner: ownerData{ ID: user.ID, + FullName: "testuser123", Email: "test@email.com", PaidTier: true, },