# HG changeset patch # User Sebastien Jodogne # Date 1679075565 -3600 # Node ID e2c3c497eb8dfe63d5c3d66b3c3f16ddc8091dbb # Parent 9db6b2ed930caa202907696cdb710c099573e0b2 fix LSB build diff -r 9db6b2ed930c -r e2c3c497eb8d CMakeLists.txt --- a/CMakeLists.txt Fri Mar 17 17:02:09 2023 +0100 +++ b/CMakeLists.txt Fri Mar 17 18:52:45 2023 +0100 @@ -25,7 +25,7 @@ set(ORTHANC_FRAMEWORK_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() - set(ORTHANC_FRAMEWORK_VERSION "1.9.3") + set(ORTHANC_FRAMEWORK_VERSION "1.11.3") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() @@ -204,4 +204,4 @@ target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES} # ${AUTOGENERATED_SOURCES} - ) \ No newline at end of file + ) diff -r 9db6b2ed930c -r e2c3c497eb8d Plugin/AuthorizationWebService.cpp --- a/Plugin/AuthorizationWebService.cpp Fri Mar 17 17:02:09 2023 +0100 +++ b/Plugin/AuthorizationWebService.cpp Fri Mar 17 18:52:45 2023 +0100 @@ -282,7 +282,7 @@ } if (validityDuration > 0) { - body["validity-duration"] = validityDuration; + body["validity-duration"] = Json::UInt64(validityDuration); } std::string bodyAsString; diff -r 9db6b2ed930c -r e2c3c497eb8d Plugin/Plugin.cpp --- a/Plugin/Plugin.cpp Fri Mar 17 17:02:09 2023 +0100 +++ b/Plugin/Plugin.cpp Fri Mar 17 18:52:45 2023 +0100 @@ -49,15 +49,27 @@ return out; } -struct TokenAndValue +class TokenAndValue { - const OrthancPlugins::Token& token; - std::string value; +private: + OrthancPlugins::Token token_; + std::string value_; +public: TokenAndValue(const OrthancPlugins::Token& token, const std::string& value) : - token(token), - value(value) + token_(token), + value_(value) + { + } + + const OrthancPlugins::Token& GetToken() const { + return token_; + } + + const std::string& GetValue() const + { + return value_; } }; @@ -150,15 +162,15 @@ { for (size_t i = 0; i < authTokens.size(); ++i) { - LOG(INFO) << "Testing whether user has the required permission '" << JoinStrings(requiredPermissions) << "' based on the '" << authTokens[i].token.GetKey() << "' HTTP header required to match '" << matchedPattern << "'"; - if (authorizationService_->HasUserPermission(validity, requiredPermissions, authTokens[i].token, authTokens[i].value)) + LOG(INFO) << "Testing whether user has the required permission '" << JoinStrings(requiredPermissions) << "' based on the '" << authTokens[i].GetToken().GetKey() << "' HTTP header required to match '" << matchedPattern << "'"; + if (authorizationService_->HasUserPermission(validity, requiredPermissions, authTokens[i].GetToken(), authTokens[i].GetValue())) { - LOG(INFO) << "Testing whether user has the required permission '" << JoinStrings(requiredPermissions) << "' based on the '" << authTokens[i].token.GetKey() << "' HTTP header required to match '" << matchedPattern << "' -> granted"; + LOG(INFO) << "Testing whether user has the required permission '" << JoinStrings(requiredPermissions) << "' based on the '" << authTokens[i].GetToken().GetKey() << "' HTTP header required to match '" << matchedPattern << "' -> granted"; return 1; } else { - LOG(INFO) << "Testing whether user has the required permission '" << JoinStrings(requiredPermissions) << "' based on the '" << authTokens[i].token.GetKey() << "' HTTP header required to match '" << matchedPattern << "' -> not granted"; + LOG(INFO) << "Testing whether user has the required permission '" << JoinStrings(requiredPermissions) << "' based on the '" << authTokens[i].GetToken().GetKey() << "' HTTP header required to match '" << matchedPattern << "' -> not granted"; } } } @@ -198,7 +210,7 @@ // Loop over all the authorization tokens in the request until finding one that is granted for (size_t i = 0; i < authTokens.size(); ++i) { - if (authorizationService_->IsGranted(validity, method, *access, authTokens[i].token, authTokens[i].value)) + if (authorizationService_->IsGranted(validity, method, *access, authTokens[i].GetToken(), authTokens[i].GetValue())) { granted = true; break;