From 12e53a1468f51a7687e54018d8caf463a05432b3 Mon Sep 17 00:00:00 2001 From: Cesar N Date: Wed, 18 Nov 2020 16:16:06 -0800 Subject: [PATCH] Remove minio root credentials from CreateTenant response (#402) Co-authored-by: Daniel Valdivia --- models/create_tenant_response.go | 6 ------ .../Common/CredentialsPrompt/CredentialsPrompt.tsx | 10 ---------- .../Console/Common/CredentialsPrompt/types.ts | 2 -- .../Console/Tenants/ListTenants/AddTenant.tsx | 2 -- restapi/admin_tenants.go | 5 +---- restapi/embedded_spec.go | 12 ------------ swagger.yml | 4 ---- 7 files changed, 1 insertion(+), 40 deletions(-) diff --git a/models/create_tenant_response.go b/models/create_tenant_response.go index 20aec81fe..6d9a22559 100644 --- a/models/create_tenant_response.go +++ b/models/create_tenant_response.go @@ -33,14 +33,8 @@ import ( // swagger:model createTenantResponse type CreateTenantResponse struct { - // access key - AccessKey string `json:"access_key,omitempty"` - // console Console *CreateTenantResponseConsole `json:"console,omitempty"` - - // secret key - SecretKey string `json:"secret_key,omitempty"` } // Validate validates this create tenant response diff --git a/portal-ui/src/screens/Console/Common/CredentialsPrompt/CredentialsPrompt.tsx b/portal-ui/src/screens/Console/Common/CredentialsPrompt/CredentialsPrompt.tsx index 89eb9b5a3..39cc71f76 100644 --- a/portal-ui/src/screens/Console/Common/CredentialsPrompt/CredentialsPrompt.tsx +++ b/portal-ui/src/screens/Console/Common/CredentialsPrompt/CredentialsPrompt.tsx @@ -82,14 +82,6 @@ const CredentialsPrompt = ({ A new {entity} has been created with the following details: -
    -
  • - Access Key: {newServiceAccount.accessKey} -
  • -
  • - Secret Key: {newServiceAccount.secretKey} -
  • -
{consoleCreds && ( @@ -131,8 +123,6 @@ const CredentialsPrompt = ({ download( "credentials.json", JSON.stringify({ - access_key: newServiceAccount.accessKey, - secret_key: newServiceAccount.secretKey, ...consoleExtras, }) ); diff --git a/portal-ui/src/screens/Console/Common/CredentialsPrompt/types.ts b/portal-ui/src/screens/Console/Common/CredentialsPrompt/types.ts index 8afff9e97..7b75e28ab 100644 --- a/portal-ui/src/screens/Console/Common/CredentialsPrompt/types.ts +++ b/portal-ui/src/screens/Console/Common/CredentialsPrompt/types.ts @@ -15,8 +15,6 @@ // along with this program. If not, see . export interface NewServiceAccount { - accessKey: string; - secretKey: string; console?: ConsoleSA; } diff --git a/portal-ui/src/screens/Console/Tenants/ListTenants/AddTenant.tsx b/portal-ui/src/screens/Console/Tenants/ListTenants/AddTenant.tsx index 3d1637f48..003b436ab 100644 --- a/portal-ui/src/screens/Console/Tenants/ListTenants/AddTenant.tsx +++ b/portal-ui/src/screens/Console/Tenants/ListTenants/AddTenant.tsx @@ -913,8 +913,6 @@ const AddTenant = ({ .invoke("POST", `/api/v1/tenants`, dataSend) .then((res) => { const newSrvAcc: NewServiceAccount = { - accessKey: res.access_key, - secretKey: res.secret_key, console: { accessKey: res.console.access_key, secretKey: res.console.secret_key, diff --git a/restapi/admin_tenants.go b/restapi/admin_tenants.go index 4aebc6c5f..cc0f05156 100644 --- a/restapi/admin_tenants.go +++ b/restapi/admin_tenants.go @@ -778,10 +778,7 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create return nil, prepareError(err) } } - response = &models.CreateTenantResponse{ - AccessKey: accessKey, - SecretKey: secretKey, - } + response = &models.CreateTenantResponse{} // Attach Console Credentials if enableConsole { response.Console = &models.CreateTenantResponseConsole{ diff --git a/restapi/embedded_spec.go b/restapi/embedded_spec.go index b63f2dede..d5b143d08 100644 --- a/restapi/embedded_spec.go +++ b/restapi/embedded_spec.go @@ -3279,9 +3279,6 @@ func init() { "createTenantResponse": { "type": "object", "properties": { - "access_key": { - "type": "string" - }, "console": { "type": "object", "properties": { @@ -3292,9 +3289,6 @@ func init() { "type": "string" } } - }, - "secret_key": { - "type": "string" } } }, @@ -8668,9 +8662,6 @@ func init() { "createTenantResponse": { "type": "object", "properties": { - "access_key": { - "type": "string" - }, "console": { "type": "object", "properties": { @@ -8681,9 +8672,6 @@ func init() { "type": "string" } } - }, - "secret_key": { - "type": "string" } } }, diff --git a/swagger.yml b/swagger.yml index 0cbcea648..4a4ec73ba 100644 --- a/swagger.yml +++ b/swagger.yml @@ -2967,10 +2967,6 @@ definitions: createTenantResponse: type: object properties: - access_key: - type: string - secret_key: - type: string console: type: object properties: