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

Function evalAuthInfo

lib/utapi/utilities.js:34–49  ·  view source on GitHub ↗
(authInfo, canonicalID, action)

Source from the content-addressed store, hash-verified

32];
33
34function evalAuthInfo(authInfo, canonicalID, action) {
35 let accountId = authInfo.getCanonicalID();
36 let userId = authInfo.isRequesterAnIAMUser() ?
37 authInfo.getShortid() : undefined;
38 // If action impacts 'numberOfObjectsStored' or 'storageUtilized' metric
39 // only the bucket owner account's metrics should be updated
40 const canonicalIdMatch = authInfo.getCanonicalID() === canonicalID;
41 if (bucketOwnerMetrics.includes(action) && !canonicalIdMatch) {
42 accountId = canonicalID;
43 userId = undefined;
44 }
45 return {
46 accountId,
47 userId,
48 };
49}
50
51function _listMetrics(host,
52 port,

Callers 1

pushMetricFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected