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

@@ -10,7 +10,7 @@ import user from '../user';
* @param {string|function} [server.requestOptions.auth]
* @returns {Object} { Authorization }
*/
export default function getAuthorizationHeader({ requestOptions } = {}) {
export default function getAuthorizationHeader({ requestOptions } = {}, user) {
const headers = {};
// Check for OHIF.user since this can also be run on the server
@@ -64,11 +64,11 @@ describe('getAuthorizationHeader', () => {
it('should return an Authorization with accessToken when server is not defined and there is an accessToken', () => {
user.getAccessToken.mockImplementationOnce(() => 'MOCKED_TOKEN');
const authentication = getAuthorizationHeader({});
const exptecteHeaderBasedOnUserAccessToekn = {
const authentication = getAuthorizationHeader({}, user);
const expectedHeaderBasedOnUserAccessToken = {
Authorization: 'Bearer MOCKED_TOKEN',
};
expect(authentication).toEqual(exptecteHeaderBasedOnUserAccessToekn);
expect(authentication).toEqual(expectedHeaderBasedOnUserAccessToken);
});
});