diff options
| author | Nils Maier <maierman@web.de> | 2014-05-17 17:31:21 +0200 |
|---|---|---|
| committer | Nils Maier <maierman@web.de> | 2014-05-20 12:53:39 +0200 |
| commit | 855dfa0e2f8ca7869d28d2afc21fed2e3790549a (patch) | |
| tree | e156bebeee259fa0213611a54d3ed169c1c04ad7 /test/RpcMethodTest.cc | |
| parent | 88b61f2eb97faa5fad1a0dd882ef1d1ade48c8df (diff) | |
Authorize RPC multicalls only once.
Cache the auth status afterwards and just assume the token still matches
(within the same request, of course).
Diffstat (limited to 'test/RpcMethodTest.cc')
| -rw-r--r-- | test/RpcMethodTest.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/RpcMethodTest.cc b/test/RpcMethodTest.cc index d5614b4e..5778982f 100644 --- a/test/RpcMethodTest.cc +++ b/test/RpcMethodTest.cc @@ -200,6 +200,14 @@ void RpcMethodTest::testAuthorize() auto res = m.execute(std::move(req), e_.get()); CPPUNIT_ASSERT_EQUAL(1, res.code); } + // secret token set and bad token: prefixed parameter is given, but preauthorized + { + auto req = createReq(GetVersionRpcMethod::getMethodName()); + req.authorization = RpcRequest::PREAUTHORIZED; + req.params->append("token:foo2"); + auto res = m.execute(std::move(req), e_.get()); + CPPUNIT_ASSERT_EQUAL(0, res.code); + } } void RpcMethodTest::testAddUri() |
