Skip to content

Commit a0eff31

Browse files
committed
Add objectGetAttributes in server access logs
Issue: CLDSRV-844
1 parent 9569ce0 commit a0eff31

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

lib/utilities/serverAccessLogger.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ const methodToResType = Object.freeze({
262262
'objectDelete': 'OBJECT',
263263
'objectDeleteTagging': 'TAGGING',
264264
'objectGet': 'OBJECT',
265+
'objectGetAttributes': 'OBJECT',
265266
'objectGetACL': 'ACL',
266267
'objectGetLegalHold': 'LEGALHOLD',
267268
'objectGetRetention': 'OBJECT_LOCK_RETENTION',

tests/functional/aws-node-sdk/test/serverAccessLogs/testServerAccessLogFile.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,6 +1946,41 @@ describe('Server Access Logs - File Output', async () => {
19461946
],
19471947
};
19481948
})(),
1949+
(() => {
1950+
// This operation tests getting object attributes.
1951+
const method = async () => {
1952+
await s3.createBucket({ Bucket: bucketName });
1953+
await s3.putObject({ Bucket: bucketName, Key: objectKey, Body: 'test data' });
1954+
await s3.getObjectAttributes({ Bucket: bucketName, Key: objectKey, ObjectAttributes: ['ETag'] });
1955+
};
1956+
return {
1957+
method,
1958+
methodName: 'objectGetAttributes',
1959+
expected: [
1960+
{
1961+
...commonProperties,
1962+
operation: 'REST.PUT.BUCKET',
1963+
action: 'CreateBucket',
1964+
bucketOwner: null,
1965+
httpMethod: 'PUT',
1966+
},
1967+
{
1968+
...commonProperties,
1969+
operation: 'REST.PUT.OBJECT',
1970+
action: 'PutObject',
1971+
objectKey,
1972+
httpMethod: 'PUT',
1973+
},
1974+
{
1975+
...commonProperties,
1976+
operation: 'REST.GET.OBJECT',
1977+
action: 'GetObjectAttributes',
1978+
objectKey,
1979+
httpMethod: 'GET',
1980+
}
1981+
],
1982+
};
1983+
})(),
19491984
(() => {
19501985
// This operation tests getting object ACL.
19511986
const method = async () => {

0 commit comments

Comments
 (0)