Skip to content

Commit

Permalink
Merge 1619cd4 into 1e51680
Browse files Browse the repository at this point in the history
  • Loading branch information
leibale authored Apr 25, 2022
2 parents 1e51680 + 1619cd4 commit e2cb506
Show file tree
Hide file tree
Showing 28 changed files with 68 additions and 26 deletions.
3 changes: 3 additions & 0 deletions packages/client/lib/client/commands.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import CLUSTER_COMMANDS from '../cluster/commands';
import * as ACL_CAT from '../commands/ACL_CAT';
import * as ACL_DELUSER from '../commands/ACL_DELUSER';
import * as ACL_DRYRUN from '../commands/ACL_DRYRUN';
import * as ACL_GENPASS from '../commands/ACL_GENPASS';
import * as ACL_GETUSER from '../commands/ACL_GETUSER';
import * as ACL_LIST from '../commands/ACL_LIST';
Expand Down Expand Up @@ -115,6 +116,8 @@ export default {
aclCat: ACL_CAT,
ACL_DELUSER,
aclDelUser: ACL_DELUSER,
ACL_DRYRUN,
aclDryRun: ACL_DRYRUN,
ACL_GENPASS,
aclGenPass: ACL_GENPASS,
ACL_GETUSER,
Expand Down
21 changes: 21 additions & 0 deletions packages/client/lib/commands/ACL_DRYRUN.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './ACL_DRYRUN';

describe('ACL DRYRUN', () => {
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
transformArguments('default', ['GET', 'key']),
['ACL', 'DRYRUN', 'default', 'GET', 'key']
);
});

testUtils.testWithClient('client.aclDryRun', async client => {
assert.equal(
await client.aclDryRun('default', ['GET', 'key']),
'OK'
);
}, GLOBAL.SERVERS.OPEN);
});
18 changes: 18 additions & 0 deletions packages/client/lib/commands/ACL_DRYRUN.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RedisCommandArgument, RedisCommandArguments } from '.';

export const IS_READ_ONLY = true;

export function transformArguments(
username: RedisCommandArgument,
command: Array<RedisCommandArgument>
): RedisCommandArguments {
return [
'ACL',
'DRYRUN',
username,
...command
];
}

export declare function transformReply(): RedisCommandArgument;

2 changes: 1 addition & 1 deletion packages/client/lib/commands/BLMPOP.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './BLMPOP';

describe('BLMPOP', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/BZMPOP.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './BZMPOP';

describe('BZMPOP', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/CLUSTER_LINKS.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './CLUSTER_LINKS';

describe('CLUSTER LINKS', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './COMMAND_GETKEYSANDFLAGS';

describe('COMMAND GETKEYSANDFLAGS', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/COMMAND_LIST.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments, FilterBy } from './COMMAND_LIST';

describe('COMMAND LIST', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/EVALSHA_RO.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils from '../test-utils';
import { transformArguments } from './EVALSHA_RO';

describe('EVALSHA_RO', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/EVAL_RO.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './EVAL_RO';

describe('EVAL_RO', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
Expand Down
4 changes: 2 additions & 2 deletions packages/client/lib/commands/EXPIRETIME.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './EXPIRETIME';

describe('EXPIRETIME', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
transformArguments('key'),
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/FCALL.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MATH_FUNCTION, loadMathFunction } from '../client/index.spec';
import { transformArguments } from './FCALL';

describe('FCALL', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/FCALL_RO.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MATH_FUNCTION, loadMathFunction } from '../client/index.spec';
import { transformArguments } from './FCALL_RO';

describe('FCALL_RO', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/FUNCTION_DELETE.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './FUNCTION_DELETE';

describe('FUNCTION DELETE', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/FUNCTION_DUMP.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './FUNCTION_DUMP';

describe('FUNCTION DUMP', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/FUNCTION_FLUSH.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './FUNCTION_FLUSH';

describe('FUNCTION FLUSH', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/FUNCTION_KILL.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils from '../test-utils';
import { transformArguments } from './FUNCTION_KILL';

describe('FUNCTION KILL', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/FUNCTION_LIST.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MATH_FUNCTION, loadMathFunction } from '../client/index.spec';
import { transformArguments } from './FUNCTION_LIST';

describe('FUNCTION LIST', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MATH_FUNCTION, loadMathFunction } from '../client/index.spec';
import { transformArguments } from './FUNCTION_LIST_WITHCODE';

describe('FUNCTION LIST WITHCODE', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/FUNCTION_LOAD.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MATH_FUNCTION } from '../client/index.spec';
import { transformArguments } from './FUNCTION_LOAD';

describe('FUNCTION LOAD', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/FUNCTION_RESTORE.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './FUNCTION_RESTORE';

describe('FUNCTION RESTORE', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/FUNCTION_STATS.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './FUNCTION_STATS';

describe('FUNCTION STATS', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/LMPOP.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './LMPOP';

describe('LMPOP', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/PEXPIRETIME.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './PEXPIRETIME';

describe('PEXPIRETIME', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

it('transformArguments', () => {
assert.deepEqual(
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/SINTERCARD.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './SINTERCARD';

describe('SINTERCARD', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/SORT_RO.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './SORT_RO';

describe('SORT_RO', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/ZINTERCARD.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './ZINTERCARD';

describe('ZINTERCARD', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/commands/ZMPOP.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import testUtils, { GLOBAL } from '../test-utils';
import { transformArguments } from './ZMPOP';

describe('ZMPOP', () => {
testUtils.isVersionGreaterThanHook([7, 0]);
testUtils.isVersionGreaterThanHook([7]);

describe('transformArguments', () => {
it('simple', () => {
Expand Down

0 comments on commit e2cb506

Please sign in to comment.