Slava Barinov [Thu, 24 Aug 2023 07:50:25 +0000 (10:50 +0300)]
Remove unneeded packaging
Change-Id: Id31c98aab494569f59ccace45e30c0ed1045e4fc
Slava Barinov [Wed, 23 Aug 2023 10:37:30 +0000 (13:37 +0300)]
Fix build on new compiler
Change-Id: I20bc493cf028c1e179f8742b5dc35b704022e07c
Slava Barinov [Wed, 23 Aug 2023 10:36:23 +0000 (13:36 +0300)]
Remove systemd dependency for bootstrap
Change-Id: I5f05080a444502e6e4258d7854d61d393afa6431
Krzysztof Jackiewicz [Fri, 21 Jul 2023 12:37:28 +0000 (14:37 +0200)]
Silence SVACE defect in tests
WGID 500405 | ProtocolSerialization.cpp:49PROC_USE.VULNERABLE
Use of vulnerable function 'strcpy' at ProtocolSerialization.cpp:49.
This function is unsafe, use strncpy instead.
Change-Id: I6f9aa86f14fbba072adf44dc49fcc8d4be086952
Tomasz Swierczek [Tue, 20 Jun 2023 07:55:42 +0000 (09:55 +0200)]
Release 0.18.2
* Fix new toolchain build errors
Change-Id: I20cb14d4d058ac5779e89657f31b84f76f00aee9
Tomasz Swierczek [Tue, 20 Jun 2023 04:41:19 +0000 (06:41 +0200)]
Fix new toolchain build errors
Change-Id: Id6c6852c41808d6d7cf447261fc1a88b01c06d44
Tomasz Swierczek [Fri, 27 Jan 2023 10:21:44 +0000 (11:21 +0100)]
Release 0.18.1
* Change release mode log level to warning
Change-Id: I3fd4087d40cf0ecdf14005fda7cf61c0975367fd
Tomasz Swierczek [Fri, 27 Jan 2023 09:55:09 +0000 (10:55 +0100)]
Change release mode log level to warning
Debug logs are clearly only for debug mode, but warnings
can be helpful in release mode (VD request).
Change-Id: I86b390fe2838aec3b793ca4bf9b274554a8e6d78
Dariusz Michaluk [Fri, 23 Dec 2022 07:34:46 +0000 (08:34 +0100)]
Release 0.18.0
* [helpers] Fix linking with creds-commons
* Add dbus helper API to fetch all credentials in one call
* Add gdbus helper API to fetch all credentials in one call
* Change some logs into warnings
Change-Id: Ic5f161e7410e8f93b607d7bb758d17ba322f5a4b
Zofia Abramowska [Thu, 15 Dec 2022 21:06:09 +0000 (22:06 +0100)]
[helpers] Fix linking with creds-commons
As TARGET_LIB_CREDS_COMMONS wasn't defined on level visible
for credential helpers build, credential libraries were not
properly linked.
Change-Id: I340cb0a312a3f98e9bf11957423a57fc40a35b65
Zofia Abramowska [Thu, 15 Dec 2022 22:39:53 +0000 (23:39 +0100)]
Add dbus helper API to fetch all credentials in one call
Change-Id: I17653b94fe79065354bdb82c52c378d9126dab15
Zofia Abramowska [Thu, 15 Dec 2022 22:39:19 +0000 (23:39 +0100)]
Add gdbus helper API to fetch all credentials in one call
Change-Id: Ie3a0446b60f837bdec42c80323fa6809c7cdddc9
Tomasz Swierczek [Thu, 15 Dec 2022 11:46:15 +0000 (12:46 +0100)]
Change some logs into warnings
As requested explicitly by Visual Display Division.
Change-Id: I54d18b426d0fc1f65d92352036e660ed6310736d
Tomasz Swierczek [Mon, 28 Nov 2022 11:31:12 +0000 (12:31 +0100)]
Release 0.17.2
* Add additional logs
* Implement better tryCatch
* Put some .cpp-local entities in anon ns
* Remove unused sec_build_binary_debug_enable build macro
Change-Id: I40820f05f1ddbe5a9a7455c2796e5dbd64b56b35
Tomasz Swierczek [Mon, 28 Nov 2022 11:28:58 +0000 (12:28 +0100)]
Add additional logs
All done for explicit request of Visual Display division.
Change-Id: I7b4f6a487d1dddf5288c3ab5758249bd3e3c6b5e
Tomasz Swierczek [Mon, 16 May 2022 12:31:44 +0000 (14:31 +0200)]
Implement better tryCatch
"Gotta catch them all!"
- from Pokémon
Recently it was reported that there's an issue if not-handled
std::bad_alloc in Cynara. After getting more information
(incl. decompiled version of the module), it was found that
when compiled using gcc, implementation of std::function made on-the fly
as argument to tryCatch() is being allocated BEFORE passing it to
the tryCatch() function.
When compiled using clang9, there is no new() in that place.
This patch changes tryCatch() to a template with function being
an R-value reference with std::forward, solving the issue.
Decompiled version with additional new
(thanks to Konstiantyn Melnik, k.melnik@samsung.com):
int __cdecl cynara_check(void *cynara_struct, char *client, char *client_session, char *user, char *privilege)
{
int v5; // ebx
char ***lambda_func_obj; // eax
char *__loc_privilege_ptr; // [esp+1Ch] [ebp-4Ch]
char *__loc_user_str; // [esp+20h] [ebp-48h]
char *__loc_client_session_str; // [esp+24h] [ebp-44h]
char *__loc_client_str; // [esp+28h] [ebp-40h]
void *__loc_cynara_struct; // [esp+2Ch] [ebp-3Ch]
char ***lambda_func_ptr; // [esp+3Ch] [ebp-2Ch]
int (__cdecl *v14)(void **, void **, unsigned int); // [esp+44h] [ebp-24h]
int (__cdecl *func_to_run)(void *); // [esp+48h] [ebp-20h]
unsigned int guard_var; // [esp+4Ch] [ebp-1Ch]
__loc_privilege_ptr = privilege;
__loc_cynara_struct = cynara_struct;
__loc_user_str = user;
__loc_client_str = client;
__loc_client_session_str = client_session;
guard_var = __readgsdword(0x14u);
if ( cynara_struct
&& *(_DWORD *)cynara_struct // if (!p_cynara || !p_cynara->impl)
// return CYNARA_API_INVALID_PARAM;
&& client // if (!isStringValid(client) || !isStringValid(client_session))
// return CYNARA_API_INVALID_PARAM;
&& strlen(client) <= 0x1000
&& client_session
&& strlen(client_session) <= 0x1000
&& user
&& strlen(user) <= 0x1000 // if (!isStringValid(user) || !isStringValid(privilege))
// return CYNARA_API_INVALID_PARAM;
&& privilege
&& strlen(privilege) <= 0x1000 )
{
lambda_func_obj = (char ***)operator new(0x14u);
lambda_func_ptr = lambda_func_obj;
*lambda_func_obj = &__loc_client_str;
lambda_func_obj[1] = &__loc_client_session_str;
lambda_func_obj[2] = &__loc_user_str;
lambda_func_obj[3] = &__loc_privilege_ptr;
lambda_func_obj[4] = (char **)&__loc_cynara_struct;
func_to_run = (int (__cdecl *)(void *))sub_4B80;
v14 = sub_3930;
v5 = Cynara::tryCatch(&lambda_func_ptr);
if ( v14 )
v14((void **)&lambda_func_ptr, (void **)&lambda_func_ptr, 3u);
}
else
{
v5 = -4;
}
if ( __readgsdword(0x14u) != guard_var )
terminate_proc();
return v5;
}
Change-Id: I5455d03d411b03ed76a81659efb60c6474ceb99b
Konrad Lipinski [Tue, 7 Dec 2021 12:54:40 +0000 (13:54 +0100)]
Put some .cpp-local entities in anon ns
This fixes at least one ODR violtation (FakeStreamForBucketId) which was
defined twice, in test/storage/serializer/{deserialize,serializer}.cpp.
Two unit tests would fail in some environments as a result, particularly
StorageSerializerFixture.dumpBucketsPositive, due to dynamic_cast
failing within gtest (the one from serializer.cpp was being cast to the
one from deserializer.cpp).
Change-Id: Ie0dc0191b4e45d032b68b0df9bfcdf81fca8678f
Dariusz Michaluk [Thu, 25 Nov 2021 10:34:30 +0000 (11:34 +0100)]
Remove unused sec_build_binary_debug_enable build macro
Change-Id: I3d8c8e4c936449ff36b7288580d90383ce64a2fe
Konrad Lipinski [Tue, 13 Apr 2021 12:06:53 +0000 (14:06 +0200)]
Release 0.17.1
* Fix UB in predicate-driven PolicyBucket erasure
Change-Id: Iee7c125a927905e68e3477c0126b989951f5366c
Konrad Lipinski [Mon, 12 Apr 2021 14:39:25 +0000 (16:39 +0200)]
Fix UB in predicate-driven PolicyBucket erasure
Change-Id: Ic1559c79c875e503ac165c29671460ad56deaab2
Konrad Lipinski [Tue, 23 Mar 2021 11:03:56 +0000 (12:03 +0100)]
Release 0.17.0
* Automate code coverage measurement
* Add dependency warning on enabling journal logs in cynara-client
* Shrink CapacityCache keys, speed up generation
* Prevent iterator invalidation in CapacityCache
* Fix zero-initialization of class members
* Remove unused code
* Categorize existing unit tests into positive & negative cases
* Add/amend assorted unit tests to increase coverage
* Fix cyad backup command help position and message
* Redo error printing in cyad
* Remove unnecessary copies
* Force googletest to build with c++17 instead of c++11
* Move protocol serialization/deserialization to one place
* Ensure that MonitorCache capacity is of permissible size
Change-Id: I1daf23ca44ec9fb41ebb29ae1e8facd84a14ae0c
Dariusz Michaluk [Thu, 18 Mar 2021 11:56:31 +0000 (12:56 +0100)]
Fix debug source directory name in coverage script
Change-Id: I0789ea1b0676438e2f1be3c7e55a652074a69e4e
Tomasz Swierczek [Wed, 3 Mar 2021 13:59:09 +0000 (14:59 +0100)]
Fix coverage generation in rpm 4.14.1
Debug source package directories now have different names.
Change-Id: Ic84985a203189b67ce01e0db8be222756e1e2f77
Tomasz Swierczek [Thu, 18 Feb 2021 08:50:52 +0000 (09:50 +0100)]
Add dependency warning on enabling journal logs in cynara-client
libdbus-policy is going to be integrated with systemd on
kdbus-aware systems. This, combined with cynara-client
which can be configured to use journal (systemd) logs,
can lead to cyclic build dependency:
systemd -> libdbus-policy -> cynara -> systemd
This patch adds a warning comment in spec file where configuration
of the logging module is done and adds a warning displayed from
CMake during build to check the cyclic dependency.
Removal of journal logging was not performend as older cynara
releases used to take advantage of it and the implementation
may be still useful.
Change-Id: I474ae7d6f2724dbaf855adb2c49cea38168d85a3
Konrad Lipinski [Tue, 16 Feb 2021 10:51:30 +0000 (11:51 +0100)]
Move CapacityCache::keyToString() to anonymous namespace
Change-Id: I528688316856505b734109fa5fb6e263f9752def
Konrad Lipinski [Mon, 15 Feb 2021 07:05:17 +0000 (08:05 +0100)]
Shrink CapacityCache keys, speed up generation
Change-Id: Ifc8806b934e7a44a81a3e58e850755ad8baf3765
Krzysztof Jackiewicz [Fri, 12 Feb 2021 09:00:35 +0000 (10:00 +0100)]
Prevent iterator invalidation in CapacityCache
If resultIt happens to point to the element that gets evicted, it will
be invalidated. Perform lookup after possible eviction.
Change-Id: I4d536c6779494f85077a247e3356374346fa35b2
Dariusz Michaluk [Wed, 2 Sep 2020 13:56:43 +0000 (15:56 +0200)]
Automate code coverage measurement
To gather unit tests coverage report:
- use COVERAGE build_type,
- instal cynara-coverage rpm,
- run cynara-coverage.sh script.
Change-Id: I96e113e2fff06e126ea20a1a2bb06dfdd98ae0db
Mateusz Cegielka [Fri, 2 Oct 2020 13:40:40 +0000 (15:40 +0200)]
Fix zero-initialization of class members
Some class members are not zero-initialized, which can cause seemingly
innocent initializations to result in uninitialized memory, which can
cause UB. While unlikely, this shows up as a critical issue in SVACE.
I have changed the constructors so that they explicitly initialize
members in order to fix the issue.
Change-Id: I16e1f253985e1c37f3b5ee67d3d9c91696706054
Dariusz Michaluk [Wed, 2 Sep 2020 13:40:27 +0000 (15:40 +0200)]
Remove unused files
Change-Id: I7751179a91f0b468e67ff6ff621028bfdfbf5f13
Zofia Abramowska [Wed, 5 Aug 2020 16:48:27 +0000 (18:48 +0200)]
Categorize performance unit tests
Categorize into positive/negative test cases.
Change-Id: I19e49df3f26e84f368e744aae235cc3725cdeae6
Zofia Abramowska [Wed, 5 Aug 2020 16:41:30 +0000 (18:41 +0200)]
Categorize EntriesQueue unit tests
Categorize into positive/negative test cases.
Change-Id: I296ea8d0e768eb86eacdfe986ae7e9764e33deb4
Zofia Abramowska [Wed, 5 Aug 2020 16:15:46 +0000 (18:15 +0200)]
Categorize PolicKey unit tests
Categorize into positive/negative test cases.
Change-Id: Ic00e9a906c50f40eb92bfede740e73ef8daa0650
Zofia Abramowska [Wed, 5 Aug 2020 16:12:32 +0000 (18:12 +0200)]
Categorize StorageDeserializer and StorageSerializer unit tests
Categorize into positive/negative test cases.
Change-Id: I3c1c1f295993b9fa511b7401f8929df6bb93e227
Zofia Abramowska [Wed, 5 Aug 2020 16:10:04 +0000 (18:10 +0200)]
Categorize BucketDeserializer unit tests
Categorize into positive/negative test cases.
Change-Id: I6986240e763cc1ea274415b0abaaa4496be0a446
Zofia Abramowska [Wed, 5 Aug 2020 16:06:15 +0000 (18:06 +0200)]
Categorize InMemoryStorageBackend unit tests
Categorize into positive/negative test cases.
Change-Id: Ie5212cef2761849dfbee1430293b7ea2f07215b0
Zofia Abramowska [Wed, 5 Aug 2020 15:56:43 +0000 (17:56 +0200)]
Categorize Storage unit tests
Categorize into positive/negative test cases.
Change-Id: I33b618de130e7d496848f7213ac392279e0f854a
Zofia Abramowska [Wed, 5 Aug 2020 15:52:50 +0000 (17:52 +0200)]
Categorize ChecksumValidator unit tests
Categorize into positive/negative test cases.
Change-Id: I67e876a1b6205bf64e0261278732f95e9593274b
Zofia Abramowska [Wed, 5 Aug 2020 15:48:44 +0000 (17:48 +0200)]
Categorize EntriesManager unit tests
Categorize into positive/negative test cases.
Change-Id: I24f66ec022f60434399567880659b87fca53e4df
Zofia Abramowska [Wed, 5 Aug 2020 15:27:19 +0000 (17:27 +0200)]
Categorize Cynara cmdline parser unit tests
Categorize into positive/negative test cases.
Change-Id: I13a7d04717131024a151b2dd8f321800927353a7
Zofia Abramowska [Wed, 5 Aug 2020 15:21:25 +0000 (17:21 +0200)]
Categorize AdminPolicyParser unit tests
Categorize into positive/negative test cases.
Change-Id: Ia86512bfc7fa91ff1f941c93f4bb279cc5b5a637
Zofia Abramowska [Wed, 5 Aug 2020 15:19:43 +0000 (17:19 +0200)]
Categorize CynaraAdminPolicies unit tests
Categorize into positive/negative test cases.
Change-Id: Ied6728a02db0f05d741afbee24fad0d60e14d91e
Zofia Abramowska [Wed, 5 Aug 2020 14:58:40 +0000 (16:58 +0200)]
Add missing test categorization in ProtocolAdmin negative unit tests
Change-Id: I152549b18c914c5c807484caf90ee6f94b204997
Zofia Abramowska [Mon, 3 Aug 2020 10:41:33 +0000 (12:41 +0200)]
Redo cyad commands dispatcher unit tests
* Minor refactorin
* Categorize into positive/negative test cases
Change-Id: Ib449c1b76863d84cda543db752d965a1b5abbf05
Zofia Abramowska [Fri, 31 Jul 2020 16:20:01 +0000 (18:20 +0200)]
Categorize CmdlineOpts unit tests
Categorize into positive/negative test cases.
Change-Id: Ifa0d505ab9fb2e678f69ea5664f15a1922e5fd5c
Zofia Abramowska [Fri, 24 Jul 2020 17:45:28 +0000 (19:45 +0200)]
Redo Cyad commandline unit tests
* rename positive/negative test cases
* add more negative test cases
Change-Id: I204814abcb11cfa41904ed5f3fa45223421cade5
Zofia Abramowska [Fri, 24 Jul 2020 17:44:33 +0000 (19:44 +0200)]
Fix cyad backup command help position and message
Change-Id: I7c8f0de363e8d3b64922ea9d3947cbf37c04b931
Zofia Abramowska [Fri, 24 Jul 2020 17:01:00 +0000 (19:01 +0200)]
Redo error printing in cyad
* remove unused error message generators
* systematize unknown option, missing option and missing argument
errors printing for all main and sub options
Change-Id: I59368ffc0402b5f07d58616468a045c47fa3596d
Zofia Abramowska [Tue, 21 Jul 2020 16:49:17 +0000 (18:49 +0200)]
Redo Credentials Config Parser unit tests
* Categorize into positive/negative test cases
* Split mixed test cases
Change-Id: I069b535d526aad4496dc6ef2befe7c96e133b8ce
Zofia Abramowska [Tue, 21 Jul 2020 15:20:19 +0000 (17:20 +0200)]
Categorize string validation unit tests
Categorize into positive/negative test cases.
Change-Id: I4675e0a5c8d0d8f5682d3d54667a265cd6ac03f4
Zofia Abramowska [Mon, 20 Jul 2020 18:38:56 +0000 (20:38 +0200)]
Categorize PolicyBucket unit tests
Categorize into positive/negative test cases.
Change-Id: I7f289446a33303cd1e2f1845a925176b6f294aef
Zofia Abramowska [Mon, 20 Jul 2020 18:56:22 +0000 (20:56 +0200)]
Remove unnecessary copies
Change-Id: Iea05840fc9366319f17ccc98919efbbf4c350a99
Zofia Abramowska [Mon, 20 Jul 2020 17:33:09 +0000 (19:33 +0200)]
Categorize PolicyBucketFixture unit tests
Categorize into positive/negative test cases.
Change-Id: Ic78e793e3d9d1ffe8e969f1f2054af2f83dc41ac
Zofia Abramowska [Mon, 20 Jul 2020 17:21:56 +0000 (19:21 +0200)]
Redo unit tests for MonitorGetEntriesRequest in ProtocolMonitorGet
* squash positive test cases
Change-Id: Ida7226e6692548d181cff18f18633d10ce2f6f36
Zofia Abramowska [Mon, 20 Jul 2020 17:01:45 +0000 (19:01 +0200)]
Fix: Add missing using for ::testing::DoAll
Change-Id: I2f1c9b822fba93de3f513854a071b8684e563499
Zofia Abramowska [Mon, 20 Jul 2020 16:55:11 +0000 (18:55 +0200)]
Force googletest to build with c++17 instead of c++11
Newest googletest builds explicitly with c++11. This makes this
standard propagate to cynara-tests compile options and causes
a build break. This should be only a temporary fix, as cynara CMake
build files should be rewritten properly.
Change-Id: I8afa84921fb2eb2979afc6a7e7b072428bdb258f
Zofia Abramowska [Mon, 20 Jul 2020 13:45:57 +0000 (15:45 +0200)]
Redo unit tests for MonitorGetEntriesResponse in ProtocolMonitorGet
* squash positive test cases
* add invalid protocol test cases
Change-Id: I2172a1a8814a924754411704b1d166df681ba92c
Zofia Abramowska [Fri, 17 Jul 2020 16:34:10 +0000 (18:34 +0200)]
Redo unit tests for MonitorGetFlushRequest in ProtocolMonitorGet
* squash positive test cases
Change-Id: I848f90d1e9d565ee186f2728d37951144c297900
Zofia Abramowska [Fri, 17 Jul 2020 16:23:02 +0000 (18:23 +0200)]
Add negative test case to RemoveBucketRequest unit tests
Add invalid protocol test case.
Change-Id: I06ddadc7acbd57c7f2bf52746a7770f23d0ad37f
Zofia Abramowska [Fri, 17 Jul 2020 15:48:49 +0000 (17:48 +0200)]
Redo unit tests for ListResponse in ProtocolAdmin
Change-Id: Ib012cc489597013c1b1af260d1c890af17e6673e
Zofia Abramowska [Fri, 17 Jul 2020 15:25:34 +0000 (17:25 +0200)]
Redo unit tests for ListRequest in ProtocolAdmin
* squash positive test cases
* add invalid protocol test cases
Change-Id: Iff443af42933c5ca8b942844b06c259a533b7627
Zofia Abramowska [Fri, 17 Jul 2020 15:02:35 +0000 (17:02 +0200)]
Add negative test to InsertOrUpdateBucketRequest unit tests
Add invalid protocol test case.
Change-Id: I40928c4db573adaba9c5cc706033c37a7423f93d
Zofia Abramowska [Thu, 16 Jul 2020 17:06:17 +0000 (19:06 +0200)]
Redo unit tests for EraseRequest in ProtocolAdmin
* squash positive test cases
* add invalid protocol test cases
Change-Id: I4e3d65668c3bd42ce56c8b3107b631affe7afd70
Zofia Abramowska [Thu, 16 Jul 2020 16:26:40 +0000 (18:26 +0200)]
Redo unit tests for DescriptionListResponse in ProtocolAdmin
* squash positive test cases
* add invalid protocol test case
Change-Id: I798369d477bf4feefcea93e9ac54423357cf2f26
Zofia Abramowska [Thu, 16 Jul 2020 13:56:23 +0000 (15:56 +0200)]
Categorize unit tests for DescriptionListRequest in ProtocolAdmin
Categorize into positive/negative test cases.
Change-Id: I0a1c0b6b9e53ff31d3000d6994cd665df0d6905c
Zofia Abramowska [Thu, 16 Jul 2020 13:52:47 +0000 (15:52 +0200)]
Redo unit tests for AdminCheckResponse in ProtocolAdmin
* squash positive test cases
* add invalid protocol test case
Change-Id: I2a3e46e2df2942e091aa0620345c91c4e7d10bbb
Zofia Abramowska [Thu, 16 Jul 2020 13:20:14 +0000 (15:20 +0200)]
Redo unit tests for AdminCheckRequest in ProtocolAdmin
* squash positive test cases
* add invalid protocol test cases
Change-Id: Icfbceb6ba42d3ebf96855caf7a44482058fbb883
Zofia Abramowska [Thu, 16 Jul 2020 13:06:55 +0000 (15:06 +0200)]
Categorize BucketRecordCorruptedException unit tests
Categorize into positive/negative test cases.
Change-Id: If2dc7634bfe8eed65265685fb2e7f9407423e252
Zofia Abramowska [Wed, 15 Jul 2020 16:43:22 +0000 (18:43 +0200)]
Add unit tests for CancelResponse in ProtocolClient
Change-Id: If34ce28977fdf13e26a7d89c7a11cd9ce20a287a
Zofia Abramowska [Wed, 15 Jul 2020 16:34:25 +0000 (18:34 +0200)]
Add unit tests for CheckResponse in ProtocolClient
Change-Id: Ibfb00e00db21ca10ba18c6fdcfa5b76fd64ea4f1
Zofia Abramowska [Wed, 15 Jul 2020 16:03:31 +0000 (18:03 +0200)]
Add unit tests for MonitorEntryPutRequest in ProtocolClient
Change-Id: Idb17089a5061fb81fdd2b842c7366f2dbf6821c1
Zofia Abramowska [Wed, 15 Jul 2020 15:12:28 +0000 (17:12 +0200)]
Remove unused code
Change-Id: Ifc6230cc0fdd4044a8967cf619a6e29585ca6228
Zofia Abramowska [Tue, 30 Jun 2020 15:38:37 +0000 (17:38 +0200)]
Add tests for ProtocolSerialization
Change-Id: I9afce8b2635e81c3ffaae45804c1d4b93251b314
Zofia Abramowska [Tue, 30 Jun 2020 14:57:57 +0000 (16:57 +0200)]
Add unit tests MonitorEntriesPutRequest in ProtocolClient
Change-Id: Iab7265f104716cb3607e1b5dd10bb0d3ea53a9f6
Zofia Abramowska [Tue, 9 Jun 2020 17:15:33 +0000 (19:15 +0200)]
Move protocol serialization/deserialization to one place
Move serialization and deserialization of common types to
ProtocolSerialization and ProtocolDeserialization respectively.
This eliminates code redundancy, reduces the possibility of
wrong order of serialization/deserialization and moves protocol
size limits checks to one place.
Currently max container size is 4096. As there is no valid case
when cynara can be passed a 4096-long container, this limit will
be applied, where it hasn't been before, except for
ProtocolMonitorGet, which utilizes different buffer size - 65535.
Change-Id: Id7469015712204b3be8a1aed255dcbfa91975be3
Zofia Abramowska [Tue, 9 Jun 2020 13:01:44 +0000 (15:01 +0200)]
Ensure that MonitorCache capacity is of permissible size
When MonitorCache is flushed its whole content is sent to
Cynara service in one batch. Cynara service should not accept
vectors bigger than CYNARA_MAX_VECTOR_SIZE. Currently this is true,
but this commit adds a compile-time assertion for this limit,
so it won't be changed without realization of the consequences.
Change-Id: I5ae28882ea4c50a7455d2d0d3a7ff76d7ec7a38a
Zofia Abramowska [Mon, 8 Jun 2020 16:55:24 +0000 (18:55 +0200)]
Add unit tests for SimpleCheckRequest in ProtocolClient
Change-Id: Ia797842b01e843f3273d3c436f6d3b38b857cf92
Zofia Abramowska [Fri, 5 Jun 2020 14:49:46 +0000 (16:49 +0200)]
Add negative unit tests for ProtocolClient
Add unit tests for:
* requests and responses not implemented in ProtocolClient
* requests and responses with wrong OpCode
* requests and responses with unfinished frame
Change-Id: I3334a887b6aacac4d4924285da401fec41d7b89f
Zofia Abramowska [Thu, 4 Jun 2020 15:51:53 +0000 (17:51 +0200)]
Add unit tests for CheckRequest in ProtocolClient
Change-Id: I7dec5ab1ae3c78a4c01f00cfd72eb1eb9e2efd1e
Zofia Abramowska [Thu, 4 Jun 2020 15:17:44 +0000 (17:17 +0200)]
Add unit tests for CancelRequest in ProtocolClient
Change-Id: I6644438151faf09eb4aacf5c53e299048c1714fc
Zofia Abramowska [Fri, 5 Jun 2020 11:25:56 +0000 (13:25 +0200)]
Add unit tests for AgentRegisterResponse in ProtocolAgent
Change-Id: Idbdef1ab3315dc4e3238e7fc57f334acdc7583e3
Zofia Abramowska [Fri, 5 Jun 2020 11:01:47 +0000 (13:01 +0200)]
Add unit tests for AgentActionResponse in ProtocolAgent
Change-Id: I88d7ffa5851727d0b0f7905258a40697399bfdfd
Zofia Abramowska [Thu, 4 Jun 2020 13:46:05 +0000 (15:46 +0200)]
Add unit tests for AgentRegisterRequest in ProtocolAgent
Change-Id: I66741df415ced3f8cae240b49aaf276c9097d952
Zofia Abramowska [Thu, 4 Jun 2020 12:18:41 +0000 (14:18 +0200)]
Add unit tests for AgentActionRequest in ProtocolAgent
Change-Id: If94172c87fa6fc6cac6f93ce17edf38e31e2c69f
Zofia Abramowska [Mon, 3 Aug 2020 15:36:10 +0000 (17:36 +0200)]
Release 0.16.0
* Remove logs ifdef from spec files
* Revert "Partially remove libdlog dependency"
Change-Id: Id0e4774c9c50bdce31b161e9d9f9d010e859fdf4
Zofia Abramowska [Mon, 3 Aug 2020 15:34:36 +0000 (17:34 +0200)]
Remove logs ifdef from spec files
Logs backend choice became more complicated, than simple Tizen
version check. This ifdef is no longer accurate and needed.
Change-Id: Ic62497af4753bbd53253a7bf1ec13ff30575d389
Zofia Abramowska [Mon, 3 Aug 2020 10:46:54 +0000 (12:46 +0200)]
Revert "Partially remove libdlog dependency"
This reverts commit
426f9b677c0b6b000ad369e5086726cbdb94e3a1.
Change-Id: I55eedc3b0ea2e9a6772d452c018e3d58b905ebdc
Zofia Abramowska [Fri, 31 Jul 2020 12:21:29 +0000 (14:21 +0200)]
Release 0.15.0
* Dual license cynara under Apache 2.0 or MIT
* Partially remove libdlog dependency
* Add unit tests and redo existing ones to categorize
them into positive/negative test cases
* Minor fixes and refactoring for new unit tests
Change-Id: Ic49ea50bf625bc222bdb8c3d4633a554c7aacd05
Krzysztof Jackiewicz [Mon, 20 Jul 2020 17:20:04 +0000 (19:20 +0200)]
Dual license cynara under Apache 2.0 or MIT
Add licenses to devel packages.
Unify the copyright and license notice formatting.
Change-Id: I0cbd7f9d2fca963737cc2a7df4f9c9bf4c29a9a6
Krzysztof Jackiewicz [Wed, 29 Jul 2020 08:54:59 +0000 (10:54 +0200)]
Partially remove libdlog dependency
Switch to journal logging by default in all modules except cynara service.
This is to avoid libdlog dependency in client libraries.
Only cynara service may depend on libdlog and use it by providing a logging
callback to libcynara-commons.
Minor fixes and refactoring.
Change-Id: I15cf8dae915bd5863db79d27cad539cd7103ea34
Konrad Lipinski [Tue, 7 Jul 2020 08:28:05 +0000 (10:28 +0200)]
Change compare() not implemented assertion to compile time
Change-Id: I2c79edb3cd5d962784490139a996e14638fa33fb
Zofia Abramowska [Wed, 3 Jun 2020 12:48:36 +0000 (14:48 +0200)]
Add negative unit tests for ProtocolAgent
Add unit tests for:
* requests and responses not implemented in ProtocolAgent
* requests and responses with wrong OpCode
* requests and responses with unfinished frame
Change-Id: Ibb3882764fc58d307c4f9ff49d75a116512a9c35
Zofia Abramowska [Fri, 29 May 2020 15:55:52 +0000 (17:55 +0200)]
Add negative unit tests for ProtocolAdmin
Add unit tests for:
* requests and responses which are not implemented in ProtocolAdmin
* requests and responses with wrong opcode
* requests and responses with unfinished frame
Change-Id: Ifa0fa83b6caeaa32315c2abf14ef231005bfe573
Zofia Abramowska [Tue, 2 Jun 2020 14:41:10 +0000 (16:41 +0200)]
Sanitize test data collection
* add template generation for numeric data
* remove redundant static specifier
Change-Id: I6f64988d98c633e55d027bb5c9f5bf0b8b2597a0
Zofia Abramowska [Fri, 29 May 2020 14:23:28 +0000 (16:23 +0200)]
Add unit tests for CodeResponse with ProtocolAdmin
Change-Id: I3aad98d36969b27908cca5a1833531808b0cb6bc
Zofia Abramowska [Thu, 28 May 2020 16:17:05 +0000 (18:17 +0200)]
Add SetPoliciesRequest unit tests
Change-Id: Ia4c6d8c9a48650ac472adc613c1c70707e71285b
Zofia Abramowska [Thu, 28 May 2020 16:16:50 +0000 (18:16 +0200)]
Add RemoveBucketRequest unit tests
Change-Id: I2b0653f614d516f1b701cde904d8fc81c2a4bb7c
Zofia Abramowska [Thu, 28 May 2020 16:16:27 +0000 (18:16 +0200)]
Add InsertOrUpdateBucketRequest unit tests
Change-Id: I5c5eae53ee460a12fe0215a08d1fd02434e888eb
Zofia Abramowska [Mon, 25 May 2020 16:29:38 +0000 (18:29 +0200)]
Add tryCatch and exceptions messages tests
Change-Id: I1d82762ca73e491821336b069570ac961e38c8a8
Zofia Abramowska [Wed, 27 May 2020 15:48:17 +0000 (17:48 +0200)]
Add parameters information to exceptions messages
Fix UnknownPolicyTypeException and BucketNotExistsException
Change-Id: I3e4ef71e9050781d48d9537cf44111d1727bc37e