build simple authdata with only one account * @param {string} accessKey - account's accessKey * @param {string} secretKey - account's secretKey * @param {string} canonicalId - account's canonical id * @param {string} [serviceName] - service name to use to generate can id * @param {string} userN
(accessKey, secretKey, canonicalId, serviceName, userName)
| 10 | * @return {object} authdata - authdata with account's accessKey and secretKey |
| 11 | */ |
| 12 | function buildAuthDataAccount(accessKey, secretKey, canonicalId, serviceName, |
| 13 | userName) { |
| 14 | // TODO: remove specific check for clueso and generate unique |
| 15 | // canonical id's for accounts |
| 16 | const finalCanonicalId = canonicalId || |
| 17 | (serviceName ? `${serviceAccountPrefix}/${serviceName}` : |
| 18 | '12349df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47qwer'); |
| 19 | const shortid = '123456789012'; |
| 20 | return { |
| 21 | accounts: [{ |
| 22 | name: userName || 'CustomAccount', |
| 23 | email: 'customaccount1@setbyenv.com', |
| 24 | arn: `arn:aws:iam::${shortid}:root`, |
| 25 | canonicalID: finalCanonicalId, |
| 26 | shortid, |
| 27 | keys: [{ |
| 28 | access: accessKey, |
| 29 | secret: secretKey, |
| 30 | }], |
| 31 | }], |
| 32 | }; |
| 33 | } |
| 34 | |
| 35 | module.exports = { |
| 36 | buildAuthDataAccount, |
no outgoing calls
no test coverage detected