From f5a6055d5afb84bda208b6878d4e087bec0b25e7 Mon Sep 17 00:00:00 2001 From: Ethan Kaplan Date: Mon, 17 Jun 2024 12:46:12 -0700 Subject: [PATCH 1/2] MAT-7204 add intercept for waf --- src/api/useCqlLibraryServiceApi.tsx | 6 +++++- src/components/config/useGetServiceConfig.ts | 6 +++++- src/types/madie-madie-util.d.ts | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/api/useCqlLibraryServiceApi.tsx b/src/api/useCqlLibraryServiceApi.tsx index b011950..9fe0eff 100644 --- a/src/api/useCqlLibraryServiceApi.tsx +++ b/src/api/useCqlLibraryServiceApi.tsx @@ -3,7 +3,7 @@ import useServiceConfig from "./useServiceConfig"; import { ServiceConfig } from "./ServiceContext"; import { CqlLibrary } from "@madie/madie-models"; import useOktaTokens from "../hooks/useOktaTokens"; - +import { wafIntercept } from "@madie/madie-util"; export class CqlLibraryServiceApi { constructor(private baseUrl: string, private getAccessToken: () => string) {} @@ -101,6 +101,10 @@ export class CqlLibraryServiceApi { } } +axios.interceptors.response.use((response) => { + return response; +}, wafIntercept); + export default function useCqlLibraryServiceApi() { const serviceConfig: ServiceConfig = useServiceConfig(); const { getAccessToken } = useOktaTokens(); diff --git a/src/components/config/useGetServiceConfig.ts b/src/components/config/useGetServiceConfig.ts index f0e5154..03e94fa 100644 --- a/src/components/config/useGetServiceConfig.ts +++ b/src/components/config/useGetServiceConfig.ts @@ -1,6 +1,6 @@ import axios from "axios"; import { useEffect, useState } from "react"; - +import { wafIntercept } from "@madie/madie-util"; export interface OktaConfig { baseUrl: string; issuer: string; @@ -23,6 +23,10 @@ export interface ServiceConfig { }; } +axios.interceptors.response.use((response) => { + return response; +}, wafIntercept); + const useGetServiceConfig = () => { const [config, setConfig] = useState(null); const [error, setError] = useState(null); diff --git a/src/types/madie-madie-util.d.ts b/src/types/madie-madie-util.d.ts index 8fde3c9..ecc5fa2 100644 --- a/src/types/madie-madie-util.d.ts +++ b/src/types/madie-madie-util.d.ts @@ -87,6 +87,8 @@ declare module "@madie/madie-util" { draft?: boolean ): boolean; + export function wafIntercept(): void; + export const bootstrap: LifeCycleFn; export const mount: LifeCycleFn; export const unmount: LifeCycleFn; From 2d37e2b13b4290c737be6074bb705b2bb9410e02 Mon Sep 17 00:00:00 2001 From: Ethan Kaplan Date: Mon, 17 Jun 2024 13:25:33 -0700 Subject: [PATCH 2/2] npm audit fix --- package-lock.json | 54 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 11485a9..b849e5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8127,11 +8127,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -11965,9 +11965,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -21103,16 +21103,16 @@ } }, "node_modules/webpack-dev-server/node_modules/ws": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", - "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -21331,9 +21331,9 @@ } }, "node_modules/ws": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz", - "integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "dev": true, "engines": { "node": ">=8.3.0" @@ -27151,11 +27151,11 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-process-hrtime": { @@ -30063,9 +30063,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "requires": { "to-regex-range": "^5.0.1" } @@ -36601,9 +36601,9 @@ } }, "ws": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", - "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "requires": {} } @@ -36756,9 +36756,9 @@ } }, "ws": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz", - "integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "dev": true, "requires": {} },