diff --git a/lib/utilities/serverAccessLogger.js b/lib/utilities/serverAccessLogger.js index 3ce4464ca6..4bd5fbd6d1 100644 --- a/lib/utilities/serverAccessLogger.js +++ b/lib/utilities/serverAccessLogger.js @@ -251,6 +251,9 @@ const methodToResType = Object.freeze({ 'bucketPutEncryption': 'ENCRYPTION', 'bucketPutLogging': 'LOGGING_STATUS', 'bucketGetLogging': 'LOGGING_STATUS', + 'bucketPutRateLimit': 'RATELIMIT', + 'bucketGetRateLimit': 'RATELIMIT', + 'bucketDeleteRateLimit': 'RATELIMIT', 'corsPreflight': 'PREFLIGHT', 'completeMultipartUpload': 'UPLOAD', 'initiateMultipartUpload': 'UPLOADS', diff --git a/package.json b/package.json index 9f9a814044..a5fa022af7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zenko/cloudserver", - "version": "9.2.30", + "version": "9.2.31", "description": "Zenko CloudServer, an open-source Node.js implementation of a server handling the Amazon S3 protocol", "main": "index.js", "engines": { diff --git a/tests/unit/utils/serverAccessLogger.js b/tests/unit/utils/serverAccessLogger.js index fb0d356c73..e41648d565 100644 --- a/tests/unit/utils/serverAccessLogger.js +++ b/tests/unit/utils/serverAccessLogger.js @@ -185,6 +185,24 @@ describe('serverAccessLogger utility functions', () => { assert.strictEqual(result, 'REST.POST.UPLOAD'); }); + it('should return REST.PUT.RATELIMIT for bucketPutRateLimit', () => { + const req = { method: 'PUT', apiMethod: 'bucketPutRateLimit' }; + const result = getOperation(req); + assert.strictEqual(result, 'REST.PUT.RATELIMIT'); + }); + + it('should return REST.GET.RATELIMIT for bucketGetRateLimit', () => { + const req = { method: 'GET', apiMethod: 'bucketGetRateLimit' }; + const result = getOperation(req); + assert.strictEqual(result, 'REST.GET.RATELIMIT'); + }); + + it('should return REST.DELETE.RATELIMIT for bucketDeleteRateLimit', () => { + const req = { method: 'DELETE', apiMethod: 'bucketDeleteRateLimit' }; + const result = getOperation(req); + assert.strictEqual(result, 'REST.DELETE.RATELIMIT'); + }); + it('should return REST.method.UNKNOWN for unknown apiMethod', () => { const req = { method: 'GET', apiMethod: 'unknownMethod' }; const result = getOperation(req);