diff options
author | clang-format-7.0.1 <adam.martin@10gen.com> | 2019-07-26 18:42:24 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-07-26 18:42:24 -0400 |
commit | c1a45ebbb0530e3d0201321d725527f1eb83ffce (patch) | |
tree | f523079dc5ded3052eefbdcaae424b7502df5b25 /jstests/noPassthrough/configExpand_exec_digest.js | |
parent | c9599d8610c3da0b7c3da65667aff821063cf5b9 (diff) | |
download | mongo-c1a45ebbb0530e3d0201321d725527f1eb83ffce.tar.gz |
Apply formatting per `clang-format-7.0.1`
Diffstat (limited to 'jstests/noPassthrough/configExpand_exec_digest.js')
-rw-r--r-- | jstests/noPassthrough/configExpand_exec_digest.js | 109 |
1 files changed, 53 insertions, 56 deletions
diff --git a/jstests/noPassthrough/configExpand_exec_digest.js b/jstests/noPassthrough/configExpand_exec_digest.js index 90457f70dc8..e01c1fcd1d6 100644 --- a/jstests/noPassthrough/configExpand_exec_digest.js +++ b/jstests/noPassthrough/configExpand_exec_digest.js @@ -1,60 +1,57 @@ // Test config file expansion using EXEC with digests. (function() { - 'use strict'; - - load('jstests/noPassthrough/libs/configExpand/lib.js'); - - // hash === SHA256HMAC('12345', 'secret') - const hash = 'f88c7ebe4740db59c873cecf5e1f18e3726a1ad64068a13d764b79028430ab0e'; - - // Simple positive case. - configExpandSuccess({ - setParameter: { - scramIterationCount: - {__exec: makeReflectionCmd('12345'), digest: hash, digest_key: '736563726574'} - } - }); - - // Invalid digest length. - configExpandFailure({ - setParameter: { - scramIteratorCount: - {__exec: makeReflectionCmd('12345'), digest: '123', digest_key: '736563726574'} - } - }, - /digest: Not a valid, even length hex string/); - - // Invalid characters. - configExpandFailure({ - setParameter: { - scramIteratorCount: - {__exec: makeReflectionCmd('12345'), digest: hash, digest_key: '736563X26574'} - } - }, - /digest_key: Not a valid, even length hex string/); - - // Digest without key. - configExpandFailure( - {setParameter: {scramIteratorCount: {__exec: makeReflectionCmd('12345'), digest: hash}}}, - /digest requires digest_key/); - - // Empty digest_key. - configExpandFailure({ - setParameter: { - scramIteratorCount: - {__exec: makeReflectionCmd('12345'), digest: hash, digest_key: ''} - } - }, - /digest_key must not be empty/); - - // Mismatched digests. - configExpandFailure({ - setParameter: { - scramIteratorCount: - {__exec: makeReflectionCmd('12345'), digest: hash, digest_key: '736563726575'} - } - }, - /does not match expected digest/); - +'use strict'; + +load('jstests/noPassthrough/libs/configExpand/lib.js'); + +// hash === SHA256HMAC('12345', 'secret') +const hash = 'f88c7ebe4740db59c873cecf5e1f18e3726a1ad64068a13d764b79028430ab0e'; + +// Simple positive case. +configExpandSuccess({ + setParameter: { + scramIterationCount: + {__exec: makeReflectionCmd('12345'), digest: hash, digest_key: '736563726574'} + } +}); + +// Invalid digest length. +configExpandFailure({ + setParameter: { + scramIteratorCount: + {__exec: makeReflectionCmd('12345'), digest: '123', digest_key: '736563726574'} + } +}, + /digest: Not a valid, even length hex string/); + +// Invalid characters. +configExpandFailure({ + setParameter: { + scramIteratorCount: + {__exec: makeReflectionCmd('12345'), digest: hash, digest_key: '736563X26574'} + } +}, + /digest_key: Not a valid, even length hex string/); + +// Digest without key. +configExpandFailure( + {setParameter: {scramIteratorCount: {__exec: makeReflectionCmd('12345'), digest: hash}}}, + /digest requires digest_key/); + +// Empty digest_key. +configExpandFailure({ + setParameter: + {scramIteratorCount: {__exec: makeReflectionCmd('12345'), digest: hash, digest_key: ''}} +}, + /digest_key must not be empty/); + +// Mismatched digests. +configExpandFailure({ + setParameter: { + scramIteratorCount: + {__exec: makeReflectionCmd('12345'), digest: hash, digest_key: '736563726575'} + } +}, + /does not match expected digest/); })(); |