comparison Plugin/Plugin.cpp @ 57:55539d564f4f

added support for /dicom-web/series? & /dicom-web/instances?
author Alain Mazy <am@osimis.io>
date Wed, 09 Nov 2022 15:40:35 +0100
parents c02f0646297d
children ad279c70c22d
comparison
equal deleted inserted replaced
56:c02f0646297d 57:55539d564f4f
71 if (authorizationParser_.get() != NULL && 71 if (authorizationParser_.get() != NULL &&
72 authorizationService_.get() != NULL) 72 authorizationService_.get() != NULL)
73 { 73 {
74 // Parse the resources that are accessed through this URI 74 // Parse the resources that are accessed through this URI
75 OrthancPlugins::IAuthorizationParser::AccessedResources accesses; 75 OrthancPlugins::IAuthorizationParser::AccessedResources accesses;
76 std::map<std::string, std::string> getArguments; 76 OrthancPlugins::AssociativeArray getArguments(getArgumentsCount, getArgumentsKeys, getArgumentsValues, true);
77 for (uint32_t i = 0; i < getArgumentsCount; i++) 77
78 { 78 if (!authorizationParser_->Parse(accesses, uri, getArguments.GetMap()))
79 getArguments[getArgumentsKeys[i]] = getArgumentsValues[i];
80 }
81
82 if (!authorizationParser_->Parse(accesses, uri, getArguments))
83 { 79 {
84 return 0; // Unable to parse this URI 80 return 0; // Unable to parse this URI
85 } 81 }
86 82
87 // Loop over all the accessed resources to ensure access is 83 // Loop over all the accessed resources to ensure access is
106 } 102 }
107 else 103 else
108 { 104 {
109 OrthancPlugins::AssociativeArray headers 105 OrthancPlugins::AssociativeArray headers
110 (headersCount, headersKeys, headersValues, false); 106 (headersCount, headersKeys, headersValues, false);
111
112 OrthancPlugins::AssociativeArray getArguments
113 (getArgumentsCount, getArgumentsKeys, getArgumentsValues, true);
114 107
115 // Loop over all the authorization tokens stored in the HTTP 108 // Loop over all the authorization tokens stored in the HTTP
116 // headers, until finding one that is granted 109 // headers, until finding one that is granted
117 for (std::list<OrthancPlugins::Token>::const_iterator 110 for (std::list<OrthancPlugins::Token>::const_iterator
118 token = tokens_.begin(); token != tokens_.end(); ++token) 111 token = tokens_.begin(); token != tokens_.end(); ++token)