MCPcopy
hub / github.com/scality/cloudserver / buildAuthDataAccount

Function buildAuthDataAccount

lib/auth/in_memory/builder.js:12–33  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

10 * @return {object} authdata - authdata with account's accessKey and secretKey
11 */
12function buildAuthDataAccount(accessKey, secretKey, canonicalId, serviceName,
13userName) {
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
35module.exports = {
36 buildAuthDataAccount,

Callers 3

_configureBackendsMethod · 0.85
patchConfigurationFunction · 0.85
backend.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected