diff --git a/agent/pkg/providers/status_provider.go b/agent/pkg/providers/status_provider.go index 4e0a4d17f..dbd1d3ac9 100644 --- a/agent/pkg/providers/status_provider.go +++ b/agent/pkg/providers/status_provider.go @@ -4,18 +4,13 @@ import ( "encoding/json" "fmt" "os" - "time" - "github.com/patrickmn/go-cache" "github.com/up9inc/mizu/agent/pkg/models" "github.com/up9inc/mizu/shared" ) -const tlsLinkRetainmentTime = time.Minute * 15 - var ( - authStatus *models.AuthStatus - RecentTLSLinks = cache.New(tlsLinkRetainmentTime, tlsLinkRetainmentTime) + authStatus *models.AuthStatus ) func GetAuthStatus() (*models.AuthStatus, error) { diff --git a/ui-common/example/src/api.js b/ui-common/example/src/api.js index b5f636f80..9e873db34 100644 --- a/ui-common/example/src/api.js +++ b/ui-common/example/src/api.js @@ -54,11 +54,6 @@ export default class Api { return response.data; } - getRecentTLSLinks = async () => { - const response = await client.get("/status/recentTLSLinks"); - return response.data; - } - getOasServices = async () => { const response = await client.get("/oas"); return response.data; @@ -121,4 +116,4 @@ export function getWebsocketUrl(){ } return websocketUrl; -} \ No newline at end of file +} diff --git a/ui-common/src/components/TLSWarning/TLSWarning.sass b/ui-common/src/components/TLSWarning/TLSWarning.sass deleted file mode 100644 index 76f77b401..000000000 --- a/ui-common/src/components/TLSWarning/TLSWarning.sass +++ /dev/null @@ -1,12 +0,0 @@ -.httpsDomains - display: none - margin: 0 - padding: 0 - list-style: none - -.customWarningStyle - &:hover - overflow-y: scroll - height: 85px - .httpsDomains - display: block diff --git a/ui-common/src/components/TLSWarning/TLSWarning.tsx b/ui-common/src/components/TLSWarning/TLSWarning.tsx deleted file mode 100644 index 693fd6c33..000000000 --- a/ui-common/src/components/TLSWarning/TLSWarning.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import {Snackbar} from "@material-ui/core"; -import MuiAlert from "@material-ui/lab/Alert"; -import React, {useEffect} from "react"; -import { RecoilState, useRecoilValue } from "recoil"; -import TrafficViewerApiAtom from "../../recoil/TrafficViewerApi/atom"; -import TrafficViewerApi from "../TrafficViewer/TrafficViewerApi"; -import './TLSWarning.sass'; - -interface TLSWarningProps { - showTLSWarning: boolean - setShowTLSWarning: (show: boolean) => void - addressesWithTLS: Set - setAddressesWithTLS: (addresses: Set) => void - userDismissedTLSWarning: boolean - setUserDismissedTLSWarning: (flag: boolean) => void -} - -export const TLSWarning: React.FC = ({showTLSWarning, setShowTLSWarning, addressesWithTLS, setAddressesWithTLS, userDismissedTLSWarning, setUserDismissedTLSWarning}) => { - - const trafficViewerApi = useRecoilValue(TrafficViewerApiAtom as RecoilState) - useEffect(() => { - (async () => { - try { - const getRecentTLSLinksFunc = trafficViewerApi?.getRecentTLSLinks ? trafficViewerApi?.getRecentTLSLinks : function(){} - const recentTLSLinks = await getRecentTLSLinksFunc(); - if (recentTLSLinks?.length > 0) { - setAddressesWithTLS(new Set(recentTLSLinks)); - setShowTLSWarning(true); - } - } catch (e) { - console.error(e); - } - })(); - }, [setShowTLSWarning, setAddressesWithTLS,trafficViewerApi]); - - return ( - setUserDismissedTLSWarning(true)} severity="warning"> - Mizu is detecting TLS traffic, this type of traffic will not be displayed. - {addressesWithTLS.size > 0 && -
    {Array.from(addressesWithTLS, address =>
  • {address}
  • )}
} -
-
); -} diff --git a/ui-common/src/components/TrafficViewer/TrafficViewer.tsx b/ui-common/src/components/TrafficViewer/TrafficViewer.tsx index faf373ff6..b4a044859 100644 --- a/ui-common/src/components/TrafficViewer/TrafficViewer.tsx +++ b/ui-common/src/components/TrafficViewer/TrafficViewer.tsx @@ -14,7 +14,6 @@ import {RecoilRoot, RecoilState, useRecoilState, useRecoilValue, useSetRecoilSta import entriesAtom from "../../recoil/entries"; import focusedEntryIdAtom from "../../recoil/focusedEntryId"; import queryAtom from "../../recoil/query"; -import {TLSWarning} from "../TLSWarning/TLSWarning"; import trafficViewerApiAtom from "../../recoil/TrafficViewerApi" import TrafficViewerApi from "./TrafficViewerApi"; import {StatusBar} from "../UI/StatusBar"; @@ -77,10 +76,6 @@ export const TrafficViewer: React.FC = ({ const setLeftOffTop = useSetRecoilState(leftOffTopAtom); const scrollableRef = useRef(null); - const [showTLSWarning, setShowTLSWarning] = useState(false); - const [userDismissedTLSWarning, setUserDismissedTLSWarning] = useState(false); - const [addressesWithTLS, setAddressesWithTLS] = useState(new Set()); - const handleQueryChange = useMemo( () => debounce(async (query: string) => { @@ -286,12 +281,6 @@ export const TrafficViewer: React.FC = ({ } - ); }; diff --git a/ui-common/src/components/TrafficViewer/TrafficViewerApi.ts b/ui-common/src/components/TrafficViewer/TrafficViewerApi.ts index 5ee7c0029..b4c6de9ad 100644 --- a/ui-common/src/components/TrafficViewer/TrafficViewerApi.ts +++ b/ui-common/src/components/TrafficViewer/TrafficViewerApi.ts @@ -4,7 +4,6 @@ type TrafficViewerApi = { analyzeStatus: () => any fetchEntries: (leftOff: any, direction: number, query: any, limit: number, timeoutMs: number) => any getEntry: (entryId: any, query: string) => any - getRecentTLSLinks: () => any, webSocket: { close: () => void } diff --git a/ui/src/helpers/api.js b/ui/src/helpers/api.js index 73ff11691..44fc0e55c 100644 --- a/ui/src/helpers/api.js +++ b/ui/src/helpers/api.js @@ -62,11 +62,6 @@ export default class Api { return response.data; } - getRecentTLSLinks = async () => { - const response = await client.get("/status/recentTLSLinks"); - return response.data; - } - getAuthStatus = async () => { const response = await client.get("/status/auth"); return response.data;