From ee06a9c8252bb98d2a7f4f297b6e5f6f2aeb5483 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Tue, 8 Feb 2022 14:44:15 -0800 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Refactor=20mirage=20for?= =?UTF-8?q?=20GET=20host-catalog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactor mirage data for GET host-catalog method. --- addons/api/mirage/factories/host-catalog.js | 23 +++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/addons/api/mirage/factories/host-catalog.js b/addons/api/mirage/factories/host-catalog.js index 776d8cdfa..0cf046228 100644 --- a/addons/api/mirage/factories/host-catalog.js +++ b/addons/api/mirage/factories/host-catalog.js @@ -47,19 +47,30 @@ export default factory.extend({ case 'aws': return { disable_credential_rotation: datatype.boolean(), - tenant_id: datatype.hexaDecimal(6), - client_id: datatype.hexaDecimal(6), - subscription_id: datatype.hexaDecimal(8), - secret_id: datatype.hexaDecimal(6), - secret_value: datatype.string(12), + region: address.state(), }; case 'azure': return { disable_credential_rotation: datatype.boolean(), - region: address.state(), + tenant_id: datatype.hexaDecimal(6), + client_id: datatype.hexaDecimal(6), + subscription_id: datatype.hexaDecimal(8), + }; + } + }, + + secrets() { + switch (this.plugin?.name) { + case 'aws': + return { access_key_id: datatype.hexaDecimal(8), secret_access_key: datatype.string(12), }; + case 'azure': + return { + secret_id: datatype.hexaDecimal(6), + secret_value: datatype.string(12), + }; } }, withChildren: trait({