feat: Support for OpenID Connect (#2431)

* feat: Add OpenID Connect support, speed up docker rebuilds

* fix: Switch Google Cloud API URL to v1

* chore: Remove redux-oidc and use our own components instead
This commit is contained in:
Erik Ziegler authored and GitHub committed 2021-06-23 20:41:27 +02:00
1 parent 5643f8f6d2
commit e7b32cc51e
50 files changed
+2746 -2109

No files matched your search

+7 -5
View File
@@ -63,9 +63,8 @@ All use the `ACTIVE_VIEWPORT::CORNERSTONE` context.
## Viewport Module
Our Viewport wraps [cornerstonejs/react-cornerstone-viewport][react-viewport]
and is connected the redux store. This module is the most prone to change as we
hammer out our Viewport interface.
Our Viewport wraps [cornerstonejs/react-cornerstone-viewport][react-viewport].
This module is the most prone to change as we hammer out our Viewport interface.
## Tool Configuration
@@ -87,10 +86,12 @@ Tools can be configured through extension configuration using the tools key:
## Annotate Tools Configuration
*We currently support one property for annotation tools.*
_We currently support one property for annotation tools._
### Hide handles
This extension configuration allows you to toggle on/off handle rendering for all annotate tools:
This extension configuration allows you to toggle on/off handle rendering for
all annotate tools:
```js
...
@@ -119,3 +120,4 @@ This extension configuration allows you to toggle on/off handle rendering for al
[cornerstone-tools]: https://github.com/cornerstonejs/cornerstoneTools
[cornerstone]: https://github.com/cornerstonejs/cornerstone
<!-- prettier-ignore-end -->
```
+4 -1
View File
@@ -5,7 +5,7 @@ import csTools from 'cornerstone-tools';
import merge from 'lodash.merge';
import getTools, { toolsGroupedByType } from './utils/getTools.js';
import initCornerstoneTools from './initCornerstoneTools.js';
import './initWADOImageLoader.js';
import initWADOImageLoader from './initWADOImageLoader.js';
import getCornerstoneMeasurementById from './utils/getCornerstoneMeasurementById';
import measurementServiceMappingsFactory from './utils/measurementServiceMappings/measurementServiceMappingsFactory';
import { setEnabledElement } from './state';
@@ -69,6 +69,7 @@ export default function init({
MeasurementService,
DisplaySetService,
ToolBarService,
UserAuthenticationService,
} = servicesManager.services;
const tools = getTools();
@@ -275,6 +276,8 @@ export default function init({
cs.metaData.addProvider(metadataProvider.get.bind(metadataProvider), 9999);
initWADOImageLoader(UserAuthenticationService);
// ~~
const defaultCsToolsConfig = csToolsConfig || {
globalToolSyncEnabled: false, // hold on to your pants!
@@ -2,17 +2,40 @@ import cornerstone from 'cornerstone-core';
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
import dicomParser from 'dicom-parser';
//import { initWebWorkers } from './utils/index.js';
let initialized = false;
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
cornerstoneWADOImageLoader.external.dicomParser = dicomParser;
function initWebWorkers() {
const config = {
maxWebWorkers: Math.max(navigator.hardwareConcurrency - 1, 1),
startWebWorkersOnDemand: true,
taskConfiguration: {
decodeTask: {
initializeCodecsOnStartup: false,
usePDFJS: false,
strict: false,
},
},
};
cornerstoneWADOImageLoader.configure({
beforeSend: function(xhr) {
/*const headers = OHIF.DICOMWeb.getAuthorizationHeader();
if (!initialized) {
cornerstoneWADOImageLoader.webWorkerManager.initialize(config);
initialized = true;
}
}
if (headers.Authorization) {
xhr.setRequestHeader('Authorization', headers.Authorization);
}*/
},
});
export default function initWADOImageLoader(UserAuthenticationService) {
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
cornerstoneWADOImageLoader.external.dicomParser = dicomParser;
cornerstoneWADOImageLoader.configure({
beforeSend: function(xhr) {
const headers = UserAuthenticationService.getAuthorizationHeader();
if (headers && headers.Authorization) {
xhr.setRequestHeader('Authorization', headers.Authorization);
}
},
});
initWebWorkers();
}
@@ -1,22 +0,0 @@
import { redux } from '@ohif/core';
const { setLayout } = redux.actions;
/**
* Update the current layout with a simple Cornerstone one
*
* @return void
*/
const setCornerstoneLayout = () => {
const layout = {
numRows: 1,
numColumns: 1,
viewports: [{ plugin: 'cornerstone' }],
};
const action = setLayout(layout);
window.store.dispatch(action);
};
export default setCornerstoneLayout;