satellite/admin: add owner full name on /api/apikeys/{apikey} endpoint

Updates storj/gateway-mt#321

Change-Id: I6759ec5dbba49261bb183e42d8cb333c326cb9e8
This commit is contained in:
Sean Harvey 2023-06-28 12:08:44 +12:00
parent d06e4589ae
commit b1523f82c8
No known key found for this signature in database
GPG Key ID: D917C00695250311
3 changed files with 5 additions and 0 deletions

View File

@ -422,6 +422,7 @@ A successful response body:
},
"owner": {
"id": "12345678-1234-1234-1234-123456789abc",
"fullName": "test user",
"email": "bob@example.test",
"paidTier": true
}

View File

@ -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,
},

View File

@ -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,
},