Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/utilities/serverAccessLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
18 changes: 18 additions & 0 deletions tests/unit/utils/serverAccessLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading