summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Krzysztof Jackiewicz [Thu, 3 Jul 2014 09:36:48 +0000 (11:36 +0200)]
Use proper include paths
Change-Id: I34973bde473c2f7cfa35b00b04168c42c238726b
Aleksander Zdyb [Wed, 2 Jul 2014 10:52:09 +0000 (12:52 +0200)]
Fix wildcard checks
Fixed bug, where consecutive buckets were filtered with wildcard keys
instead of original key being checked
Change-Id: I97499f41c796a0262e9f8d2a57908cc8a4fc3014
Lukasz Wojciechowski [Mon, 30 Jun 2014 18:12:53 +0000 (20:12 +0200)]
Remove "m_fd" - unused field of RequestContext
Change-Id: I869ff96dea13b9eeac216d9af2159ebb3aaecedf
Lukasz Wojciechowski [Mon, 30 Jun 2014 17:59:07 +0000 (19:59 +0200)]
Implement Logic::check() method using SocketClient
Implementation always checks privilege by sending request to Cynara
service.
Features not implemented:
* No cache is used;
* Session parameter is unused;
* No plugin support is implemented.
Change-Id: Ifdfdd56cceb967a8490f383ae396c5066e8a97fd
Rafal Krypa [Thu, 3 Jul 2014 12:07:35 +0000 (14:07 +0200)]
Add CYNARA_API_SERVICE_NOT_AVAILABLE
This is new external API result code, which is returned, when
Cynara service is not available (a connection to service cannot be
set via UNIX socket)
Change-Id: I53c006f1795c975b1e36a1c20753f090beb603f0
Lukasz Wojciechowski [Mon, 30 Jun 2014 17:51:30 +0000 (19:51 +0200)]
Add SocketClient class
SocketClient class is a class in client library that is
responsible for communication with Cynara service.
It has simple API askCynaraServer() which allows to send a request
and receive response with information about connection state.
Inside it keeps:
Socket - a client socket implementation;
Protocol - for serialization and deserialization of requests and
responses;
Queues - needed for writing and receiving data.
Change-Id: I6f54edd7a7986c60e50eb3119e431fc17da0646c
Aleksander Zdyb [Wed, 2 Jul 2014 07:31:51 +0000 (09:31 +0200)]
Refactorize Cynara::BucketDeserializer
BucketDeserializer is no longer stateless.
The class is now constructed with reference
on input stream. It's easier testable and enables
dependency injection in Cynara::StorageDeserializer.
TODO: Consider squashing with 2 prior commits.
Change-Id: If79727c7759178bd9ac82351b16f043971abd577
Aleksander Zdyb [Wed, 2 Jul 2014 07:29:02 +0000 (09:29 +0200)]
Add Cynara::StorageDeserializer
Change-Id: I4a981bea8b2a43641ff213cbce9cb09fa24cd2dc
Aleksander Zdyb [Wed, 2 Jul 2014 06:55:31 +0000 (08:55 +0200)]
Rename StorageDeserializer to BucketDeserializer
The name StorageDeserializer will be taken by
more general class loading whole db.
TODO: Rename StorageSerializer
Change-Id: I66f5c34c3c47b712f104bc2013da23ef84e4bdd9
Rafal Krypa [Thu, 3 Jul 2014 12:06:40 +0000 (14:06 +0200)]
Add gmock package dependency and enable tests
Change-Id: Idd2a1c392844248934734be3668952b392fda272
Krzysztof Jackiewicz [Fri, 27 Jun 2014 06:33:45 +0000 (08:33 +0200)]
Fix buildbreaks
Change-Id: I34bdc6f54e0290f5b416dcf189a6da2cb7e5f543
Lukasz Wojciechowski [Mon, 30 Jun 2014 07:58:18 +0000 (09:58 +0200)]
Prepare client socket class for connecting cynara service
Class is based on implementation imported from security-server
in previous commit.
Change-Id: I77643de6ec7321d3f6af0b395e1b1e4bf06b3774
Lukasz Wojciechowski [Thu, 26 Jun 2014 23:20:15 +0000 (01:20 +0200)]
Raw copy client-common.cpp from security-server repository
Source of code:
repository: tizen.org/platform/core/security/security-server
patch:
210758dc04b639fbc87df8c1ef6fba7e86b41875
Added file needs adaptation to Cynara. Due to many dependencies
it won't compile. That is why it is not added to CMakeLists yet.
Verification : Because of above patch doesn't need verification.
Change-Id: Ie826567c11ff827cf45043911b54b24275a0ffe7
Lukasz Wojciechowski [Thu, 26 Jun 2014 21:57:10 +0000 (23:57 +0200)]
Switch libcynara-client from bootstrap to cynara service version
Remove cynara-bootstrap implementation.
Add ApiInterface class.
Add Logic class - main class of cynara client.
Logic class implements ApiInterface.
Fix CMakeFile by removing dependencies and updating source files.
Change-Id: Ic6a9ebe9ad9c1de85620b943523e751382083bc6
Lukasz Wojciechowski [Thu, 26 Jun 2014 20:07:09 +0000 (22:07 +0200)]
Clone protocol objects
Add clone method to Protocol class and derivatives.
Use cloned Protocol object for every new socket (created after
accept on listening socket).
Protocol derived classes handle serialization and deserialization
of Requests and Responses. Protocol objects are kept in Descriptor
objects for every open socket in form of shared pointers. All
binary communication through a socket is translated by related
Protocol.
On the server side of Cynara Protocols are used as ResponseTakers
(they consume Responses ready to send back to clients). Pointers
to Protocols as ResponseTakers are kept in RequestContext as weak
pointers. RequestContext may be (will be in the future) saved
by Plugin in order to run some UI and return Response later.
Meanwhile a socket can be closed. In such a case weak pointer shall
lose his reference to Protocol object, which was destroyed in
Descriptor::close() method. Before returning Response to
ResponseTaker, validation of weak pointer is made in
RequestContext::cynaraResponse().
Change-Id: I5a6af197357c8ff641aa1162fd30c01bbe725786
Lukasz Wojciechowski [Thu, 26 Jun 2014 19:12:31 +0000 (21:12 +0200)]
Complete response handling path
Add Response class - base for all response classes.
Add extractResponseFromBuffer() method to all protocol classes.
Change all response objects references to shared pointers.
Change-Id: I9ac88c8e70ca8084bc2653a0b6aa545320d8de35
Lukasz Wojciechowski [Thu, 26 Jun 2014 12:13:37 +0000 (14:13 +0200)]
Change Cynara class model from singleton to common object
Use shared pointers for layers managers (Logic, SocketManager,
Storage). Add bind...() and unbindAll() methods in layers managers.
Change-Id: If7fe5f36933e244c48c3ab2b6699a0d9b8e4f4a7
Aleksander Zdyb [Thu, 26 Jun 2014 12:36:10 +0000 (14:36 +0200)]
Add Cynara::StorageDeserializer
Change-Id: I402276fc32aec5839dc5e20b323fbc639dc6ff14
Lukasz Wojciechowski [Thu, 26 Jun 2014 11:03:12 +0000 (13:03 +0200)]
Adapt protocol, request and response classes to common
Update of includes, defines and CMakeLists.
This patch should be verified together with previous one.
Change-Id: I08e38dcba381a2514981068adbabb2e3b35088a5
Lukasz Wojciechowski [Thu, 26 Jun 2014 10:42:34 +0000 (12:42 +0200)]
Move protocol, request and response classes to common
This patch won't compile. It is a raw move. Update of includes,
defines and CMakeLists will be done in next patch.
They should be verified together.
Change-Id: I667c25419ec95ea686175bcd870f0126b828e41c
Lukasz Wojciechowski [Thu, 26 Jun 2014 10:27:35 +0000 (12:27 +0200)]
Derive Protocol from RequestTaker
Protocol will play role of RequestTaker on library side of Cynara.
Change-Id: Ife92e6f634bfd9e566b6f4f3c2b331022e961de7
Aleksander Zdyb [Thu, 26 Jun 2014 10:32:54 +0000 (12:32 +0200)]
Add Cynara::BucketRecordCorruptedException
Change-Id: Id4b28a9c3dfbf5e4bae0c750dc8d173db44eea6e
Lukasz Wojciechowski [Thu, 26 Jun 2014 10:12:13 +0000 (12:12 +0200)]
Use shared and weak pointers for ReponseTaker and RequestContext
Change-Id: I711a2c97819d7a363fa1b2d1401e7156554a2e09
Lukasz Wojciechowski [Thu, 26 Jun 2014 09:03:41 +0000 (11:03 +0200)]
Move ResponseTaker class to response directory
Change-Id: I5bbe58347dbe1411eaeb88dd173c0107b4bfd636
Lukasz Wojciechowski [Wed, 25 Jun 2014 19:18:06 +0000 (21:18 +0200)]
Change request execution path
Add RequestTaker - interface for objects executing requests.
Derive Logic from RequestTaker.
Implement CheckRequest execution in Logic.
Swap const references to Request derivatives with shared pointers.
Add pointers.h file to gather all request related shared pointers.
Remove Request.cpp file (all methods inlined).
Fix SocketManager request execution.
Remove not any more needed NoResponseGeneratedException class.
Add temporary impl. of method requestTaker() to SocketManager.
Change-Id: I67526fb1f68cc90c5340572445ce63068bed03ea
Lukasz Wojciechowski [Wed, 25 Jun 2014 18:07:18 +0000 (20:07 +0200)]
Move adding sockets to write set to SocketManager main loop
Change-Id: Id06b23612992e9c134b69e42746f2af44eb0a8ec
Adam Malinowski [Tue, 24 Jun 2014 13:51:27 +0000 (15:51 +0200)]
Adapt ProtocolSerialization to Cynara
Change-Id: I92cab43eeb1861459dcd19fe1da2e6e0862a32c5
Adam Malinowski [Tue, 24 Jun 2014 13:18:39 +0000 (15:18 +0200)]
Import of DPL class Serialization from Security-Server
Change-Id: I3800e5f7bf54500a2b02e0674fa62e1ec774acea
Adam Malinowski [Mon, 23 Jun 2014 17:03:54 +0000 (19:03 +0200)]
Fix user adding & deleting during installing and uninstalling process
Verification:
Build cynara and install it on "fresh" image which contains already
installed cynara rush edition.
Cynara service should start during installation without any warnings
nor errors.
run "systemctl status cynara.service" to check if cynara service works.
Change-Id: I1c98165230277b7ae11d5157c2abd9712067f85f
Adam Malinowski [Mon, 23 Jun 2014 12:09:29 +0000 (14:09 +0200)]
Add backtrace building functionality
Change-Id: I3443b444d6f7a6f507e55a88c36c936274965e3e
Lukasz Wojciechowski [Mon, 23 Jun 2014 17:38:00 +0000 (19:38 +0200)]
Add refs to ResponseTaker and ResponseQueue to RequestContext
Add mentioned references and avoid explicit calls to SocketManager.
Remove not needed methods and RequestContext.cpp file.
Change-Id: I26a4f5f0349b2b27ccc485d496c5d04b7ad792df
Lukasz Wojciechowski [Fri, 20 Jun 2014 22:39:46 +0000 (00:39 +0200)]
Use Storage to return value for check() function in Logic layer
Change-Id: I30bdb8eafffa6a5cc06c9ddac3a724412c10733b
Aleksander Zdyb [Mon, 23 Jun 2014 10:32:10 +0000 (12:32 +0200)]
Add wildcard tests for Cynara::PolicyBucket
Add some convenience functions to Cynara::PolicyKey
Change-Id: Iddd51ca16f85199e2f8993c95120dcdbc6b5d7eb
Lukasz Wojciechowski [Fri, 20 Jun 2014 21:45:37 +0000 (23:45 +0200)]
Rearrange classes for request and response processing
RequestContext object is the only one passed from SocketManager
to Request execute() method.
Response object is passed to Protocol through
RequestContext::returnResponse().
Response queue is managed automaticaly in RequestContext class.
Request derivatives don't need to handle queues.
ResponseTaker::appendResponseToBuffer() methods need to take
additional queue object as parameter as it is no longer
part of response object.
Change-Id: I15af84c315a55284d4dccff670537e47c60c6b70
Lukasz Wojciechowski [Fri, 20 Jun 2014 21:27:12 +0000 (23:27 +0200)]
Define ResponseTaker interface for binding response handling
ResponseTaker is base interface for Protocol class.
Its implementation of appendResponseToBuffer methods throw.
They must be overridden in proper Protocol derivatives.
Change-Id: Ia16008c52f660ebc45143b9e67a741d632c674bc
Lukasz Wojciechowski [Fri, 20 Jun 2014 17:18:19 +0000 (19:18 +0200)]
Change Request* to RequestPtr implemented as shared_ptr<Request>
Handle case when no response is generated during request execution.
Change-Id: I2ffbcd520dcb910bae7ee342ab432fae457ef437
Aleksander Zdyb [Fri, 20 Jun 2014 13:01:14 +0000 (15:01 +0200)]
Add tests for Cynara::PolicyBucket
Added some convenience methods to PolicyType and PolicyResult
Change-Id: Ibcc1200403132cd16879c6afbc859e851c2a3dac
Lukasz Wojciechowski [Fri, 20 Jun 2014 16:57:19 +0000 (18:57 +0200)]
Change Protocol* to ProtocolPtr implemented with shared_ptr
Change-Id: Ic1b6e7dd50ddf011e8700fa65fdb05560df3f32a
Lukasz Wojciechowski [Fri, 20 Jun 2014 12:59:53 +0000 (14:59 +0200)]
Use unique_ptr for request handling
Change-Id: Ib39099fb34e192b11d1c38c9fd89cd895e97b7da
Lukasz Wojciechowski [Wed, 18 Jun 2014 19:54:42 +0000 (21:54 +0200)]
Add CheckRequest class
Change-Id: I98ecece4473f9806e6515320402e607f8d6dfffb
Lukasz Wojciechowski [Wed, 18 Jun 2014 19:53:12 +0000 (21:53 +0200)]
Add CheckResponse handling
Change-Id: I68553c633dac84a92caf956f00bc95bb9eef33d0
Lukasz Wojciechowski [Wed, 18 Jun 2014 19:49:41 +0000 (21:49 +0200)]
Redesign RequestContext to avoid cyclic dependencies
Change-Id: Ia3ff6511f279a43c972eb47ec984d16dd13d5a27
Lukasz Wojciechowski [Wed, 18 Jun 2014 19:44:43 +0000 (21:44 +0200)]
Add stub function check in Logic layer
Change-Id: Ia4774c17ace192451a8d125e1b4d7dbd688d6130
Lukasz Wojciechowski [Wed, 18 Jun 2014 19:39:05 +0000 (21:39 +0200)]
Widen descriptor class with usage flag
Change-Id: Ia607a96374955db7afb80d839b34e23058b54b85
Lukasz Wojciechowski [Wed, 18 Jun 2014 16:42:14 +0000 (18:42 +0200)]
Add Storage Layer objects to Cynara singleton
Change-Id: I5e1a8ba06f811d3611956666329e8811424134ad
Lukasz Wojciechowski [Wed, 18 Jun 2014 16:40:37 +0000 (18:40 +0200)]
Add Storage related classes to CMakeLists, fix includes
Change-Id: Ie8f8e63df145ae80bca8b9e5022eec4f751a0ece
Lukasz Wojciechowski [Mon, 16 Jun 2014 19:46:23 +0000 (21:46 +0200)]
Add early cynara service implementation
Change-Id: I3007944f08f9c29cab6e6b755c4996f38db3ab0d
Lukasz Wojciechowski [Tue, 17 Jun 2014 19:24:28 +0000 (21:24 +0200)]
Remove temporary added dummy file common.cpp
It was added for keeping library non-empty at the begining of cynara
implementation. It is no longer needed.
Change-Id: Ied7f97dec91dda7f17d9c860ee6a32d86dd145c1
Lukasz Wojciechowski [Tue, 17 Jun 2014 19:21:23 +0000 (21:21 +0200)]
Fix email address
Change-Id: I11af1a0e98a168aa1ee12ea2d2016bd9129f0fe1
Lukasz Wojciechowski [Tue, 17 Jun 2014 19:12:53 +0000 (21:12 +0200)]
Adapt BinaryQueue to Cynara. Add new exception classes
Change-Id: Ide3a7eb6e9d44c265d67285b863dabe5cfe52079
Change: code formatting, ifdef guards, exceptions, nocopyability, namespace.
Lukasz Wojciechowski [Tue, 17 Jun 2014 16:17:49 +0000 (18:17 +0200)]
Import of DPL class binary_queue from SecurityServer
src repo : ssh://review.tizen.org:29418/platform/core/security/security-server
commit :
9d7d2f242d036ed8f07e4afa108709524b1af409
Warning this class won't compile:
1) files are not added to CMake;
2) another required DPL classes not needed by cynara aren't imported
Change-Id: I1002e84e17d9f83c1210187404a0480d6cd6433e
Aleksander Zdyb [Fri, 20 Jun 2014 08:34:03 +0000 (10:34 +0200)]
Add storage serializer (Cynara::StorageSerializer)
Change-Id: I10bbfae96e33a99d3d089dab313dc259e080aa5d
Aleksander Zdyb [Fri, 20 Jun 2014 09:54:56 +0000 (11:54 +0200)]
Change PolicyType enum to PredefinedPolicyType for consts
PolicyType cannot be an enum, because it needs
to hold values other than just those predefined
Change-Id: I9038b57a1fc80c6c3eb3b87e74037073e9342ebd
Aleksander Zdyb [Fri, 13 Jun 2014 07:17:14 +0000 (09:17 +0200)]
Add base class (Cynara::Exception) for all exceptions
Change-Id: I21c59558b4d2696907cfc69b4fac952d6b875e85
Aleksander Zdyb [Fri, 6 Jun 2014 07:26:50 +0000 (09:26 +0200)]
Add temporary CMakeLists.txt for tests
Possible verification:
1. cd test; mkdir build; cd build
2. cmake -D GMOCK_DIR=/path/to/gmock-1.7.0 -D CYNARA_SRC=../src/ ..
3. make
4. ./cynara-tests
Change-Id: I9a3a84a8f8c4ec7596368366e55d74cf85f4202b
Aleksander Zdyb [Mon, 16 Jun 2014 07:32:51 +0000 (09:32 +0200)]
Add tests for InMemoryStorageBackend and Storage
Change-Id: I756457678619ad2efa6fd469f6b442018e565cdc
Aleksander Zdyb [Tue, 10 Jun 2014 12:38:41 +0000 (14:38 +0200)]
Add InMemoryStorageBackend for Cynara::Storage
Change-Id: I46a53657d3f0e36318abc91572d38e64b3e03607
Aleksander Zdyb [Fri, 13 Jun 2014 06:27:58 +0000 (08:27 +0200)]
Refactorize code to make it easier testable
Change-Id: I60f18fa2d811cb2d94e0a220f4e4131af1491b0a
Adam Malinowski [Thu, 22 May 2014 11:15:34 +0000 (13:15 +0200)]
Preparation of cynara for better usage of systemd.
Change-Id: Ie210b1422ace6ebe45a3804fd52b701fe9fe13f3
Adam Malinowski [Thu, 22 May 2014 10:51:00 +0000 (12:51 +0200)]
Add logging helper.
Change-Id: Ib4006dd6a813e9de795333458eb5fa3620aa46d9
Rafal Krypa [Thu, 3 Jul 2014 12:04:52 +0000 (14:04 +0200)]
Move sockets from /tmp to /run/cynara.
Change-Id: I2a8dc63f69de4e7e8d737184bf9070d4cded5c36
Adam Malinowski [Thu, 22 May 2014 10:25:28 +0000 (12:25 +0200)]
Fixed compilation in DEBUG mode.
Change-Id: I0074df6dcadc6793d3faec9f669e1eaabf6d2fb2
Lukasz Wojciechowski [Tue, 13 May 2014 17:23:40 +0000 (19:23 +0200)]
Prepare structures and API for Storage layer of cynara service.
[Bug/Feature] N/A
[Cause] Developement of cynara
[Solution] Creating basic classes and defines for implementation
[Verification] Build and install
Change-Id: I62999c946113bec252fb330514c9134ddb894d47
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Lukasz Wojciechowski [Thu, 8 May 2014 14:27:51 +0000 (16:27 +0200)]
Implement cynara-bootstrap version of libcynara-client
This is temporary version - it's implementation is based on
security-server and libprivilege-control instead of cynara service.
[Bug/Feature] N/A
[Cause] First working version of cynara's client.
[Solution] Implementation temporary based on security-server.
[Verification] Should be build along with all other patches
marked with topic:cynara-bootstrap.
Build needs: http://review.tizen.org/gerrit/#/c/20519/
Change-Id: I8468b6756c9844840f3b3bea37f498b08b7f7188
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Lukasz Wojciechowski [Thu, 8 May 2014 14:11:43 +0000 (16:11 +0200)]
Add cynara directory structure, manifest and build files
Definition of libcynara-client header
[Bug/Feature] N/A
[Cause] Definition of repository and build structure.
[Solution] Directory structure and build system files added.
[Verification] Should build on all platforms and provide following
packages:cynara, libcynara-admin, libcynara-client.
Change-Id: I922c2e0ccce5b0e49302aa643afbc2fbb9778cd2
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Sehong Na [Tue, 29 Apr 2014 03:45:23 +0000 (20:45 -0700)]
Initial empty repository