From 96fc8d9bd0705063691fbe387b8e7ea5c0c0fa5c Mon Sep 17 00:00:00 2001 From: Adam Malinowski Date: Fri, 24 Oct 2014 16:05:58 +0200 Subject: [PATCH 01/16] Add agent manager This commit introduces AgentManager class which will help plugins in communication with agents. Also registering and unregistering agents will be handled by this class. Change-Id: Id3f7e5785223c3b0316f97bc8107805572a0fd10 --- src/service/CMakeLists.txt | 1 + src/service/agent/AgentManager.cpp | 120 +++++++++++++++++++++++++++++++++++++ src/service/agent/AgentManager.h | 72 ++++++++++++++++++++++ src/service/logic/Logic.cpp | 5 +- src/service/logic/Logic.h | 6 ++ src/service/main/Cynara.cpp | 4 ++ src/service/main/Cynara.h | 1 + src/service/main/pointers.h | 3 + 8 files changed, 210 insertions(+), 2 deletions(-) create mode 100644 src/service/agent/AgentManager.cpp create mode 100644 src/service/agent/AgentManager.h diff --git a/src/service/CMakeLists.txt b/src/service/CMakeLists.txt index d6fd025..675a866 100644 --- a/src/service/CMakeLists.txt +++ b/src/service/CMakeLists.txt @@ -19,6 +19,7 @@ SET(CYNARA_SERVICE_PATH ${CYNARA_PATH}/service) SET(CYNARA_SOURCES + ${CYNARA_SERVICE_PATH}/agent/AgentManager.cpp ${CYNARA_SERVICE_PATH}/agent/AgentTalker.cpp ${CYNARA_SERVICE_PATH}/logic/Logic.cpp ${CYNARA_SERVICE_PATH}/main/Cynara.cpp diff --git a/src/service/agent/AgentManager.cpp b/src/service/agent/AgentManager.cpp new file mode 100644 index 0000000..ee91e64 --- /dev/null +++ b/src/service/agent/AgentManager.cpp @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file src/service/agent/AgentManager.cpp + * @author Adam Malinowski + * @version 1.0 + * @brief Definition of AgentManager class + */ + +#include + +#include +#include +#include + +#include "AgentManager.h" + +namespace Cynara { + +AgentRegisterResponse::Code AgentManager::registerAgent(const AgentType &agentType, + const LinkId &linkId) { + if (m_agents.find(agentType) != m_agents.end()) { + return AgentRegisterResponse::REJECTED; + } + + if (m_agents.insert(std::make_pair(agentType, linkId)).second) { + LOGI("Registered agent: <%s>", agentType.c_str()); + return AgentRegisterResponse::DONE; + } + + LOGE("Error in registering agent: <%s>", agentType.c_str()); + return AgentRegisterResponse::ERROR; +} + +bool AgentManager::getAgentType(const LinkId &linkId, AgentType &agentType) const { + for (const auto &x : m_agents) { + if (x.second == linkId) { + agentType = x.first; + return true; + } + } + return false; +} + +void AgentManager::unregisterAgent(const LinkId &linkId) { + AgentType agentType; + if (!getAgentType(linkId, agentType)) { + LOGD("Trying to unregister not registered agent"); + return; + } + m_agents.erase(agentType); + m_talkers.erase(linkId); + LOGI("Unregistered agent: <%s>", agentType.c_str()); +} + +AgentTalkerPtr AgentManager::createTalker(const AgentType &agentType) { + try { + ProtocolFrameSequenceNumber checkId = generateSequenceNumber(agentType); + const LinkId &linkId = m_agents.at(agentType); + + AgentTalkerPtr talker = std::make_shared(agentType, linkId, checkId); + if (m_talkers[linkId].insert(std::make_pair(checkId, talker)).second) { + LOGD("Created talker for: <%s>:[%" PRIu16 "]", agentType.c_str(), checkId); + return talker; + } + } catch (const std::out_of_range &) { + LOGE("Proper agent not found: <%s>", agentType.c_str()); + } + + return AgentTalkerPtr(); +} + +ProtocolFrameSequenceNumber AgentManager::generateSequenceNumber(const AgentType &agentType UNUSED) +{ + // TODO: implement smart sequence number generation, maybe unique per agent + return m_sequenceNumber++; +} + +AgentTalkerPtr AgentManager::getTalker(const LinkId &linkId, ProtocolFrameSequenceNumber requestId) + const { + const auto talkerMap = m_talkers.find(linkId); + if (talkerMap == m_talkers.end()) { + return AgentTalkerPtr(); + } + + const auto talker = talkerMap->second.find(requestId); + return talker != talkerMap->second.end() ? talker->second : AgentTalkerPtr(); +} + +void AgentManager::removeTalker(const AgentTalkerPtr &agentTalker) { + m_talkers[agentTalker->linkId()].erase(agentTalker->checkId()); +} + +void AgentManager::cleanupAgent(const LinkId &linkId, TalkerCleanupFunction cleanupFunction) { + auto talkerMap = m_talkers.find(linkId); + if (talkerMap == m_talkers.end()) + return; + + if (cleanupFunction) { + for (auto p : talkerMap->second) { + cleanupFunction(p.second); + } + } + unregisterAgent(linkId); +} + +} // namespace Cynara diff --git a/src/service/agent/AgentManager.h b/src/service/agent/AgentManager.h new file mode 100644 index 0000000..38dca72 --- /dev/null +++ b/src/service/agent/AgentManager.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file src/service/agent/AgentManager.h + * @author Adam Malinowski + * @version 1.0 + * @brief Declaration of AgentManager class + */ + +#ifndef SRC_SERVICE_AGENT_AGENTMANAGER_H_ +#define SRC_SERVICE_AGENT_AGENTMANAGER_H_ + +#include +#include + +#include +#include +#include +#include +#include + +#include + +namespace Cynara { + +class AgentManager { +public: + typedef std::map Talkers; + typedef std::function TalkerCleanupFunction; + + AgentManager() : m_sequenceNumber(0) {} + ~AgentManager() {} + + typedef enum { + RR_DONE, + RR_REJECTED, + RR_ERROR + } RegisterResult; + + AgentRegisterResponse::Code registerAgent(const AgentType &agentType, const LinkId &linkId); + + AgentTalkerPtr createTalker(const AgentType &agentType); + void removeTalker(const AgentTalkerPtr &agentTalkerPtr); + AgentTalkerPtr getTalker(const LinkId &linkId, ProtocolFrameSequenceNumber requestId) const; + void cleanupAgent(const LinkId &linkId, TalkerCleanupFunction cleanupFunction); + +private: + std::map m_agents; + std::map m_talkers; + ProtocolFrameSequenceNumber m_sequenceNumber; + + ProtocolFrameSequenceNumber generateSequenceNumber(const AgentType &agentType); + bool getAgentType(const LinkId &linkId, AgentType &agentType) const; + void unregisterAgent(const LinkId &linkId); +}; + +} // namespace Cynara + +#endif /* SRC_SERVICE_AGENT_AGENTMANAGER_H_ */ diff --git a/src/service/logic/Logic.cpp b/src/service/logic/Logic.cpp index 55f9f63..7227ef9 100644 --- a/src/service/logic/Logic.cpp +++ b/src/service/logic/Logic.cpp @@ -48,6 +48,7 @@ #include #include
+#include #include #include @@ -82,9 +83,9 @@ void Logic::execute(RequestContextPtr context, AdminCheckRequestPtr request) { } void Logic::execute(RequestContextPtr context, AgentRegisterRequestPtr request) { - // MOCKUP + auto result = m_agentManager->registerAgent(request->agentType(), context->responseQueue()); context->returnResponse(context, std::make_shared( - AgentRegisterResponse::DONE, request->sequenceNumber())); + result, request->sequenceNumber())); } void Logic::execute(RequestContextPtr context, CancelRequestPtr request) { diff --git a/src/service/logic/Logic.h b/src/service/logic/Logic.h index 18d8abb..fdf338e 100644 --- a/src/service/logic/Logic.h +++ b/src/service/logic/Logic.h @@ -38,6 +38,10 @@ public: Logic(); virtual ~Logic(); + void bindAgentManager(const AgentManagerPtr &agentManager) { + m_agentManager = agentManager; + } + void bindPluginManager(PluginManagerPtr pluginManager) { m_pluginManager = pluginManager; } @@ -51,6 +55,7 @@ public: } void unbindAll(void) { + m_agentManager.reset(); m_pluginManager.reset(); m_storage.reset(); m_socketManager.reset(); @@ -68,6 +73,7 @@ public: virtual void contextClosed(RequestContextPtr context); private: + AgentManagerPtr m_agentManager; PluginManagerPtr m_pluginManager; StoragePtr m_storage; SocketManagerPtr m_socketManager; diff --git a/src/service/main/Cynara.cpp b/src/service/main/Cynara.cpp index c0f77ef..96443ce 100644 --- a/src/service/main/Cynara.cpp +++ b/src/service/main/Cynara.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -47,12 +48,14 @@ Cynara::~Cynara() { } void Cynara::init(void) { + m_agentManager = std::make_shared(); m_logic = std::make_shared(); m_pluginManager = std::make_shared(PathConfig::PluginPath::serviceDir); m_socketManager = std::make_shared(); m_storageBackend = std::make_shared(PathConfig::StoragePath::dbDir); m_storage = std::make_shared(*m_storageBackend); + m_logic->bindAgentManager(m_agentManager); m_logic->bindPluginManager(m_pluginManager); m_logic->bindStorage(m_storage); m_logic->bindSocketManager(m_socketManager); @@ -79,6 +82,7 @@ void Cynara::finalize(void) { m_socketManager->unbindAll(); } + m_agentManager.reset(); m_logic.reset(); m_pluginManager.reset(); m_socketManager.reset(); diff --git a/src/service/main/Cynara.h b/src/service/main/Cynara.h index 2eb94dc..89bdd76 100644 --- a/src/service/main/Cynara.h +++ b/src/service/main/Cynara.h @@ -37,6 +37,7 @@ public: void finalize(void); private: + AgentManagerPtr m_agentManager; LogicPtr m_logic; PluginManagerPtr m_pluginManager; SocketManagerPtr m_socketManager; diff --git a/src/service/main/pointers.h b/src/service/main/pointers.h index e31eeb8..f32c4ab 100644 --- a/src/service/main/pointers.h +++ b/src/service/main/pointers.h @@ -27,6 +27,9 @@ namespace Cynara { +class AgentManager; +typedef std::shared_ptr AgentManagerPtr; + class Logic; typedef std::shared_ptr LogicPtr; -- 2.7.4 From e67f20e8674202893ccfa0f7332acd6a567c404a Mon Sep 17 00:00:00 2001 From: Adam Malinowski Date: Mon, 3 Nov 2014 11:16:22 +0100 Subject: [PATCH 02/16] Add CheckContext class This class will be used for storing all data related to check request. This data will be used to send response to client when answer is ready. Change-Id: I20b665409e15d249a9c55615a39f4ab5b361bc18 --- src/service/request/CheckContext.h | 68 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/service/request/CheckContext.h diff --git a/src/service/request/CheckContext.h b/src/service/request/CheckContext.h new file mode 100644 index 0000000..5184296 --- /dev/null +++ b/src/service/request/CheckContext.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file src/service/request/CheckContext.h + * @author Adam Malinowski + * @version 1.0 + * @brief Declaration of CheckContext class + */ + +#ifndef SRC_SERVICE_REQUEST_CHECKCONTEXT_H_ +#define SRC_SERVICE_REQUEST_CHECKCONTEXT_H_ + +#include + +#include +#include +#include +#include + +#include + +#include + +namespace Cynara { + +class CheckContext { +public: + CheckContext(const PolicyKey &key, RequestContextPtr requestContext, + ProtocolFrameSequenceNumber checkId, ServicePluginInterfacePtr plugin, + const AgentTalkerPtr &agentTalkerPtr) : m_agentTalker(agentTalkerPtr), + m_checkId(checkId), m_key(key), m_plugin(plugin), + m_requestContext(requestContext), m_cancelled(false) {} + ~CheckContext() {} + + AgentTalkerPtr m_agentTalker; + const ProtocolFrameSequenceNumber m_checkId; + const PolicyKey m_key; + ServicePluginInterfacePtr m_plugin; + RequestContextPtr m_requestContext; + bool m_cancelled; + + void cancel(void) { + m_cancelled = true; + } + + bool cancelled(void) const { + return m_cancelled; + } +}; + +typedef std::shared_ptr CheckContextPtr; + +} // namespace Cynara + +#endif /* SRC_SERVICE_REQUEST_CHECKCONTEXT_H_ */ -- 2.7.4 From fabe257134bcd544deeb68de52ca6ed0eb0a0da4 Mon Sep 17 00:00:00 2001 From: Adam Malinowski Date: Mon, 3 Nov 2014 11:21:25 +0100 Subject: [PATCH 03/16] Add manager for check contexts This class will be used by service logic to create and handle check contexts. Change-Id: I8c1f1265336dd8b5a428ed254083d1e508579a2e --- src/service/CMakeLists.txt | 1 + src/service/logic/Logic.h | 2 + src/service/request/CheckRequestManager.cpp | 91 +++++++++++++++++++++++++++++ src/service/request/CheckRequestManager.h | 61 +++++++++++++++++++ 4 files changed, 155 insertions(+) create mode 100644 src/service/request/CheckRequestManager.cpp create mode 100644 src/service/request/CheckRequestManager.h diff --git a/src/service/CMakeLists.txt b/src/service/CMakeLists.txt index 675a866..d4dd32e 100644 --- a/src/service/CMakeLists.txt +++ b/src/service/CMakeLists.txt @@ -24,6 +24,7 @@ SET(CYNARA_SOURCES ${CYNARA_SERVICE_PATH}/logic/Logic.cpp ${CYNARA_SERVICE_PATH}/main/Cynara.cpp ${CYNARA_SERVICE_PATH}/main/main.cpp + ${CYNARA_SERVICE_PATH}/request/CheckRequestManager.cpp ${CYNARA_SERVICE_PATH}/sockets/Descriptor.cpp ${CYNARA_SERVICE_PATH}/sockets/SocketManager.cpp ) diff --git a/src/service/logic/Logic.h b/src/service/logic/Logic.h index fdf338e..35226d7 100644 --- a/src/service/logic/Logic.h +++ b/src/service/logic/Logic.h @@ -28,6 +28,7 @@ #include
#include +#include #include #include @@ -74,6 +75,7 @@ public: private: AgentManagerPtr m_agentManager; + CheckRequestManager m_checkRequestManager; PluginManagerPtr m_pluginManager; StoragePtr m_storage; SocketManagerPtr m_socketManager; diff --git a/src/service/request/CheckRequestManager.cpp b/src/service/request/CheckRequestManager.cpp new file mode 100644 index 0000000..8090f47 --- /dev/null +++ b/src/service/request/CheckRequestManager.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file src/service/request/CheckRequestManager.cpp + * @author Adam Malinowski + * @version 1.0 + * @brief Definition of CheckRequestManager class + */ + +#include + +#include +#include +#include + +#include "CheckRequestManager.h" + +namespace Cynara { + +CheckContextPtr CheckRequestManager::createContext(const PolicyKey &key, + const RequestContextPtr &request, + ProtocolFrameSequenceNumber checkId, + const ServicePluginInterfacePtr &plugin, + const AgentTalkerPtr &agentTalkerPtr) { + + CheckContextPtr checkPtr = std::make_shared(key, request, checkId, plugin, + agentTalkerPtr); + if (m_checks[request->responseQueue()].insert(std::make_pair(checkId, checkPtr)).second) { + return checkPtr; + } + + return CheckContextPtr(); +} + +CheckContextPtr CheckRequestManager::getContext(const LinkId &linkId, + ProtocolFrameSequenceNumber checkId) { + const auto checkMap = m_checks.find(linkId); + if (checkMap == m_checks.end()) { + return CheckContextPtr(); + } + + const auto checkContext = checkMap->second.find(checkId); + return checkContext != checkMap->second.end() ? checkContext->second : CheckContextPtr(); +} + +CheckContextPtr CheckRequestManager::getContext(const AgentTalkerPtr &talker) { + for (const auto &checkMap : m_checks) { + for (const auto &check : checkMap.second) { + if (check.second->m_agentTalker == talker) { + return check.second; + } + } + } + return nullptr; +} + +void CheckRequestManager::removeRequest(const CheckContextPtr &checkContextPtr) { + m_checks[checkContextPtr->m_requestContext->responseQueue()].erase(checkContextPtr->m_checkId); + auto it = m_checks.find(checkContextPtr->m_requestContext->responseQueue()); + if (it->second.empty()) { + m_checks.erase(it); + } +} + +void CheckRequestManager::cancelRequests(const LinkId &linkId, CancelRequestFunction cancelFunction) +{ + auto checkMap = m_checks.find(linkId); + if (checkMap == m_checks.end()) + return; + + if (cancelFunction) { + for (auto p : checkMap->second) { + cancelFunction(p.second); + } + } +} + +} // namespace Cynara diff --git a/src/service/request/CheckRequestManager.h b/src/service/request/CheckRequestManager.h new file mode 100644 index 0000000..f71f8f1 --- /dev/null +++ b/src/service/request/CheckRequestManager.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file src/service/request/CheckRequestManager.h + * @author Adam Malinowski + * @version 1.0 + * @brief Declaration of CheckRequestManager class + */ + +#ifndef SRC_SERVICE_AGENT_CHECKREQUESTMANAGER_H_ +#define SRC_SERVICE_AGENT_CHECKREQUESTMANAGER_H_ + +#include +#include + +#include +#include +#include + +#include + +namespace Cynara { + +class CheckRequestManager { +public: + typedef std::map CheckContexts; + typedef std::function CancelRequestFunction; + + CheckRequestManager() {} + ~CheckRequestManager() {} + + CheckContextPtr createContext(const PolicyKey &key, const RequestContextPtr &request, + ProtocolFrameSequenceNumber checkId, + const ServicePluginInterfacePtr &plugin, + const AgentTalkerPtr &agentTalkerPtr); + void removeRequest(const CheckContextPtr &checkContextPtr); + + CheckContextPtr getContext(const LinkId &linkId, ProtocolFrameSequenceNumber checkId); + CheckContextPtr getContext(const AgentTalkerPtr &talker); + void cancelRequests(const LinkId &linkId, CancelRequestFunction cancelFunction); + +private: + std::map m_checks; +}; + +} // namespace Cynara + +#endif /* SRC_SERVICE_AGENT_CHECKREQUESTMANAGER_H_ */ -- 2.7.4 From 95108c995a7705cbb89769cd6f0beb6fa8545741 Mon Sep 17 00:00:00 2001 From: Adam Malinowski Date: Mon, 3 Nov 2014 14:45:03 +0100 Subject: [PATCH 04/16] Handle check request with agent usage This patch introduces sending request to agent and storing context for future. Change-Id: I8187b4c5e66daa155b485b5ff6b9710de27f6345 --- src/service/agent/AgentManager.cpp | 2 +- src/service/logic/Logic.cpp | 50 ++++++++++++++++++++++++++++++++------ src/service/logic/Logic.h | 6 +++-- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/src/service/agent/AgentManager.cpp b/src/service/agent/AgentManager.cpp index ee91e64..d551790 100644 --- a/src/service/agent/AgentManager.cpp +++ b/src/service/agent/AgentManager.cpp @@ -77,7 +77,7 @@ AgentTalkerPtr AgentManager::createTalker(const AgentType &agentType) { return talker; } } catch (const std::out_of_range &) { - LOGE("Proper agent not found: <%s>", agentType.c_str()); + LOGE("Required agent is not registered: <%s>", agentType.c_str()); } return AgentTalkerPtr(); diff --git a/src/service/logic/Logic.cpp b/src/service/logic/Logic.cpp index 7227ef9..dfb968a 100644 --- a/src/service/logic/Logic.cpp +++ b/src/service/logic/Logic.cpp @@ -21,8 +21,11 @@ */ #include +#include +#include #include +#include #include #include #include @@ -95,14 +98,20 @@ void Logic::execute(RequestContextPtr context, CancelRequestPtr request) { void Logic::execute(RequestContextPtr context, CheckRequestPtr request) { PolicyResult result(PredefinedPolicyType::DENY); - if (check(context, request->key(), result)) { + if (check(context, request->key(), request->sequenceNumber(), result)) { context->returnResponse(context, std::make_shared(result, request->sequenceNumber())); } } -bool Logic::check(RequestContextPtr context UNUSED, const PolicyKey &key, - PolicyResult& result) { +bool Logic::check(const RequestContextPtr &context, const PolicyKey &key, + ProtocolFrameSequenceNumber checkId, PolicyResult &result) { + + if (m_checkRequestManager.getContext(context->responseQueue(), checkId)) { + LOGE("Check request for checkId: [%" PRIu16 "] is already processing", checkId); + return false; + } + result = m_storage->checkPolicy(key); switch (result.policyType()) { @@ -114,9 +123,19 @@ bool Logic::check(RequestContextPtr context UNUSED, const PolicyKey &key, return true; } + return pluginCheck(context, key, checkId, result); +} + +bool Logic::pluginCheck(const RequestContextPtr &context, const PolicyKey &key, + ProtocolFrameSequenceNumber checkId, PolicyResult &result) { + + LOGD("Trying to check policy: <%s> in plugin.", key.toString().c_str()); + ExternalPluginPtr plugin = m_pluginManager->getPlugin(result.policyType()); if (!plugin) { - throw PluginNotFoundException(result); + LOGE("Plugin not found for policy: [0x%x]", result.policyType()); + result = PolicyResult(PredefinedPolicyType::DENY); + return true; } ServicePluginInterfacePtr servicePlugin = @@ -134,12 +153,27 @@ bool Logic::check(RequestContextPtr context UNUSED, const PolicyKey &key, switch (ret) { case ServicePluginInterface::PluginStatus::ANSWER_READY: return true; - case ServicePluginInterface::PluginStatus::ANSWER_NOTREADY: - //todo send request to agent - //context should be saved in plugin in order to return answer when ready + case ServicePluginInterface::PluginStatus::ANSWER_NOTREADY: { + result = PolicyResult(PredefinedPolicyType::DENY); + AgentTalkerPtr agentTalker = m_agentManager->createTalker(requiredAgent); + if (!agentTalker) { + LOGE("Required agent talker for: <%s> could not be created.", + requiredAgent.c_str()); + return true; + } + + if (!m_checkRequestManager.createContext(key, context, checkId, servicePlugin, + agentTalker)) { + LOGE("Check context for checkId: [%" PRIu16 "] could not be created.", + checkId); + m_agentManager->removeTalker(agentTalker); + return true; + } + agentTalker->send(pluginData); + } return false; default: - throw PluginErrorException(key); + throw PluginErrorException(key); // This 'throw' should be removed or handled properly. } } diff --git a/src/service/logic/Logic.h b/src/service/logic/Logic.h index 35226d7..a90c08c 100644 --- a/src/service/logic/Logic.h +++ b/src/service/logic/Logic.h @@ -80,8 +80,10 @@ private: StoragePtr m_storage; SocketManagerPtr m_socketManager; - bool check(RequestContextPtr context, const PolicyKey &key, PolicyResult& result); - + bool check(const RequestContextPtr &context, const PolicyKey &key, + ProtocolFrameSequenceNumber checkId, PolicyResult &result); + bool pluginCheck(const RequestContextPtr &context, const PolicyKey &key, + ProtocolFrameSequenceNumber checkId, PolicyResult &result); void onPoliciesChanged(void); }; -- 2.7.4 From 3fbc0c58ea63228686da510af345d3d893d4f8db Mon Sep 17 00:00:00 2001 From: Adam Malinowski Date: Mon, 3 Nov 2014 14:49:59 +0100 Subject: [PATCH 05/16] Handle cancel request This patch implements handling cancel request from client. Change-Id: I2b5537ef8b481f3a3160702d0a549945b8a11622 --- src/service/logic/Logic.cpp | 16 +++++++++++++++- src/service/logic/Logic.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/service/logic/Logic.cpp b/src/service/logic/Logic.cpp index dfb968a..037deb8 100644 --- a/src/service/logic/Logic.cpp +++ b/src/service/logic/Logic.cpp @@ -92,7 +92,21 @@ void Logic::execute(RequestContextPtr context, AgentRegisterRequestPtr request) } void Logic::execute(RequestContextPtr context, CancelRequestPtr request) { - // MOCKUP + CheckContextPtr checkContextPtr = m_checkRequestManager.getContext(context->responseQueue(), + request->sequenceNumber()); + if (!checkContextPtr) { + LOGD("Cancel request id: [%" PRIu16 "] with no matching request in progress.", + request->sequenceNumber()); + return; + } + + if (checkContextPtr->cancelled()) + return; + + checkContextPtr->cancel(); + checkContextPtr->m_agentTalker->cancel(); + + LOGD("Returning response for cancel request id: [%" PRIu16 "].", request->sequenceNumber()); context->returnResponse(context, std::make_shared(request->sequenceNumber())); } diff --git a/src/service/logic/Logic.h b/src/service/logic/Logic.h index a90c08c..dbbc7d6 100644 --- a/src/service/logic/Logic.h +++ b/src/service/logic/Logic.h @@ -84,6 +84,7 @@ private: ProtocolFrameSequenceNumber checkId, PolicyResult &result); bool pluginCheck(const RequestContextPtr &context, const PolicyKey &key, ProtocolFrameSequenceNumber checkId, PolicyResult &result); + void onPoliciesChanged(void); }; -- 2.7.4 From 794cffc86808db86cf059214b9edb8c03e1e93d0 Mon Sep 17 00:00:00 2001 From: Adam Malinowski Date: Mon, 3 Nov 2014 14:53:33 +0100 Subject: [PATCH 06/16] Handle agent response This patch handles response from agent of both types: action and cancel. Change-Id: I3168f4f7466c79bdcb9a3f6b1c3d6863ddcf952c --- src/service/logic/Logic.cpp | 67 +++++++++++++++++++++++++++++++++++++++++++++ src/service/logic/Logic.h | 6 ++++ 2 files changed, 73 insertions(+) diff --git a/src/service/logic/Logic.cpp b/src/service/logic/Logic.cpp index 037deb8..4cf78eb 100644 --- a/src/service/logic/Logic.cpp +++ b/src/service/logic/Logic.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,8 @@ #include +#include + #include "Logic.h" namespace Cynara { @@ -85,6 +88,40 @@ void Logic::execute(RequestContextPtr context, AdminCheckRequestPtr request) { request->sequenceNumber())); } +void Logic::execute(RequestContextPtr context, AgentActionRequestPtr request) { + AgentTalkerPtr talkerPtr = m_agentManager->getTalker(context->responseQueue(), + request->sequenceNumber()); + if (!talkerPtr) { + LOGD("Received response from agent with invalid request id: [%" PRIu16 "]", + request->sequenceNumber()); + return; + } + + CheckContextPtr checkContextPtr = m_checkRequestManager.getContext(talkerPtr); + if (!checkContextPtr) { + LOGE("No matching check context for agent talker."); + m_agentManager->removeTalker(talkerPtr); + return; + } + + if (!checkContextPtr->cancelled()) { + PluginData data(request->data().begin(), request->data().end()); + if (request->type() == CYNARA_MSG_TYPE_CANCEL) { + // Nothing to do for now + } else if (request->type() == CYNARA_MSG_TYPE_ACTION) { + update(checkContextPtr->m_key, checkContextPtr->m_checkId, data, + checkContextPtr->m_requestContext, checkContextPtr->m_plugin); + } else { + LOGE("Invalid response type [%d] in response from agent <%s>", + static_cast(request->type()), talkerPtr->agentType().c_str()); + // TODO: disconnect agent + } + } + + m_agentManager->removeTalker(talkerPtr); + m_checkRequestManager.removeRequest(checkContextPtr); +} + void Logic::execute(RequestContextPtr context, AgentRegisterRequestPtr request) { auto result = m_agentManager->registerAgent(request->agentType(), context->responseQueue()); context->returnResponse(context, std::make_shared( @@ -191,6 +228,36 @@ bool Logic::pluginCheck(const RequestContextPtr &context, const PolicyKey &key, } } +bool Logic::update(const PolicyKey &key, ProtocolFrameSequenceNumber checkId, + const PluginData &agentData, const RequestContextPtr &context, + const ServicePluginInterfacePtr &plugin) { + + LOGD("Check update: <%s>:[%" PRIu16 "]", key.toString().c_str(), checkId); + + PolicyResult result; + bool answerReady = false; + auto ret = plugin->update(key.client().toString(), key.user().toString(), + key.privilege().toString(), agentData, result); + switch (ret) { + case ServicePluginInterface::PluginStatus::SUCCESS: + answerReady = true; + break; + case ServicePluginInterface::PluginStatus::ERROR: + result = PolicyResult(PredefinedPolicyType::DENY); + answerReady = true; + break; + default: + throw PluginErrorException(key); + } + + if (answerReady && context->responseQueue()) { + context->returnResponse(context, std::make_shared(result, checkId)); + return true; + } + + return false; +} + void Logic::execute(RequestContextPtr context, InsertOrUpdateBucketRequestPtr request) { auto code = CodeResponse::Code::OK; diff --git a/src/service/logic/Logic.h b/src/service/logic/Logic.h index dbbc7d6..57a862c 100644 --- a/src/service/logic/Logic.h +++ b/src/service/logic/Logic.h @@ -32,6 +32,8 @@ #include #include +#include + namespace Cynara { class Logic : public RequestTaker { @@ -63,6 +65,7 @@ public: } virtual void execute(RequestContextPtr context, AdminCheckRequestPtr request); + virtual void execute(RequestContextPtr context, AgentActionRequestPtr request); virtual void execute(RequestContextPtr context, AgentRegisterRequestPtr request); virtual void execute(RequestContextPtr context, CancelRequestPtr request); virtual void execute(RequestContextPtr context, CheckRequestPtr request); @@ -84,6 +87,9 @@ private: ProtocolFrameSequenceNumber checkId, PolicyResult &result); bool pluginCheck(const RequestContextPtr &context, const PolicyKey &key, ProtocolFrameSequenceNumber checkId, PolicyResult &result); + bool update(const PolicyKey &key, ProtocolFrameSequenceNumber checkId, + const PluginData &agentData, const RequestContextPtr &request, + const ServicePluginInterfacePtr &plugin); void onPoliciesChanged(void); }; -- 2.7.4 From ced9c53a12b1f47eb2087b97650c0085fdb65c9e Mon Sep 17 00:00:00 2001 From: Adam Malinowski Date: Mon, 3 Nov 2014 14:57:13 +0100 Subject: [PATCH 07/16] Handle client and agent disconnection This patch handles situations where client and/or agent connection to cynara service is closed. Change-Id: I410b6da96102b6ae16442e90dbbb1e867490287a --- src/service/logic/Logic.cpp | 39 +++++++++++++++++++++++++++++++++++++-- src/service/logic/Logic.h | 3 +++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/service/logic/Logic.cpp b/src/service/logic/Logic.cpp index 4cf78eb..8f51af5 100644 --- a/src/service/logic/Logic.cpp +++ b/src/service/logic/Logic.cpp @@ -63,6 +63,7 @@ #include "Logic.h" namespace Cynara { + Logic::Logic() { } @@ -307,8 +308,17 @@ void Logic::execute(RequestContextPtr context, SetPoliciesRequestPtr request) { request->sequenceNumber())); } -void Logic::contextClosed(RequestContextPtr context UNUSED) { - //We don't care now, but we will +void Logic::contextClosed(RequestContextPtr context) { + LOGD("context closed"); + + LinkId linkId = context->responseQueue(); + + m_agentManager->cleanupAgent(linkId, [&](const AgentTalkerPtr &talker) -> void { + handleAgentTalkerDisconnection(talker); }); + + m_checkRequestManager.cancelRequests(linkId, + [&](const CheckContextPtr &checkContextPtr) -> void { + handleClientDisconnection(checkContextPtr); }); } void Logic::onPoliciesChanged(void) { @@ -317,4 +327,29 @@ void Logic::onPoliciesChanged(void) { //todo remove all saved contexts (if there will be any saved contexts) } +void Logic::handleAgentTalkerDisconnection(const AgentTalkerPtr &agentTalkerPtr) { + CheckContextPtr checkContextPtr = m_checkRequestManager.getContext(agentTalkerPtr); + if (checkContextPtr == nullptr) { + LOGE("No matching check context for agent talker."); + return; + } + + if (!checkContextPtr->cancelled() && checkContextPtr->m_requestContext->responseQueue()) { + PolicyResult result(PredefinedPolicyType::DENY); + checkContextPtr->m_requestContext->returnResponse(checkContextPtr->m_requestContext, + std::make_shared(result, checkContextPtr->m_checkId)); + } + + m_checkRequestManager.removeRequest(checkContextPtr); +} + +void Logic::handleClientDisconnection(const CheckContextPtr &checkContextPtr) { + LOGD("Handle client disconnection"); + + if (!checkContextPtr->cancelled()) { + checkContextPtr->cancel(); + checkContextPtr->m_agentTalker->cancel(); + } +} + } // namespace Cynara diff --git a/src/service/logic/Logic.h b/src/service/logic/Logic.h index 57a862c..33c5701 100644 --- a/src/service/logic/Logic.h +++ b/src/service/logic/Logic.h @@ -91,6 +91,9 @@ private: const PluginData &agentData, const RequestContextPtr &request, const ServicePluginInterfacePtr &plugin); + void handleAgentTalkerDisconnection(const AgentTalkerPtr &agentTalkerPtr); + void handleClientDisconnection(const CheckContextPtr &checkContextPtr); + void onPoliciesChanged(void); }; -- 2.7.4 From f4e6749ef8d1fdd86946c848bb2d90431ca7e6ad Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski Date: Sat, 15 Nov 2014 05:39:18 +0100 Subject: [PATCH 08/16] Release 0.4.0 Change-Id: Ia8f5a7e623bcbce58f9574c084a6472ea59e271a --- CMakeLists.txt | 2 +- changelog | 28 ++++++++++++++++++++++++++++ packaging/cynara.spec | 2 +- src/admin/CMakeLists.txt | 2 +- src/client-common/CMakeLists.txt | 2 +- src/client/CMakeLists.txt | 2 +- src/common/CMakeLists.txt | 2 +- src/helpers/creds-commons/CMakeLists.txt | 2 +- src/helpers/creds-dbus/CMakeLists.txt | 2 +- src/helpers/creds-socket/CMakeLists.txt | 2 +- src/helpers/session/CMakeLists.txt | 2 +- 11 files changed, 38 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc951bb..5271bb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3) PROJECT("cynara") -set(CYNARA_VERSION 0.2.2) +set(CYNARA_VERSION 0.4.0) ############################# cmake packages ################################## diff --git a/changelog b/changelog index a2d08e3..e841be7 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,33 @@ ############################## +Release: 0.4.0 +Date: 2014.11.15 +Name: Asynchronous client and extensions API + +Libraries: +libcynara-admin.0.4.0 +libcynara-agent.0.4.0 +libcynara-client-async.0.4.0 +libcynara-client-commmons.0.4.0 +libcynara-client.0.4.0 +libcynara-commons.0.4.0 +libcynara-creds-commons.0.4.0 +libcynara-creds-dbus.0.4.0 +libcynara-creds-socket.0.4.0 +libcynara-session.0.4.0 +libcynara-storage.0.4.0 + +Description: +Asynchronous client library. +Admin API: admin_check, NONE policies +Common error codes +Extensions: plugins and agents API +Database integrity +Migration package +Common client exceptions handling + +############################## + Release: 0.3.0 Date: 2014.09.05 Name: Helper libraries diff --git a/packaging/cynara.spec b/packaging/cynara.spec index 88e9209..ae98c80 100644 --- a/packaging/cynara.spec +++ b/packaging/cynara.spec @@ -1,6 +1,6 @@ Name: cynara Summary: Cynara service with client libraries -Version: 0.3.0 +Version: 0.4.0 Release: 1 Group: Security/Application Privilege License: Apache-2.0 diff --git a/src/admin/CMakeLists.txt b/src/admin/CMakeLists.txt index 4918571..7cab9f6 100644 --- a/src/admin/CMakeLists.txt +++ b/src/admin/CMakeLists.txt @@ -17,7 +17,7 @@ # SET(LIB_CYNARA_ADMIN_VERSION_MAJOR 0) -SET(LIB_CYNARA_ADMIN_VERSION ${LIB_CYNARA_ADMIN_VERSION_MAJOR}.3.0) +SET(LIB_CYNARA_ADMIN_VERSION ${LIB_CYNARA_ADMIN_VERSION_MAJOR}.4.0) SET(CYNARA_LIB_CYNARA_ADMIN_PATH ${CYNARA_PATH}/admin) diff --git a/src/client-common/CMakeLists.txt b/src/client-common/CMakeLists.txt index 5436884..36c6806 100644 --- a/src/client-common/CMakeLists.txt +++ b/src/client-common/CMakeLists.txt @@ -17,7 +17,7 @@ # SET(LIB_CYNARA_CLIENT_COMMON_VERSION_MAJOR 0) -SET(LIB_CYNARA_CLIENT_COMMON_VERSION ${LIB_CYNARA_CLIENT_COMMON_VERSION_MAJOR}.3.0) +SET(LIB_CYNARA_CLIENT_COMMON_VERSION ${LIB_CYNARA_CLIENT_COMMON_VERSION_MAJOR}.4.0) SET(LIB_CYNARA_COMMON_PATH ${CYNARA_PATH}/client-common) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index db0622c..79d85a2 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -18,7 +18,7 @@ # SET(LIB_CYNARA_VERSION_MAJOR 0) -SET(LIB_CYNARA_VERSION ${LIB_CYNARA_VERSION_MAJOR}.3.0) +SET(LIB_CYNARA_VERSION ${LIB_CYNARA_VERSION_MAJOR}.4.0) SET(LIB_CYNARA_PATH ${CYNARA_PATH}/client) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 7f3da76..8cf615c 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -17,7 +17,7 @@ # SET(CYNARA_COMMON_VERSION_MAJOR 0) -SET(CYNARA_COMMON_VERSION ${CYNARA_COMMON_VERSION_MAJOR}.3.0) +SET(CYNARA_COMMON_VERSION ${CYNARA_COMMON_VERSION_MAJOR}.4.0) SET(COMMON_PATH ${CYNARA_PATH}/common) diff --git a/src/helpers/creds-commons/CMakeLists.txt b/src/helpers/creds-commons/CMakeLists.txt index 5dd5007..bafa025 100644 --- a/src/helpers/creds-commons/CMakeLists.txt +++ b/src/helpers/creds-commons/CMakeLists.txt @@ -19,7 +19,7 @@ # SET(LIB_CREDS_COMMONS_VERSION_MAJOR 0) -SET(LIB_CREDS_COMMONS_VERSION ${LIB_CREDS_COMMONS_VERSION_MAJOR}.3.0) +SET(LIB_CREDS_COMMONS_VERSION ${LIB_CREDS_COMMONS_VERSION_MAJOR}.4.0) SET(LIB_CREDS_COMMONS_PATH ${CYNARA_PATH}/helpers/creds-commons) diff --git a/src/helpers/creds-dbus/CMakeLists.txt b/src/helpers/creds-dbus/CMakeLists.txt index bc1d95c..69b94e2 100644 --- a/src/helpers/creds-dbus/CMakeLists.txt +++ b/src/helpers/creds-dbus/CMakeLists.txt @@ -19,7 +19,7 @@ # SET(LIB_CREDS_DBUS_VERSION_MAJOR 0) -SET(LIB_CREDS_DBUS_VERSION ${LIB_CREDS_DBUS_VERSION_MAJOR}.3.0) +SET(LIB_CREDS_DBUS_VERSION ${LIB_CREDS_DBUS_VERSION_MAJOR}.4.0) SET(LIB_CREDS_DBUS_PATH ${CYNARA_PATH}/helpers/creds-dbus) diff --git a/src/helpers/creds-socket/CMakeLists.txt b/src/helpers/creds-socket/CMakeLists.txt index 1c8d301..1d40f3b 100644 --- a/src/helpers/creds-socket/CMakeLists.txt +++ b/src/helpers/creds-socket/CMakeLists.txt @@ -19,7 +19,7 @@ # SET(LIB_CREDS_SOCKET_VERSION_MAJOR 0) -SET(LIB_CREDS_SOCKET_VERSION ${LIB_CREDS_SOCKET_VERSION_MAJOR}.3.0) +SET(LIB_CREDS_SOCKET_VERSION ${LIB_CREDS_SOCKET_VERSION_MAJOR}.4.0) SET(LIB_CREDS_SOCKET_PATH ${CYNARA_PATH}/helpers/creds-socket) diff --git a/src/helpers/session/CMakeLists.txt b/src/helpers/session/CMakeLists.txt index 00c5d3d..6ad7234 100644 --- a/src/helpers/session/CMakeLists.txt +++ b/src/helpers/session/CMakeLists.txt @@ -19,7 +19,7 @@ # SET(LIB_SESSION_VERSION_MAJOR 0) -SET(LIB_SESSION_VERSION ${LIB_SESSION_VERSION_MAJOR}.3.0) +SET(LIB_SESSION_VERSION ${LIB_SESSION_VERSION_MAJOR}.4.0) SET(LIB_SESSION_PATH ${CYNARA_PATH}/helpers/session) -- 2.7.4 From 88b6ae7330c1f3d015b1d2584cd7fe678a0e5c72 Mon Sep 17 00:00:00 2001 From: Adam Malinowski Date: Mon, 17 Nov 2014 08:50:27 +0100 Subject: [PATCH 09/16] Fix linking dependencies PluginManager was moved from service to common but linking with 'dl' library stayed in service. This patch moves linking with dl to common. Change-Id: If1be63e86dfe4c8651b48bbe9facc80160fd9f32 --- src/common/CMakeLists.txt | 1 + src/service/CMakeLists.txt | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 8cf615c..bd3911f 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -89,6 +89,7 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG") TARGET_LINK_LIBRARIES(${TARGET_CYNARA_COMMON} ${CYNARA_DEP_LIBRARIES} ${CYNARA_DBG_LIBRARIES} + dl ) INSTALL(TARGETS ${TARGET_CYNARA_COMMON} DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/service/CMakeLists.txt b/src/service/CMakeLists.txt index d4dd32e..b28058b 100644 --- a/src/service/CMakeLists.txt +++ b/src/service/CMakeLists.txt @@ -41,7 +41,6 @@ TARGET_LINK_LIBRARIES(${TARGET_CYNARA} ${CYNARA_DEP_LIBRARIES} ${TARGET_CYNARA_COMMON} ${TARGET_LIB_CYNARA_STORAGE} - dl ) INSTALL(TARGETS ${TARGET_CYNARA} DESTINATION ${BIN_INSTALL_DIR}) -- 2.7.4 From ae42834191f7652728b1570ad9a9959a3dad1692 Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski Date: Mon, 17 Nov 2014 09:34:17 +0100 Subject: [PATCH 10/16] Add missing devel package dependency libcynara-admin-devel package requires cynara-error.h that is provided by libcynara-client-commons-devel. Change-Id: Ic6b9203e2dcf80fd0057fa64d906819be69b929d Signed-off-by: Lukasz Wojciechowski --- packaging/cynara.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/cynara.spec b/packaging/cynara.spec index ae98c80..fa7fa23 100644 --- a/packaging/cynara.spec +++ b/packaging/cynara.spec @@ -112,6 +112,7 @@ admin client library for setting, listing and removing policies %package -n libcynara-admin-devel Summary: Cynara - admin client library (devel) Requires: libcynara-admin = %{version}-%{release} +Requires: libcynara-client-commons-devel = %{version}-%{release} Requires: libcynara-commons-devel = %{version}-%{release} %description -n libcynara-admin-devel -- 2.7.4 From 84252f505c6dac16aa0e73d4cf35313d5ba90a90 Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski Date: Mon, 17 Nov 2014 09:38:42 +0100 Subject: [PATCH 11/16] Expose ClientSession type ClientSession is required by client-plugin mechanism. Files section for libcynara-commons-devel was enhanced, so it provides ClientSession.h Change-Id: Ia0d935bf297bdf1743fd37e5df3a0826ebf446cd Signed-off-by: Lukasz Wojciechowski --- packaging/cynara.spec | 1 + src/common/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/packaging/cynara.spec b/packaging/cynara.spec index fa7fa23..9869482 100644 --- a/packaging/cynara.spec +++ b/packaging/cynara.spec @@ -522,6 +522,7 @@ fi %files -n libcynara-commons-devel %{_includedir}/cynara/cynara-policy-types.h %{_includedir}/cynara/plugin/ExternalPluginInterface.h +%{_includedir}/cynara/types/ClientSession.h %{_includedir}/cynara/types/PolicyResult.h %{_includedir}/cynara/types/PolicyType.h %{_libdir}/libcynara-commons.so diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index bd3911f..68bda47 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -94,6 +94,7 @@ TARGET_LINK_LIBRARIES(${TARGET_CYNARA_COMMON} INSTALL(TARGETS ${TARGET_CYNARA_COMMON} DESTINATION ${LIB_INSTALL_DIR}) INSTALL(FILES + ${COMMON_PATH}/types/ClientSession.h ${COMMON_PATH}/types/PolicyResult.h ${COMMON_PATH}/types/PolicyType.h DESTINATION ${INCLUDE_INSTALL_DIR}/cynara/types -- 2.7.4 From 5220e36e2fb4be2577472b95a19e9f85c6361b2e Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski Date: Mon, 17 Nov 2014 09:41:30 +0100 Subject: [PATCH 12/16] Change include brackets Include brackets style of 2 files in credential libraries was changed from "" to <> , as it is used in other headers. Change-Id: I1dba20862a53acdccf65d671b15b254310121961 Signed-off-by: Lukasz Wojciechowski --- src/include/cynara-creds-dbus.h | 2 +- src/include/cynara-creds-socket.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/cynara-creds-dbus.h b/src/include/cynara-creds-dbus.h index 6f24f74..7f151f1 100644 --- a/src/include/cynara-creds-dbus.h +++ b/src/include/cynara-creds-dbus.h @@ -28,7 +28,7 @@ #include #include -#include "cynara-creds-commons.h" +#include #ifdef __cplusplus extern "C" { diff --git a/src/include/cynara-creds-socket.h b/src/include/cynara-creds-socket.h index e9dc2af..252af26 100644 --- a/src/include/cynara-creds-socket.h +++ b/src/include/cynara-creds-socket.h @@ -28,7 +28,7 @@ #include -#include "cynara-creds-commons.h" +#include #ifdef __cplusplus extern "C" { -- 2.7.4 From b08fb0f0948019275266e0dd680ef4459f843f7c Mon Sep 17 00:00:00 2001 From: Zofia Abramowska Date: Mon, 17 Nov 2014 10:29:07 +0100 Subject: [PATCH 13/16] Fix missing directories Creation of cynara plugins directories was missing during installation. Change-Id: I774b831765f71cc034f8d5800dea0032bf2ae2c9 --- packaging/cynara.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packaging/cynara.spec b/packaging/cynara.spec index 9869482..62cfce1 100644 --- a/packaging/cynara.spec +++ b/packaging/cynara.spec @@ -36,6 +36,7 @@ BuildRequires: pkgconfig(libsystemd-journal) %global group_name %{name} %global state_path %{_localstatedir}/%{name}/ +%global lib_path %{_libdir}/%{name}/ %global tests_dir %{_datarootdir}/%{name}/tests/ %global conf_path %{_sysconfdir}/%{name}/ @@ -282,6 +283,7 @@ export CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE" %endif export CXXFLAGS="$CXXFLAGS -DCYNARA_STATE_PATH=\\\"%{state_path}\\\" \ + -DCYNARA_LIB_PATH=\\\"%{lib_path}\\\" \ -DCYNARA_TESTS_DIR=\\\"%{tests_dir}\\\" \ -DCYNARA_CONFIGURATION_DIR=\\\"%{conf_path}\\\"" export LDFLAGS+="-Wl,--rpath=%{_libdir}" @@ -302,6 +304,9 @@ cp ./conf/creds.conf %{buildroot}/%{conf_path}/creds.conf mkdir -p %{buildroot}/usr/lib/systemd/system/sockets.target.wants mkdir -p %{buildroot}/%{state_path} mkdir -p %{buildroot}/%{tests_dir}/empty_db +mkdir -p %{buildroot}/%{lib_path}/plugin/client +mkdir -p %{buildroot}/%{lib_path}/plugin/service + cp -a db* %{buildroot}/%{tests_dir} ln -s ../cynara.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/cynara.socket ln -s ../cynara-admin.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/cynara-admin.socket @@ -455,6 +460,7 @@ fi %attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/cynara-agent.socket %attr(-,root,root) /usr/lib/systemd/system/cynara-agent.socket %dir %attr(700,cynara,cynara) %{state_path} +%dir %attr(755,cynara,cynara) %{lib_path}/plugin/service %files -n libcynara-client %manifest libcynara-client.manifest @@ -480,6 +486,7 @@ fi %manifest libcynara-client-commons.manifest %license LICENSE %{_libdir}/libcynara-client-commons.so.* +%dir %attr(755,cynara,cynara) %{lib_path}/plugin/client %files -n libcynara-client-commons-devel %{_includedir}/cynara/cynara-error.h -- 2.7.4 From d8d0683a5716c7038c7806a3b534b9d631256ed7 Mon Sep 17 00:00:00 2001 From: Rafal Krypa Date: Tue, 11 Nov 2014 12:18:42 +0100 Subject: [PATCH 14/16] packaging: tame the packaging madness Cynara seems to adapt the model of multiple small libraries put in separate package each. This leads into plethora of small packages. This commit tries to rationalize this decomposition, merging some of the packages: - all development packages are now merged into one cynara-devel - client, client-async and client-common are merged into one - storage is merged into libcynara-common The overall result is decrease in total number of packages from 24 to 12, not counting auto generated debuginfo and debugsource. Change-Id: I947e733872a4d5c96c722b207243e3c1cdfe1ba6 --- packaging/cynara.spec | 342 ++++------------------------ packaging/libcynara-client-async.manifest | 5 - packaging/libcynara-client-commons.manifest | 5 - packaging/libcynara-storage.manifest | 5 - 4 files changed, 49 insertions(+), 308 deletions(-) delete mode 100644 packaging/libcynara-client-async.manifest delete mode 100644 packaging/libcynara-client-commons.manifest delete mode 100644 packaging/libcynara-storage.manifest diff --git a/packaging/cynara.spec b/packaging/cynara.spec index 62cfce1..bf5c00a 100644 --- a/packaging/cynara.spec +++ b/packaging/cynara.spec @@ -8,18 +8,15 @@ Source0: %{name}-%{version}.tar.gz Source1000: %{name}-rpmlintrc Source1001: cynara.manifest Source1002: libcynara-client.manifest -Source1003: libcynara-client-async.manifest -Source1004: libcynara-admin.manifest -Source1005: cynara-tests.manifest -Source1006: libcynara-agent.manifest -Source1007: libcynara-client-commons.manifest -Source1008: libcynara-commons.manifest -Source1009: libcynara-creds-commons.manifest -Source1010: libcynara-creds-dbus.manifest -Source1011: libcynara-creds-socket.manifest -Source1012: libcynara-session.manifest -Source1013: libcynara-storage.manifest -Source1014: cynara-db-migration.manifest +Source1003: libcynara-admin.manifest +Source1004: cynara-tests.manifest +Source1005: libcynara-agent.manifest +Source1006: libcynara-commons.manifest +Source1007: libcynara-creds-commons.manifest +Source1008: libcynara-creds-dbus.manifest +Source1009: libcynara-creds-socket.manifest +Source1010: libcynara-session.manifest +Source1011: cynara-db-migration.manifest Requires: default-ac-domains Requires(pre): pwdutils Requires(pre): cynara-db-migration >= %{version}-%{release} @@ -52,57 +49,40 @@ BuildRequires: pkgconfig(libunwind) %endif %description -service, client libraries (libcynara-client, libcynara-client-async, libcynara-admin), +service, client libraries (libcynara-client, libcynara-admin), agent library, helper libraries (libcynara-session, libcynara-creds-common, libcynara-creds-dbus, libcynara-creds-socket) and tests (cynara-tests) -####################################################### -%package -n libcynara-client -Summary: Cynara - client library -Requires: cynara = %{version}-%{release} - -%description -n libcynara-client -client library for checking policies - -%package -n libcynara-client-devel -Summary: Cynara - client library (devel) +%package devel +Summary: Cynara development files +Requires: libcynara-admin = %{version}-%{release} +Requires: libcynara-agent = %{version}-%{release} Requires: libcynara-client = %{version}-%{release} -Requires: libcynara-client-commons-devel = %{version}-%{release} - -%description -n libcynara-client-devel -client library (devel) for checking policies - -####################################################### -%package -n libcynara-client-async -Summary: Cynara - asynchronous client library -Requires: cynara = %{version}-%{release} - -%description -n libcynara-client-async -asynchronous client library for checking policies - -%package -n libcynara-client-async-devel -Summary: Cynara - asynchronous client library (devel) -Requires: libcynara-client-async = %{version}-%{release} -Requires: libcynara-client-commons-devel = %{version}-%{release} +Requires: libcynara-commons = %{version}-%{release} +Requires: libcynara-creds-commons = %{version}-%{release} +Requires: libcynara-creds-dbus = %{version}-%{release} +Requires: libcynara-creds-socket = %{version}-%{release} +Requires: libcynara-session = %{version}-%{release} -%description -n libcynara-client-async-devel -asynchronous client library (devel) for checking policies +%description devel +Cynara development files -####################################################### -%package -n libcynara-client-commons -Summary: Cynara - client commons library +%package tests +Summary: Cynara - cynara test binaries +BuildRequires: pkgconfig(gmock) -%description -n libcynara-client-commons -client commons library with common functionalities +%description tests +Cynara tests -%package -n libcynara-client-commons-devel -Summary: Cynara - client commons library (devel) -Requires: libcynara-client-commons = %{version}-%{release} +%package -n libcynara-client +Summary: Cynara - client libraries +Requires: cynara = %{version}-%{release} +Obsoletes: libcynara-client-commons +Obsoletes: libcynara-client-async -%description -n libcynara-client-commons-devel -client commons library (devel) with common functionalities +%description -n libcynara-client +Client libraries for checking policies: synchronous and asynchronous -####################################################### %package -n libcynara-admin Summary: Cynara - admin client library Requires: cynara = %{version}-%{release} @@ -110,16 +90,6 @@ Requires: cynara = %{version}-%{release} %description -n libcynara-admin admin client library for setting, listing and removing policies -%package -n libcynara-admin-devel -Summary: Cynara - admin client library (devel) -Requires: libcynara-admin = %{version}-%{release} -Requires: libcynara-client-commons-devel = %{version}-%{release} -Requires: libcynara-commons-devel = %{version}-%{release} - -%description -n libcynara-admin-devel -admin client library (devel) for setting, listing and removing policies - -####################################################### %package -n libcynara-agent Summary: Cynara - agent client library Requires: cynara = %{version}-%{release} @@ -127,66 +97,19 @@ Requires: cynara = %{version}-%{release} %description -n libcynara-agent agent client library for communication with cynara service and plugins -%package -n libcynara-agent-devel -Summary: Cynara - agent client library (devel) -Requires: libcynara-agent = %{version}-%{release} -Requires: libcynara-client-commons-devel = %{version}-%{release} - -%description -n libcynara-agent-devel -agent client library (devel) for communication with cynara service and plugins - -####################################################### -%package -n libcynara-storage -Summary: Cynara - storage - -%description -n libcynara-storage -cynara common storage library with common storage functionalities - -%package -n libcynara-storage-devel -Summary: Cynara - storage-devel -Requires: cynara = %{version}-%{release} - -%description -n libcynara-storage-devel -cynara common storage library (devel) with common storage functionalities - -####################################################### %package -n libcynara-commons Summary: Cynara - cynara commons library +Obsoletes: libcynara-storage %description -n libcynara-commons cynara common library with common functionalities -%package -n libcynara-commons-devel -Summary: Cynara - cynara commons library (devel) -Requires: libcynara-commons = %{version}-%{release} - -%description -n libcynara-commons-devel -cynara common library (devel) with common functionalities - -####################################################### -%package -n libcynara-plugin-devel -Summary: Cynara - cynara plugin library (devel) -Requires: libcynara-commons-devel = %{version}-%{release} - -%description -n libcynara-plugin-devel -cynara plugin library (devel) with plugin definitions - -####################################################### %package -n libcynara-creds-commons Summary: Base library for cynara credentials helpers %description -n libcynara-creds-commons Base library for cynara credentials helpers -%package -n libcynara-creds-commons-devel -Summary: Base library for cynara credentials helpers (devel) -Requires: libcynara-creds-commons = %{version}-%{release} -Requires: libcynara-client-commons-devel = %{version}-%{release} - -%description -n libcynara-creds-commons-devel -Base library for cynara credentials helpers (devel) - -####################################################### %package -n libcynara-creds-dbus Summary: Cynara credentials helpers library for dbus clients BuildRequires: pkgconfig(dbus-1) @@ -195,60 +118,18 @@ Requires: dbus %description -n libcynara-creds-dbus Cynara credentials helpers library for dbus clients -%package -n libcynara-creds-dbus-devel -Summary: Cynara credentials helpers library for dbus clients (devel) -Requires: libcynara-creds-dbus = %{version}-%{release} -Requires: libcynara-creds-commons-devel = %{version}-%{release} - -%description -n libcynara-creds-dbus-devel -Cynara credentials helpers library for dbus clients (devel) - -####################################################### %package -n libcynara-creds-socket Summary: Cynara credentials helpers library for socket clients %description -n libcynara-creds-socket Cynara credentials helpers library for socket clients -%package -n libcynara-creds-socket-devel -Summary: Cynara credentials helpers library for socket clients (devel) -Requires: libcynara-creds-socket = %{version}-%{release} -Requires: libcynara-creds-commons-devel = %{version}-%{release} - -%description -n libcynara-creds-socket-devel -Cynara credentials helpers library for socket clients (devel) - -####################################################### %package -n libcynara-session Summary: Cynara helper client session string creation library %description -n libcynara-session Cynara helper client session string creation library -%package -n libcynara-session-devel -Summary: Cynara helper client session string creation library (devel) -Requires: libcynara-session = %{version}-%{release} - -%description -n libcynara-session-devel -Cynara helper client session string creation library (devel) - -####################################################### -%package -n cynara-tests -Summary: Cynara - cynara test binaries -BuildRequires: pkgconfig(gmock) - -%description -n cynara-tests -Cynara tests - -####################################################### -%package -n cynara-devel -Summary: Cynara service (devel) -Requires: cynara = %{version}-%{release} - -%description -n cynara-devel -service (devel version) - -####################################################### %package -n cynara-db-migration Summary: Migration tools for Cynara's database @@ -268,9 +149,6 @@ cp -a %{SOURCE1008} . cp -a %{SOURCE1009} . cp -a %{SOURCE1010} . cp -a %{SOURCE1011} . -cp -a %{SOURCE1012} . -cp -a %{SOURCE1013} . -cp -a %{SOURCE1014} . cp -a test/db/db* . %build @@ -363,14 +241,6 @@ fi %postun -n libcynara-client -p /sbin/ldconfig -%post -n libcynara-client-async -p /sbin/ldconfig - -%postun -n libcynara-client-async -p /sbin/ldconfig - -%post -n libcynara-client-commons -p /sbin/ldconfig - -%postun -n libcynara-client-commons -p /sbin/ldconfig - %post -n libcynara-admin -p /sbin/ldconfig %postun -n libcynara-admin -p /sbin/ldconfig @@ -379,75 +249,27 @@ fi %postun -n libcynara-agent -p /sbin/ldconfig -%post -n libcynara-storage -p /sbin/ldconfig - -%postun -n libcynara-storage -p /sbin/ldconfig - -%post -n libcynara-storage-devel -p /sbin/ldconfig - -%postun -n libcynara-storage-devel -p /sbin/ldconfig - %post -n libcynara-commons -p /sbin/ldconfig %postun -n libcynara-commons -p /sbin/ldconfig -%post -n libcynara-client-devel -p /sbin/ldconfig - -%postun -n libcynara-client-devel -p /sbin/ldconfig - -%post -n libcynara-client-async-devel -p /sbin/ldconfig - -%postun -n libcynara-client-async-devel -p /sbin/ldconfig - -%post -n libcynara-client-commons-devel -p /sbin/ldconfig - -%postun -n libcynara-client-commons-devel -p /sbin/ldconfig - -%post -n libcynara-admin-devel -p /sbin/ldconfig - -%postun -n libcynara-admin-devel -p /sbin/ldconfig - -%post -n libcynara-agent-devel -p /sbin/ldconfig - -%postun -n libcynara-agent-devel -p /sbin/ldconfig - -%post -n libcynara-commons-devel -p /sbin/ldconfig - -%postun -n libcynara-commons-devel -p /sbin/ldconfig - %post -n libcynara-creds-commons -p /sbin/ldconfig %postun -n libcynara-creds-commons -p /sbin/ldconfig -%post -n libcynara-creds-commons-devel -p /sbin/ldconfig - -%postun -n libcynara-creds-commons-devel -p /sbin/ldconfig - %post -n libcynara-creds-dbus -p /sbin/ldconfig %postun -n libcynara-creds-dbus -p /sbin/ldconfig -%post -n libcynara-creds-dbus-devel -p /sbin/ldconfig - -%postun -n libcynara-creds-dbus-devel -p /sbin/ldconfig - %post -n libcynara-creds-socket -p /sbin/ldconfig %postun -n libcynara-creds-socket -p /sbin/ldconfig -%post -n libcynara-creds-socket-devel -p /sbin/ldconfig - -%postun -n libcynara-creds-socket-devel -p /sbin/ldconfig - %post -n libcynara-session -p /sbin/ldconfig %postun -n libcynara-session -p /sbin/ldconfig -%post -n libcynara-session-devel -p /sbin/ldconfig - -%postun -n libcynara-session-devel -p /sbin/ldconfig - -%files -n cynara +%files %manifest cynara.manifest %license LICENSE %attr(755,root,root) /usr/bin/cynara @@ -462,88 +284,42 @@ fi %dir %attr(700,cynara,cynara) %{state_path} %dir %attr(755,cynara,cynara) %{lib_path}/plugin/service +%files -n cynara-devel +%{_includedir}/cynara/*.h +%{_includedir}/cynara/plugin/*.h +%{_includedir}/cynara/types/*.h +%{_libdir}/pkgconfig/*.pc +%{_libdir}/*.so + +%files -n cynara-tests +%manifest cynara-tests.manifest +%attr(755,root,root) /usr/bin/cynara-tests +%attr(755,root,root) %{tests_dir}/db*/* +%dir %attr(755,root,root) %{tests_dir}/empty_db + %files -n libcynara-client %manifest libcynara-client.manifest %license LICENSE %{_libdir}/libcynara-client.so.* - -%files -n libcynara-client-devel -%{_includedir}/cynara/cynara-client.h -%{_libdir}/pkgconfig/cynara-client.pc -%{_libdir}/libcynara-client.so - -%files -n libcynara-client-async -%manifest libcynara-client-async.manifest -%license LICENSE %{_libdir}/libcynara-client-async.so.* - -%files -n libcynara-client-async-devel -%{_includedir}/cynara/cynara-client-async.h -%{_libdir}/pkgconfig/cynara-client-async.pc -%{_libdir}/libcynara-client-async.so - -%files -n libcynara-client-commons -%manifest libcynara-client-commons.manifest -%license LICENSE %{_libdir}/libcynara-client-commons.so.* %dir %attr(755,cynara,cynara) %{lib_path}/plugin/client -%files -n libcynara-client-commons-devel -%{_includedir}/cynara/cynara-error.h -%{_libdir}/libcynara-client-commons.so - %files -n libcynara-admin %manifest libcynara-admin.manifest %license LICENSE %{_libdir}/libcynara-admin.so.* -%files -n libcynara-admin-devel -%{_includedir}/cynara/cynara-admin.h -%{_includedir}/cynara/cynara-admin-types.h -%{_libdir}/libcynara-admin.so -%{_libdir}/pkgconfig/cynara-admin.pc - %files -n libcynara-agent %manifest libcynara-agent.manifest %license LICENSE %{_libdir}/libcynara-agent.so.* -%files -n libcynara-agent-devel -%{_includedir}/cynara/cynara-agent.h -%{_libdir}/libcynara-agent.so -%{_libdir}/pkgconfig/cynara-agent.pc - -%files -n libcynara-storage -%manifest libcynara-storage.manifest -%license LICENSE -%{_libdir}/libcynara-storage.so.* - -%files -n libcynara-storage-devel -%{_libdir}/libcynara-storage.so - %files -n libcynara-commons %manifest libcynara-commons.manifest %license LICENSE %{_libdir}/libcynara-commons.so.* - -%files -n libcynara-commons-devel -%{_includedir}/cynara/cynara-policy-types.h -%{_includedir}/cynara/plugin/ExternalPluginInterface.h -%{_includedir}/cynara/types/ClientSession.h -%{_includedir}/cynara/types/PolicyResult.h -%{_includedir}/cynara/types/PolicyType.h -%{_libdir}/libcynara-commons.so - -%files -n libcynara-plugin-devel -%{_includedir}/cynara/cynara-plugin.h -%{_includedir}/cynara/cynara-client-plugin.h -%{_libdir}/pkgconfig/cynara-plugin.pc - -%files -n cynara-tests -%manifest cynara-tests.manifest -%attr(755,root,root) /usr/bin/cynara-tests -%attr(755,root,root) %{tests_dir}/db*/* -%dir %attr(755,root,root) %{tests_dir}/empty_db +%{_libdir}/libcynara-storage.so.* %files -n libcynara-creds-commons %manifest libcynara-creds-commons.manifest @@ -551,41 +327,21 @@ fi %{_libdir}/libcynara-creds-commons.so.* %{conf_path}creds.conf -%files -n libcynara-creds-commons-devel -%{_includedir}/cynara/cynara-creds-commons.h -%{_libdir}/libcynara-creds-commons.so -%{_libdir}/pkgconfig/cynara-creds-commons.pc - %files -n libcynara-creds-dbus %manifest libcynara-creds-dbus.manifest %license LICENSE %{_libdir}/libcynara-creds-dbus.so.* -%files -n libcynara-creds-dbus-devel -%{_includedir}/cynara/cynara-creds-dbus.h -%{_libdir}/libcynara-creds-dbus.so -%{_libdir}/pkgconfig/cynara-creds-dbus.pc - %files -n libcynara-creds-socket %manifest libcynara-creds-socket.manifest %license LICENSE %{_libdir}/libcynara-creds-socket.so.* -%files -n libcynara-creds-socket-devel -%{_includedir}/cynara/cynara-creds-socket.h -%{_libdir}/libcynara-creds-socket.so -%{_libdir}/pkgconfig/cynara-creds-socket.pc - %files -n libcynara-session %manifest libcynara-session.manifest %license LICENSE %{_libdir}/libcynara-session.so.* -%files -n libcynara-session-devel -%{_includedir}/cynara/cynara-session.h -%{_libdir}/libcynara-session.so -%{_libdir}/pkgconfig/cynara-session.pc - %files -n cynara-db-migration %manifest cynara-db-migration.manifest %attr(744,root,root) %{_sbindir}/cynara/cynara-db-migration.sh diff --git a/packaging/libcynara-client-async.manifest b/packaging/libcynara-client-async.manifest deleted file mode 100644 index a76fdba..0000000 --- a/packaging/libcynara-client-async.manifest +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/packaging/libcynara-client-commons.manifest b/packaging/libcynara-client-commons.manifest deleted file mode 100644 index a76fdba..0000000 --- a/packaging/libcynara-client-commons.manifest +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/packaging/libcynara-storage.manifest b/packaging/libcynara-storage.manifest deleted file mode 100644 index a76fdba..0000000 --- a/packaging/libcynara-storage.manifest +++ /dev/null @@ -1,5 +0,0 @@ - - - - - -- 2.7.4 From 1d7785957f74ba5443759688245ec92a221bad78 Mon Sep 17 00:00:00 2001 From: Rafal Krypa Date: Fri, 31 Oct 2014 14:33:16 +0100 Subject: [PATCH 15/16] packaging: make cynara-devel depend on dbus-devel D-Bus include is being included from cynara-creds-dbus.h. D-Bus headers will be required for successful compilation against cynara-creds-dbus. Change-Id: Ib223f7025fe7c49f57741b6dca11f294b927d06e --- packaging/cynara.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/cynara.spec b/packaging/cynara.spec index bf5c00a..a9fa629 100644 --- a/packaging/cynara.spec +++ b/packaging/cynara.spec @@ -63,6 +63,7 @@ Requires: libcynara-creds-commons = %{version}-%{release} Requires: libcynara-creds-dbus = %{version}-%{release} Requires: libcynara-creds-socket = %{version}-%{release} Requires: libcynara-session = %{version}-%{release} +Requires: pkgconfig(dbus-1) %description devel Cynara development files -- 2.7.4 From 332dcdd8783d9fd94a852b8ec9535a54029cc5a5 Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski Date: Mon, 17 Nov 2014 11:57:07 +0100 Subject: [PATCH 16/16] Release 0.4.1 Change-Id: I79a7007db3af7e7815547c7ccbca8f23986fab02 --- CMakeLists.txt | 2 +- changelog | 23 +++++++++++++++++++++++ packaging/cynara.spec | 2 +- src/admin/CMakeLists.txt | 2 +- src/client-common/CMakeLists.txt | 2 +- src/client/CMakeLists.txt | 2 +- src/common/CMakeLists.txt | 2 +- src/helpers/creds-commons/CMakeLists.txt | 2 +- src/helpers/creds-dbus/CMakeLists.txt | 2 +- src/helpers/creds-socket/CMakeLists.txt | 2 +- src/helpers/session/CMakeLists.txt | 2 +- 11 files changed, 33 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5271bb2..0bfb07d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3) PROJECT("cynara") -set(CYNARA_VERSION 0.4.0) +set(CYNARA_VERSION 0.4.1) ############################# cmake packages ################################## diff --git a/changelog b/changelog index e841be7..aa297e4 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,28 @@ ############################## +Release: 0.4.1 +Date: 2014.11.17 +Name: Fix packaging problems + +Libraries: +libcynara-admin.0.4.1 +libcynara-agent.0.4.1 +libcynara-client-async.0.4.1 +libcynara-client-commmons.0.4.1 +libcynara-client.0.4.1 +libcynara-commons.0.4.1 +libcynara-creds-commons.0.4.1 +libcynara-creds-dbus.0.4.1 +libcynara-creds-socket.0.4.1 +libcynara-session.0.4.1 +libcynara-storage.0.4.1 + +Description: +Fix problems with packages dependencies +Create missing plugin directories + +############################## + Release: 0.4.0 Date: 2014.11.15 Name: Asynchronous client and extensions API diff --git a/packaging/cynara.spec b/packaging/cynara.spec index a9fa629..377d6b2 100644 --- a/packaging/cynara.spec +++ b/packaging/cynara.spec @@ -1,6 +1,6 @@ Name: cynara Summary: Cynara service with client libraries -Version: 0.4.0 +Version: 0.4.1 Release: 1 Group: Security/Application Privilege License: Apache-2.0 diff --git a/src/admin/CMakeLists.txt b/src/admin/CMakeLists.txt index 7cab9f6..3b46f63 100644 --- a/src/admin/CMakeLists.txt +++ b/src/admin/CMakeLists.txt @@ -17,7 +17,7 @@ # SET(LIB_CYNARA_ADMIN_VERSION_MAJOR 0) -SET(LIB_CYNARA_ADMIN_VERSION ${LIB_CYNARA_ADMIN_VERSION_MAJOR}.4.0) +SET(LIB_CYNARA_ADMIN_VERSION ${LIB_CYNARA_ADMIN_VERSION_MAJOR}.4.1) SET(CYNARA_LIB_CYNARA_ADMIN_PATH ${CYNARA_PATH}/admin) diff --git a/src/client-common/CMakeLists.txt b/src/client-common/CMakeLists.txt index 36c6806..0c3c431 100644 --- a/src/client-common/CMakeLists.txt +++ b/src/client-common/CMakeLists.txt @@ -17,7 +17,7 @@ # SET(LIB_CYNARA_CLIENT_COMMON_VERSION_MAJOR 0) -SET(LIB_CYNARA_CLIENT_COMMON_VERSION ${LIB_CYNARA_CLIENT_COMMON_VERSION_MAJOR}.4.0) +SET(LIB_CYNARA_CLIENT_COMMON_VERSION ${LIB_CYNARA_CLIENT_COMMON_VERSION_MAJOR}.4.1) SET(LIB_CYNARA_COMMON_PATH ${CYNARA_PATH}/client-common) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 79d85a2..e20fd51 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -18,7 +18,7 @@ # SET(LIB_CYNARA_VERSION_MAJOR 0) -SET(LIB_CYNARA_VERSION ${LIB_CYNARA_VERSION_MAJOR}.4.0) +SET(LIB_CYNARA_VERSION ${LIB_CYNARA_VERSION_MAJOR}.4.1) SET(LIB_CYNARA_PATH ${CYNARA_PATH}/client) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 68bda47..797e233 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -17,7 +17,7 @@ # SET(CYNARA_COMMON_VERSION_MAJOR 0) -SET(CYNARA_COMMON_VERSION ${CYNARA_COMMON_VERSION_MAJOR}.4.0) +SET(CYNARA_COMMON_VERSION ${CYNARA_COMMON_VERSION_MAJOR}.4.1) SET(COMMON_PATH ${CYNARA_PATH}/common) diff --git a/src/helpers/creds-commons/CMakeLists.txt b/src/helpers/creds-commons/CMakeLists.txt index bafa025..98ea56c 100644 --- a/src/helpers/creds-commons/CMakeLists.txt +++ b/src/helpers/creds-commons/CMakeLists.txt @@ -19,7 +19,7 @@ # SET(LIB_CREDS_COMMONS_VERSION_MAJOR 0) -SET(LIB_CREDS_COMMONS_VERSION ${LIB_CREDS_COMMONS_VERSION_MAJOR}.4.0) +SET(LIB_CREDS_COMMONS_VERSION ${LIB_CREDS_COMMONS_VERSION_MAJOR}.4.1) SET(LIB_CREDS_COMMONS_PATH ${CYNARA_PATH}/helpers/creds-commons) diff --git a/src/helpers/creds-dbus/CMakeLists.txt b/src/helpers/creds-dbus/CMakeLists.txt index 69b94e2..b3c9ee6 100644 --- a/src/helpers/creds-dbus/CMakeLists.txt +++ b/src/helpers/creds-dbus/CMakeLists.txt @@ -19,7 +19,7 @@ # SET(LIB_CREDS_DBUS_VERSION_MAJOR 0) -SET(LIB_CREDS_DBUS_VERSION ${LIB_CREDS_DBUS_VERSION_MAJOR}.4.0) +SET(LIB_CREDS_DBUS_VERSION ${LIB_CREDS_DBUS_VERSION_MAJOR}.4.1) SET(LIB_CREDS_DBUS_PATH ${CYNARA_PATH}/helpers/creds-dbus) diff --git a/src/helpers/creds-socket/CMakeLists.txt b/src/helpers/creds-socket/CMakeLists.txt index 1d40f3b..847ffe5 100644 --- a/src/helpers/creds-socket/CMakeLists.txt +++ b/src/helpers/creds-socket/CMakeLists.txt @@ -19,7 +19,7 @@ # SET(LIB_CREDS_SOCKET_VERSION_MAJOR 0) -SET(LIB_CREDS_SOCKET_VERSION ${LIB_CREDS_SOCKET_VERSION_MAJOR}.4.0) +SET(LIB_CREDS_SOCKET_VERSION ${LIB_CREDS_SOCKET_VERSION_MAJOR}.4.1) SET(LIB_CREDS_SOCKET_PATH ${CYNARA_PATH}/helpers/creds-socket) diff --git a/src/helpers/session/CMakeLists.txt b/src/helpers/session/CMakeLists.txt index 6ad7234..8d3774c 100644 --- a/src/helpers/session/CMakeLists.txt +++ b/src/helpers/session/CMakeLists.txt @@ -19,7 +19,7 @@ # SET(LIB_SESSION_VERSION_MAJOR 0) -SET(LIB_SESSION_VERSION ${LIB_SESSION_VERSION_MAJOR}.4.0) +SET(LIB_SESSION_VERSION ${LIB_SESSION_VERSION_MAJOR}.4.1) SET(LIB_SESSION_PATH ${CYNARA_PATH}/helpers/session) -- 2.7.4