# HG changeset patch # User Alain Mazy # Date 1749569099 -7200 # Node ID 9d91c7f0c204e882666582358ea40c542d4e169f # Parent 8556402871781eb147c37e4545b9199c42e2dbdc /tokens/decode now returns the list of resources in the token diff -r 855640287178 -r 9d91c7f0c204 NEWS --- a/NEWS Mon May 26 19:37:53 2025 +0200 +++ b/NEWS Tue Jun 10 17:24:59 2025 +0200 @@ -6,6 +6,9 @@ => Minimum SDK version: 1.11.3 <= * New default permissions to Q&R remote modalities +* The /tokens/decode route now returns 2 additionnal fields: + "ResourcesDicomIds" and "ResourcesOrthancIds". + This will only work if the authorization service returns a "resources" field to the /tokens/decode route. * Maintenance: Use Orthanc SDK 1.12.4 by default to benefit from more detailed logging. * Fix default permission for /dicom-web/servers/../stow * When calling /dicom-web/studies with a resource token when no StudyInstanceUID diff -r 855640287178 -r 9d91c7f0c204 Plugin/Plugin.cpp --- a/Plugin/Plugin.cpp Mon May 26 19:37:53 2025 +0200 +++ b/Plugin/Plugin.cpp Tue Jun 10 17:24:59 2025 +0200 @@ -1182,6 +1182,18 @@ decodedJsonToken["TokenType"] = decodedToken.tokenType; } + decodedJsonToken["ResourcesDicomIds"] = Json::arrayValue; + for (std::set::const_iterator it = decodedToken.resourcesDicomIds.begin(); it != decodedToken.resourcesDicomIds.end(); ++it) + { + decodedJsonToken["ResourcesDicomIds"].append(*it); + } + + decodedJsonToken["ResourcesOrthancIds"] = Json::arrayValue; + for (std::set::const_iterator it = decodedToken.resourcesOrthancIds.begin(); it != decodedToken.resourcesOrthancIds.end(); ++it) + { + decodedJsonToken["ResourcesOrthancIds"].append(*it); + } + OrthancPlugins::AnswerJson(decodedJsonToken, output); } }