From 8f3f6a2638503948a4be989ef0b563ed6f52bd57 Mon Sep 17 00:00:00 2001 From: codrin-ch Date: Wed, 3 May 2023 11:26:55 +0300 Subject: [PATCH] Support ACL LOG: Added entry ID, timestamp created, and timestamp last updated --- packages/client/lib/commands/ACL_LOG.spec.ts | 13 +++++++++++-- packages/client/lib/commands/ACL_LOG.ts | 16 ++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/packages/client/lib/commands/ACL_LOG.spec.ts b/packages/client/lib/commands/ACL_LOG.spec.ts index a8296d31da6..2643154e681 100644 --- a/packages/client/lib/commands/ACL_LOG.spec.ts +++ b/packages/client/lib/commands/ACL_LOG.spec.ts @@ -37,7 +37,13 @@ describe('ACL LOG', () => { 'age-seconds', '4.096', 'client-info', - 'id=6 addr=127.0.0.1:63026 fd=8 name= age=9 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=48 qbuf-free=32720 obl=0 oll=0 omem=0 events=r cmd=auth user=default' + 'id=6 addr=127.0.0.1:63026 fd=8 name= age=9 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=48 qbuf-free=32720 obl=0 oll=0 omem=0 events=r cmd=auth user=default', + 'entry-id', + 0, + 'timestamp-created', + 1675361492408, + 'timestamp-last-updated', + 1675361492408 ]]), [{ count: 1, @@ -46,7 +52,10 @@ describe('ACL LOG', () => { object: 'AUTH', username: 'someuser', ageSeconds: 4.096, - clientInfo: 'id=6 addr=127.0.0.1:63026 fd=8 name= age=9 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=48 qbuf-free=32720 obl=0 oll=0 omem=0 events=r cmd=auth user=default' + clientInfo: 'id=6 addr=127.0.0.1:63026 fd=8 name= age=9 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=48 qbuf-free=32720 obl=0 oll=0 omem=0 events=r cmd=auth user=default', + entryId: 0, + timestampCreated: 1675361492408, + timestampLastUpdated: 1675361492408 }] ); }); diff --git a/packages/client/lib/commands/ACL_LOG.ts b/packages/client/lib/commands/ACL_LOG.ts index 0fd9aa6f19d..1d0d51ca797 100644 --- a/packages/client/lib/commands/ACL_LOG.ts +++ b/packages/client/lib/commands/ACL_LOG.ts @@ -24,7 +24,13 @@ type AclLogRawReply = [ _: RedisCommandArgument, ageSeconds: RedisCommandArgument, _: RedisCommandArgument, - clientInfo: RedisCommandArgument + clientInfo: RedisCommandArgument, + _: RedisCommandArgument, + entryId: number, + _: RedisCommandArgument, + timestampCreated: number, + _: RedisCommandArgument, + timestampLastUpdated: number, ]; interface AclLog { @@ -35,6 +41,9 @@ interface AclLog { username: RedisCommandArgument; ageSeconds: number; clientInfo: RedisCommandArgument; + entryId: number; + timestampCreated: number; + timestampLastUpdated: number; } export function transformReply(reply: Array): Array { @@ -45,6 +54,9 @@ export function transformReply(reply: Array): Array { object: log[7], username: log[9], ageSeconds: Number(log[11]), - clientInfo: log[13] + clientInfo: log[13], + entryId: log[15], + timestampCreated: log[17], + timestampLastUpdated: log[19], })); }