Skip to content

Commit 99815fb

Browse files
Merge branch 'development/9.0' into w/9.0/improvement/CLDSRV-625-kms-ip
2 parents b4f9483 + 399b3e2 commit 99815fb

File tree

14 files changed

+850
-860
lines changed

14 files changed

+850
-860
lines changed

.github/workflows/tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ jobs:
413413
utapi-v2-tests:
414414
runs-on: ubuntu-24.04
415415
needs: build
416-
if: false
416+
if: always()
417417
env:
418418
ENABLE_UTAPI_V2: t
419419
S3BACKEND: mem

lib/Config.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ const {
2020
allowedUtapiEventFilterStates,
2121
supportedLifecycleRules,
2222
} = require('../constants');
23-
24-
// TODO CLDSRV-610: re-enable utapi
25-
// const { utapiVersion } = require('utapi');
26-
const utapiVersion = null;
27-
23+
const { utapiVersion } = require('utapi');
2824
const { scaleMsPerDay } = s3middleware.objectUtils;
2925

3026
const constants = require('../constants');

lib/utapi/utapi.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
require('werelogs').stderrUtils.catchAndTimestampStderr();
22
const _config = require('../Config').config;
3-
// TODO CLDSRV-610 re-enable utapi
4-
/* eslint-disable */
5-
// const { utapiVersion, UtapiServer: utapiServer } = require('utapi');
3+
const { utapiVersion, UtapiServer: utapiServer } = require('utapi');
64

