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

Function authBucketPut

lib/api/bucketPut.js:168–207  ·  view source on GitHub ↗
(authParams, bucketName, locationConstraint, request, authInfo)

Source from the content-addressed store, hash-verified

166}
167
168function authBucketPut(authParams, bucketName, locationConstraint, request, authInfo) {
169 const ip = requestUtils.getClientIp(request, config);
170 const isSecure = requestUtils.getHttpProtocolSecurity(request, config);
171 const baseParams = {
172 authParams,
173 ip,
174 isSecure,
175 bucketName,
176 request,
177 authInfo,
178 locationConstraint,
179 };
180 const requestConstantParams = [Object.assign(
181 baseParams,
182 { apiMethod: 'bucketPut' },
183 )];
184
185 if (_isObjectLockEnabled(request.headers)) {
186 requestConstantParams.push(Object.assign(
187 {},
188 baseParams,
189 { apiMethod: 'bucketPutObjectLock' },
190 ));
191 requestConstantParams.push(Object.assign(
192 {},
193 baseParams,
194 { apiMethod: 'bucketPutVersioning' },
195 ));
196 }
197
198 if (_isAclProvided(request.headers)) {
199 requestConstantParams.push(Object.assign(
200 {},
201 baseParams,
202 { apiMethod: 'bucketPutACL' },
203 ));
204 }
205
206 return requestConstantParams;
207}
208
209/**
210 * PUT Service - Create bucket for the user

Callers 2

bucketPutFunction · 0.85
putBucketApiMethodsFunction · 0.85

Calls 2

_isObjectLockEnabledFunction · 0.85
_isAclProvidedFunction · 0.85

Tested by

no test coverage detected