[med-svn] [Git][med-team/libzeep][upstream] New upstream version 7.3.2
Maarten L. Hekkelman (@mhekkel-guest)
gitlab at salsa.debian.org
Thu Feb 26 12:34:05 GMT 2026
Maarten L. Hekkelman pushed to branch upstream at Debian Med / libzeep
Commits:
7ab6e274 by Maarten L. Hekkelman at 2026-02-26T12:30:30+01:00
New upstream version 7.3.2
- - - - -
5 changed files:
- CMakeLists.txt
- changelog
- examples/CMakeLists.txt
- examples/daemon-sample.cpp
- test/crypto-test.cpp
Changes:
=====================================
CMakeLists.txt
=====================================
@@ -5,7 +5,7 @@
cmake_minimum_required(VERSION 3.28)
-project(libzeep VERSION 7.3.1 LANGUAGES CXX)
+project(libzeep VERSION 7.3.2 LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
@@ -149,6 +149,7 @@ write_version_header("${CMAKE_CURRENT_SOURCE_DIR}/src" LIB_NAME "libzeep")
# Library rules
file(GLOB_RECURSE zeep_cpp src/*.cpp)
file(GLOB_RECURSE zeep_hpp include/*.hpp)
+list(APPEND zeep_hpp include/zeep/config.hpp)
# TODO: SOAP is not working at the moment, really need to fix that
list(FILTER zeep_cpp EXCLUDE REGEX src/soap-controller.cpp)
=====================================
changelog
=====================================
@@ -1,3 +1,6 @@
+Version 7.3.2
+- Revive daemon-test example application
+
Version 7.3.1
- Fix regression in controller::set_reply for files.
- Fix login controller behaviour on invalid password
=====================================
examples/CMakeLists.txt
=====================================
@@ -8,25 +8,31 @@ cmake_minimum_required(VERSION 3.16)
project(libzeep-examples LANGUAGES CXX)
set(CXX_EXTENSIONS OFF)
-set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Only try to find package if we're not included from the main libzeep CMakeLists.txt
-get_property(PARENT_DIRECTORY DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" PROPERTY PARENT_DIRECTORY)
+if(PROJECT_IS_TOP_LEVEL)
+ find_package(zeep REQUIRED)
+endif()
+
+if(UNIX)
+ find_file(HAVE_UNISTD_H "unistd.h")
-if("${PARENT_DIRECTORY}" STREQUAL "")
- find_package(zeep REQUIRED)
+ if(HAVE_UNISTD_H)
+ set(HTTP_HAS_UNIX_DAEMON 1)
+ endif()
endif()
list(APPEND examples http-server-0 http-server-1 http-server-2 http-server-3
- security-sample rest-sample rest-sample-2 # soap-sample
- )
+ security-sample rest-sample rest-sample-2 # soap-sample
+)
-if (ZEEP_HAS_UNIX_DAEMON)
- list(APPEND examples daemon-sample)
+if(HTTP_HAS_UNIX_DAEMON)
+ list(APPEND examples daemon-sample)
endif()
foreach(EXAMPLE IN LISTS examples)
- add_executable(${EXAMPLE} ${CMAKE_CURRENT_SOURCE_DIR}/${EXAMPLE}.cpp)
- target_link_libraries(${EXAMPLE} zeep::zeep)
+ add_executable(${EXAMPLE} ${CMAKE_CURRENT_SOURCE_DIR}/${EXAMPLE}.cpp)
+ target_link_libraries(${EXAMPLE} zeep::zeep)
endforeach()
=====================================
examples/daemon-sample.cpp
=====================================
@@ -3,28 +3,38 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
+#include <filesystem>
#include <iostream>
-#include <zeep/http/controller.hpp>
+#include <zeep/http/html-controller.hpp>
#include <zeep/http/daemon.hpp>
+#include <zeep/http/template-processor.hpp>
-namespace zh = zeep::http;
-
-class hello_controller : public zh::controller
+class hello_controller : public zeep::http::html_controller
{
public:
/* Specify the root path as prefix, will handle any request URI */
hello_controller()
- : controller("/")
{
+ /* Mount the handler `handle_index` on `/`, `/index` and `/index.html` */
+ map_get("{,index,index.html}", &hello_controller::handle_index, "name");
+
+ /* Add REST call */
+ map_get_request("restcall", &hello_controller::handle_rest_call);
+ }
+
+ zeep::http::reply handle_index(const zeep::http::scope &scope, std::optional<std::string> name)
+ {
+ zeep::http::scope sub(scope);
+ if (name.has_value())
+ sub.put("name", *name);
+
+ return get_template_processor().create_reply_from_template("hello.xhtml", sub);
}
- bool handle_request([[maybe_unused]] zh::request &req, zh::reply &rep)
+ std::string handle_rest_call()
{
- /* Construct a simple reply with status OK (200) and content string */
- rep.set_status(zh::status_type::ok);
- rep.set_content("Hello", "text/plain");
- return true;
+ return "Hello, world!";
}
};
@@ -42,24 +52,40 @@ int main(int argc, char *const argv[])
std::string command = argv[1];
- zh::daemon server([&]()
+ // Avoid the need for super powers
+ std::filesystem::path
+ docRoot = std::filesystem::current_path() / "docroot",
+ pidFile = std::filesystem::temp_directory_path() / "zeep-daemon-test.pid",
+ logFile = std::filesystem::temp_directory_path() / "zeep-daemon-test.log",
+ errFile = std::filesystem::temp_directory_path() / "zeep-daemon-test.err";
+
+ if (not std::filesystem::exists(docRoot))
+ {
+ std::cout << "docroot directory not found in current directory, cannot continue\n";
+ exit(1);
+ }
+
+ zeep::http::daemon server([&]()
{
- auto s = new zeep::http::server(/*sc*/);
+ auto s = new zeep::http::server(docRoot.string());
+
+ // Force using the file based template processor
+ s->set_template_processor(new zeep::http::file_based_html_template_processor(docRoot.string()));
s->add_controller(new hello_controller());
return s; },
- "hello-daemon");
+ pidFile.string(), logFile.string(), errFile.string());
int result;
if (command == "start")
{
- std::string address = "127.0.0.1";
+ std::string address = "localhost";
unsigned short port = 10330;
- std::string user = "www-data";
- std::cout << "starting server at http://" << address << ":' << port << '/\n";
- result = server.start(address, port, 1, 16, user);
+ std::string user /* = "www-data" */; // Using a non-empty username requires super user powers
+ std::cout << "starting server at http://" << address << ':' << port << "\n";
+ result = server.start(address, port, 1, 2, user);
}
else if (command == "stop")
result = server.stop();
=====================================
test/crypto-test.cpp
=====================================
@@ -106,6 +106,12 @@ TEST_CASE("crypto_hmac_1")
auto h = zeep::encode_hex(zeep::hmac_sha256("The quick brown fox jumps over the lazy dog", "key"));
CHECK(h == "f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8");
+ h = zeep::encode_base64(zeep::hmac_sha1("The quick brown fox jumps over the lazy dog", "key"));
+ CHECK(h == "3nybhbi3iqa8ino29wqQcBydtNk=");
+
+ h = zeep::encode_hex(zeep::hmac_sha256("The quick brown fox jumps over the lazy dog", "key"));
+ CHECK(h == "f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8");
+
h = zeep::encode_hex(zeep::hmac_md5("The quick brown fox jumps over the lazy dog", "key"));
CHECK(h == "80070713463e7749b90c2dc24911e275");
}
View it on GitLab: https://salsa.debian.org/med-team/libzeep/-/commit/7ab6e274d3f72b17b638d922422821547d081d57
--
View it on GitLab: https://salsa.debian.org/med-team/libzeep/-/commit/7ab6e274d3f72b17b638d922422821547d081d57
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260226/d8bfe03f/attachment-0001.htm>
More information about the debian-med-commit
mailing list