comparison Plugin/Plugin.cpp @ 54:317b31e99501

Added 3 new configurations: WebServiceUsername, WebServicePassword, WebServiceIdentifier. WebServiceIdentifier is now included in the payload as the 'identifier' field
author Alain Mazy <am@osimis.io>
date Mon, 26 Sep 2022 15:20:39 +0200
parents 6190b564622f
children c02f0646297d
comparison
equal deleted inserted replaced
53:01e0c35e004c 54:317b31e99501
346 { 346 {
347 uncheckedLevels_.insert(OrthancPlugins::StringToAccessLevel(*it)); 347 uncheckedLevels_.insert(OrthancPlugins::StringToAccessLevel(*it));
348 } 348 }
349 } 349 }
350 350
351 std::unique_ptr<OrthancPlugins::AuthorizationWebService> webService(new OrthancPlugins::AuthorizationWebService(url));
352
353 std::string webServiceIdentifier;
354 if (configuration.LookupStringValue(webServiceIdentifier, "WebServiceIdentifier"))
355 {
356 webService->SetIdentifier(webServiceIdentifier);
357 }
358
359 std::string webServiceUsername;
360 std::string webServicePassword;
361 if (configuration.LookupStringValue(webServiceUsername, "WebServiceUsername") && configuration.LookupStringValue(webServicePassword, "WebServicePassword"))
362 {
363 webService->SetCredentials(webServiceUsername, webServicePassword);
364 }
365
351 authorizationService_.reset 366 authorizationService_.reset
352 (new OrthancPlugins::CachedAuthorizationService 367 (new OrthancPlugins::CachedAuthorizationService
353 (new OrthancPlugins::AuthorizationWebService(url), factory)); 368 (webService.release(), factory));
354 369
355 OrthancPluginRegisterOnChangeCallback(context, OnChangeCallback); 370 OrthancPluginRegisterOnChangeCallback(context, OnChangeCallback);
356 371
357 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 2, 1) 372 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 2, 1)
358 OrthancPluginRegisterIncomingHttpRequestFilter2(context, FilterHttpRequests); 373 OrthancPluginRegisterIncomingHttpRequestFilter2(context, FilterHttpRequests);