Skip to content

Commit

Permalink
Bump outdated packages (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
gildub authored Jul 5, 2024
1 parent 8783f89 commit 81ac36d
Show file tree
Hide file tree
Showing 6 changed files with 415 additions and 323 deletions.
10 changes: 5 additions & 5 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"@patternfly/react-table": "^5.2.1",
"@patternfly/react-tokens": "^5.2.1",
"@segment/analytics-next": "^1.64.0",
"@tanstack/react-query": "^5.22.2",
"@tanstack/react-query-devtools": "^5.24.0",
"@tanstack/react-query": "^5.50.1",
"@tanstack/react-query-devtools": "^5.50.1",
"axios": "^1.7.2",
"dayjs": "^1.11.7",
"ejs": "^3.1.7",
"ejs": "^3.1.10",
"file-saver": "^2.0.5",
"monaco-editor": "0.34.1",
"oidc-client-ts": "^2.4.0",
Expand All @@ -54,8 +54,8 @@
},
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/dotenv-webpack": "^7.0.3",
"@types/ejs": "^3.1.0",
Expand Down
7 changes: 3 additions & 4 deletions common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"*.{css,json,md,yaml,yml}": "prettier --write"
},
"dependencies": {
"ejs": "^3.1.7",
"http-proxy-middleware": "^2.0.6"
},
"devDependencies": {}
"ejs": "^3.1.10",
"http-proxy-middleware": "^3.0.0"
}
}
44 changes: 22 additions & 22 deletions common/src/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ import { TRUSTIFICATION_ENV } from "./environment.js";
export const proxyMap: Record<string, Options> = {
"/api": {
target: TRUSTIFICATION_ENV.TRUSTIFY_API_URL || "http://localhost:8080",
logLevel: process.env.DEBUG ? "debug" : "info",

logger: process.env.DEBUG ? "debug" : "info",
changeOrigin: true,

onProxyReq: (proxyReq, req, _res) => {
// Add the Bearer token to the request if it is not already present, AND if
// the token is part of the request as a cookie
if (req.cookies?.keycloak_cookie && !req.headers["authorization"]) {
proxyReq.setHeader(
"Authorization",
`Bearer ${req.cookies.keycloak_cookie}`
);
}
},
onProxyRes: (proxyRes, req, res) => {
const includesJsonHeaders =
req.headers.accept?.includes("application/json");
if (
(!includesJsonHeaders && proxyRes.statusCode === 401) ||
(!includesJsonHeaders && proxyRes.statusMessage === "Unauthorized")
) {
res.redirect("/");
}
on: {
proxyReq: (proxyReq: any, req: any, _res: any) => {
// Add the Bearer token to the request if it is not already present, AND if
// the token is part of the request as a cookie
if (req.cookies?.keycloak_cookie && !req.headers["authorization"]) {
proxyReq.setHeader(
"Authorization",
`Bearer ${req.cookies.keycloak_cookie}`
);
}
},
proxyRes: (proxyRes: any, req: any, res: any) => {
const includesJsonHeaders =
req.headers.accept?.includes("application/json");
if (
(!includesJsonHeaders && proxyRes.statusCode === 401) ||
(!includesJsonHeaders && proxyRes.statusMessage === "Unauthorized")
) {
res.redirect("/");
}
},
},
},
};
Loading

0 comments on commit 81ac36d

Please sign in to comment.