75
// start utapi server
8-
// TODO CLDSRV-610 re-enable utapi
9-
if (utapiVersion === 1 && _config.utapi && false) {
6+
if (utapiVersion === 1 && _config.utapi) {
107
const fullConfig = Object.assign({}, _config.utapi,
118
{ redis: _config.redis });
129
if (_config.vaultd) {

lib/utapi/utapiReindex.js

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
require('werelogs').stderrUtils.catchAndTimestampStderr();
2-
// TODO CLDSRV-610 re-enable utapi
3-
/* eslint-disable */
4-
// const UtapiReindex = require('utapi').UtapiReindex;
2+
const UtapiReindex = require('utapi').UtapiReindex;
53
const { config } = require('../Config');
64

7-
// TODO CLDSRV-610 re-enable utapi
8-
if (false) {
9-
const reindexConfig = config.utapi && config.utapi.reindex;
10-
if (reindexConfig && reindexConfig.password === undefined) {
11-
reindexConfig.password = config.utapi && config.utapi.redis
12-
&& config.utapi.redis.password;
13-
}
14-
const reindex = new UtapiReindex(reindexConfig);
15-
reindex.start();
5+
const reindexConfig = config.utapi && config.utapi.reindex;
6+
if (reindexConfig && reindexConfig.password === undefined) {
7+
reindexConfig.password = config.utapi && config.utapi.redis
8+
&& config.utapi.redis.password;
169
}
10+
const reindex = new UtapiReindex(reindexConfig);
11+
reindex.start();

lib/utapi/utapiReplay.js

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
require('werelogs').stderrUtils.catchAndTimestampStderr();
2-
// TODO CLDSRV-610 re-enable utapi
3-
/* eslint-disable */
4-
// const UtapiReplay = require('utapi').UtapiReplay;
2+
const UtapiReplay = require('utapi').UtapiReplay;
53
const _config = require('../Config').config;
64

7-
// TODO CLDSRV-610 re-enable utapi
8-
if (false) {
9-
const utapiConfig = _config.utapi &&
10-
Object.assign({}, _config.utapi, { redis: _config.redis });
11-
const replay = new UtapiReplay(utapiConfig); // start utapi server
12-
replay.start();
13-
}
5+
const utapiConfig = _config.utapi &&
6+
Object.assign({}, _config.utapi, { redis: _config.redis });
7+
const replay = new UtapiReplay(utapiConfig); // start utapi server
8+
replay.start();

lib/utapi/utilities.js

+14-25
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,27 @@ const http = require('http');
22
const https = require('https');
33
const commander = require('commander');
44
const { auth } = require('arsenal');
5-
// TODO CLDSRV-610 re-enable utapi
6-
/* eslint-disable */
7-
// const { UtapiClient, utapiVersion } = require('utapi');
5+
const { UtapiClient, utapiVersion } = require('utapi');
86
const logger = require('../utilities/logger');
97
const _config = require('../Config').config;
108
const { suppressedUtapiEventFields: suppressedEventFields } = require('../../constants');
119
// setup utapi client
1210
let utapiConfig;
1311

14-
// TODO CLDSRV-610 re-enable utapi
15-
// if (utapiVersion === 1 && _config.utapi) {
16-
// if (_config.utapi.redis === undefined) {
17-
// utapiConfig = Object.assign({}, _config.utapi, { redis: _config.redis });
18-
// } else {
19-
// utapiConfig = Object.assign({}, _config.utapi);
20-
// }
21-
// } else if (utapiVersion === 2) {
22-
// utapiConfig = Object.assign({
23-
// tls: _config.https,
24-
// suppressedEventFields,
25-
// }, _config.utapi || {});
26-
// }
12+
if (utapiVersion === 1 && _config.utapi) {
13+
if (_config.utapi.redis === undefined) {
14+
utapiConfig = Object.assign({}, _config.utapi, { redis: _config.redis });
15+
} else {
16+
utapiConfig = Object.assign({}, _config.utapi);
17+
}
18+
} else if (utapiVersion === 2) {
19+
utapiConfig = Object.assign({
20+
tls: _config.https,
21+
suppressedEventFields,
22+
}, _config.utapi || {});
23+
}
2724

28-
// const utapi = new UtapiClient(utapiConfig);
25+
const utapi = new UtapiClient(utapiConfig);
2926

3027
const bucketOwnerMetrics = [
3128
'completeMultipartUpload',
@@ -260,8 +257,6 @@ function listMetrics(metricType) {
260257
* filtered out and not pushed to utapi.
261258
*/
262259
function pushMetric(action, log, metricObj) {
263-
// TODO CLDSRV-610 re-enable utapi
264-
return;
265260
const {
266261
bucket,
267262
keys,
@@ -360,8 +355,6 @@ function pushMetric(action, log, metricObj) {
360355
* @return {string} - location unique ID
361356
*/
362357
function _getLocationId(location) {
363-
// TODO CLDSRV-610 re-enable utapi
364-
return;
365358
return _config.locationConstraints[location].objectId;
366359
}
367360

@@ -374,8 +367,6 @@ function _getLocationId(location) {
374367
* @return {function} - `utapi.getLocationMetric`
375368
*/
376369
function getLocationMetric(location, log, cb) {
377-
// TODO CLDSRV-610 re-enable utapi
378-
return;
379370
const locationId = _getLocationId(location);
380371
return utapi.getLocationMetric(locationId, log.getSerializedUids(), cb);
381372
}
@@ -390,8 +381,6 @@ function getLocationMetric(location, log, cb) {
390381
* @return {function} - `utapi.pushLocationMetric`
391382
*/
392383
function pushLocationMetric(location, byteLength, log, cb) {
393-
// TODO CLDSRV-610 re-enable utapi
394-
return;
395384
const locationId = _getLocationId(location);
396385
return utapi.pushLocationMetric(locationId, byteLength,
397386
log.getSerializedUids(), cb);

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenko/cloudserver",
3-
"version": "9.0.7",
3+
"version": "9.0.8",
44
"description": "Zenko CloudServer, an open-source Node.js implementation of a server handling the Amazon S3 protocol",
55
"main": "index.js",
66
"engines": {
@@ -21,10 +21,10 @@
2121
"dependencies": {
2222
"@azure/storage-blob": "^12.25.0",
2323
"@hapi/joi": "^17.1.1",
24-
"arsenal": "git+https://github.com/scality/arsenal#8.2.9",
24+
"arsenal": "git+https://github.com/scality/arsenal#8.2.10",
2525
"async": "2.6.4",
2626
"aws-sdk": "^2.1692.0",
27-
"bucketclient": "scality/bucketclient#8.2.0",
27+
"bucketclient": "scality/bucketclient#8.2.1",
2828
"bufferutil": "^4.0.8",
2929
"commander": "^12.1.0",
3030
"cron-parser": "^4.9.0",
@@ -43,6 +43,7 @@
4343
"request": "^2.88.2",
4444
"scubaclient": "git+https://github.com/scality/scubaclient.git#fb7375a9298bda7df0e9f9ed81d7fc5b363590a9",
4545
"sql-where-parser": "^2.2.1",
46+
"utapi": "github:scality/utapi#8.2.0",
4647
"utf-8-validate": "^6.0.5",
4748
"utf8": "^3.0.0",
4849
"uuid": "^11.0.3",
@@ -71,6 +72,8 @@
7172
"tv4": "^1.3.0"
7273
},
7374
"resolutions": {
75+
"string-width": "4.2.3",
76+
"jsonwebtoken":"^9.0.0",
7477
"nan": "v2.22.0"
7578
},
7679
"scripts": {

0 commit comments

Comments
 (0)