Merge pull request #8233 from backstage/freben/less-cross

🧹  Align on usage of `cross-fetch` vs `node-fetch` in frontend vs backend packages
This commit is contained in:
Fredrik Adelöw
2021-11-26 10:15:50 +01:00
committed by GitHub
34 changed files with 74 additions and 68 deletions
+1 -1
View File
@@ -42,7 +42,6 @@
"compression": "^1.7.4",
"cookie-parser": "^1.4.5",
"cors": "^2.8.5",
"cross-fetch": "^3.0.6",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
"express-session": "^1.17.1",
@@ -56,6 +55,7 @@
"luxon": "^2.0.2",
"minimatch": "^3.0.3",
"morgan": "^1.10.0",
"node-fetch": "^2.6.1",
"node-cache": "^5.1.2",
"openid-client": "^4.2.1",
"passport": "^0.4.1",
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import fetch from 'cross-fetch';
import fetch from 'node-fetch';
import { JWK, JWT, JWKS, JSONWebKey } from 'jose';
import { BackstageIdentity } from '../providers';
import { PluginEndpointDiscovery } from '@backstage/backend-common';
@@ -50,7 +50,7 @@ const mockClaims = {
};
jest.mock('jose');
jest.mock('cross-fetch', () => ({
jest.mock('node-fetch', () => ({
__esModule: true,
default: async () => {
return {
@@ -21,7 +21,7 @@ import {
SignInResolver,
} from '../types';
import express from 'express';
import fetch from 'cross-fetch';
import fetch from 'node-fetch';
import * as crypto from 'crypto';
import { KeyObject } from 'crypto';
import { Logger } from 'winston';