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

Function makeAuthInfo

tests/unit/helpers.js:69–99  ·  view source on GitHub ↗
(accessKey, userName)

Source from the content-addressed store, hash-verified

67}
68
69function makeAuthInfo(accessKey, userName) {
70 const canIdMap = {
71 accessKey1: '79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7'
72 + 'cd47ef2be',
73 accessKey2: '79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7'
74 + 'cd47ef2bf',
75 lifecycleKey1: '0123456789abcdef/lifecycle',
76 default: crypto.randomBytes(32).toString('hex'),
77 };
78 canIdMap[constants.publicId] = constants.publicId;
79 const acctIdMap = {
80 accessKey1: '123456789098',
81 accessKey2: '234567890987',
82 default: 'shortid',
83 };
84 const shortid = acctIdMap[accessKey] || acctIdMap.default;
85 const params = {
86 canonicalID: canIdMap[accessKey] || canIdMap.default,
87 shortid,
88 email: `${accessKey}@l.com`,
89 accountDisplayName: `${accessKey}displayName`,
90 arn: `arn:aws:iam::${shortid}:root`,
91 };
92
93 if (userName) {
94 params.IAMdisplayName = `${accessKey}-${userName}-userDisplayName`;
95 params.arn = `arn:aws:iam::${shortid}:user/${userName}`;
96 }
97
98 return new AuthInfo(params);
99}
100
101class WebsiteConfig {
102 constructor(indexDocument, errorDocument, redirectAllReqTo) {

Callers 6

objectPut.jsFile · 0.50
objectCopy.jsFile · 0.50
objectPutPart.jsFile · 0.50
multipartUpload.jsFile · 0.50
utilities.jsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected