From b7acc31d00822a69cf44e0952ab33d02ce7ea125 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 15:35:29 -0500 Subject: [PATCH 01/19] new branch + function fix --- client/src/components/Auth/AuthenticationResponse.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Auth/AuthenticationResponse.tsx b/client/src/components/Auth/AuthenticationResponse.tsx index e8751e7da..43b14fefc 100644 --- a/client/src/components/Auth/AuthenticationResponse.tsx +++ b/client/src/components/Auth/AuthenticationResponse.tsx @@ -51,7 +51,7 @@ const decodeCustomError = (error: CustomError) => { } //Function that handles the response depending on type -function handleResponse(response: AuthenticationResponse) { +const handleResponse = (response: AuthenticationResponse) => { if(response?.user) { return ""; } From 169993b581aecb769dc2683076dac7c7f5adcb94 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 16:13:16 -0500 Subject: [PATCH 02/19] small bug fixes --- .../Auth/AuthenticationResponse.tsx | 37 +++++++++---------- client/src/components/Auth/LoginScreen.tsx | 19 +++++++--- client/src/contexts/SocketContext.tsx | 4 +- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/client/src/components/Auth/AuthenticationResponse.tsx b/client/src/components/Auth/AuthenticationResponse.tsx index 43b14fefc..b0911c374 100644 --- a/client/src/components/Auth/AuthenticationResponse.tsx +++ b/client/src/components/Auth/AuthenticationResponse.tsx @@ -27,23 +27,20 @@ export const inValidEmailResponse = new CustomError("Invalid Email", "Please pro //Function that decodes the error code const decodeFirebaseError = (error: FirebaseError) => { - if(error.code === "auth/missing-email" || error.code === "auth/invalid-email") { - return "Please provide a valid email address"; + switch(error.code) { + case "auth/missing-email" || "auth/invalid-email": + return "Please provide a valid email address"; + case "auth/weak-password": + return "Password must be 6 characters or more"; + case "auth/missing-password": + return "Please provide a password"; + case "auth/invalid-credential": + return "The password or email is incorrect"; + case "auth/too-many-requests": + return "Too many requests, please try again later"; + default: + return "Unknown error"; } - - if(error.code === "auth/weak-password") { - return "Password must be 6 characters or more"; - } - - if(error.code === "auth/missing-password") { - return "Please provide a password"; - } - - if(error.code === "auth/invalid-credential") { - return "The password or email is incorrect"; - } - - return "Unknown error" } const decodeCustomError = (error: CustomError) => { @@ -52,22 +49,22 @@ const decodeCustomError = (error: CustomError) => { //Function that handles the response depending on type const handleResponse = (response: AuthenticationResponse) => { - if(response?.user) { + if(response?.user) { // If the user is not undefined return ""; } - if(response.error instanceof FirebaseError) { + if(response.error instanceof FirebaseError) { // If the error is a firebase error return decodeFirebaseError(response.error); } - if(response.error instanceof CustomError) { + if(response.error instanceof CustomError) { // If the error is a custom error return decodeCustomError(response.error); } return "Unknown error" } -//Something +// Authentication Message Component Props interface AuthenticationErrorMessageProps { response: AuthenticationResponse | undefined; onPress?: () => void; diff --git a/client/src/components/Auth/LoginScreen.tsx b/client/src/components/Auth/LoginScreen.tsx index 477af597c..13de78217 100644 --- a/client/src/components/Auth/LoginScreen.tsx +++ b/client/src/components/Auth/LoginScreen.tsx @@ -30,18 +30,22 @@ const LoginScreen = () => { const [invalidLogin, invalidateLogin] = React.useState(false); const onHandleSubmit = async () => { + Keyboard.dismiss(); setAuthResponse(await appSignIn(email, password)); + }; + + useEffect(() => { + setEmail(inputEmail?.toString() || ""); // On load of the page, set the email to the inputEmail if they entered it! + }, []); + + useEffect(() => { if (authResponse?.user) { router.replace("(home)/chatchannel"); } else if (authResponse?.error) { console.log(authResponse.error); invalidateLogin(true); } - }; - - useEffect(() => { - setEmail(inputEmail?.toString() || ""); // On load of the page, set the email to the inputEmail if they entered it! - }, []); + }, [authResponse]) if (!fontsLoaded && !fontError) { return null; @@ -76,7 +80,10 @@ const LoginScreen = () => { - setAuthResponse(undefined)} /> + { + setAuthResponse(undefined) + invalidateLogin(false) + }} /> diff --git a/client/src/contexts/SocketContext.tsx b/client/src/contexts/SocketContext.tsx index 73403a4b5..622b52eee 100644 --- a/client/src/contexts/SocketContext.tsx +++ b/client/src/contexts/SocketContext.tsx @@ -17,7 +17,7 @@ export const SocketProvider = ({ children }: { children: React.ReactNode }) => { useEffect(() => { let isMounted = true; - const socketIo = io(`http://${EXPO_IP}:8080`); // Hardcoded IP address + const socketIo = io(`http://${ EXPO_IP }:8080`); // Hardcoded IP address socketIo.on("connect", () => { if (isMounted) { @@ -33,7 +33,7 @@ export const SocketProvider = ({ children }: { children: React.ReactNode }) => { return () => { isMounted = false; - socket?.disconnect(); + socketIo.disconnect(); }; }, []); From f57004f0593b1ef5ebd5579d722e17383514a1c1 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 16:14:49 -0500 Subject: [PATCH 03/19] fixes pt2 --- client/src/contexts/SocketContext.tsx | 1 - client/src/services/store.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/client/src/contexts/SocketContext.tsx b/client/src/contexts/SocketContext.tsx index 622b52eee..e8428e91e 100644 --- a/client/src/contexts/SocketContext.tsx +++ b/client/src/contexts/SocketContext.tsx @@ -1,6 +1,5 @@ import React, { createContext, useContext, useEffect, useState } from "react"; import { io, Socket } from "socket.io-client"; -import * as Network from "expo-network"; import { useLocation } from "./LocationContext"; import { EXPO_IP } from "@env"; diff --git a/client/src/services/store.ts b/client/src/services/store.ts index f748dd7d7..817d338e1 100644 --- a/client/src/services/store.ts +++ b/client/src/services/store.ts @@ -1,7 +1,6 @@ import { User, createUserWithEmailAndPassword, onAuthStateChanged, signInWithEmailAndPassword, signOut } from 'firebase/auth' import { Store } from 'pullstate' -import { auth, app } from '../configs/firebaseConfig' -import { FirebaseError } from 'firebase/app'; +import { auth} from '../configs/firebaseConfig' interface AuthStoreInterface { isLoggedin: boolean, From 311db936fd43b6d32913d4f53131ecdd190f2c40 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 16:37:36 -0500 Subject: [PATCH 04/19] JWT WIP --- client/src/contexts/LocationContext.tsx | 2 +- client/src/contexts/SocketContext.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/contexts/LocationContext.tsx b/client/src/contexts/LocationContext.tsx index 4b219b3ed..3579e2266 100644 --- a/client/src/contexts/LocationContext.tsx +++ b/client/src/contexts/LocationContext.tsx @@ -60,7 +60,7 @@ export const LocationProvider = ({ } catch (error) { console.error("Error fetching location:", error); } - }, LOCATION_REFRESH_RATE); // Fetch location every 3 seconds + }, Number(LOCATION_REFRESH_RATE)); // Fetch location every 3 seconds // Cleanup function to clear interval when component unmounts return () => clearInterval(interval); diff --git a/client/src/contexts/SocketContext.tsx b/client/src/contexts/SocketContext.tsx index e8428e91e..ea665827f 100644 --- a/client/src/contexts/SocketContext.tsx +++ b/client/src/contexts/SocketContext.tsx @@ -16,7 +16,11 @@ export const SocketProvider = ({ children }: { children: React.ReactNode }) => { useEffect(() => { let isMounted = true; - const socketIo = io(`http://${ EXPO_IP }:8080`); // Hardcoded IP address + const socketIo = io(`http://${ EXPO_IP }:8080`, { + auth: { + token: "poop", + } + }); // Hardcoded IP address socketIo.on("connect", () => { if (isMounted) { From 3bc3166c4e1c52dfda59c12c5296f8826e840ab7 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 15:35:29 -0500 Subject: [PATCH 05/19] new branch + function fix --- client/src/components/Auth/AuthenticationResponse.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Auth/AuthenticationResponse.tsx b/client/src/components/Auth/AuthenticationResponse.tsx index 4e5a6c8a5..d84f0e36a 100644 --- a/client/src/components/Auth/AuthenticationResponse.tsx +++ b/client/src/components/Auth/AuthenticationResponse.tsx @@ -51,7 +51,7 @@ const decodeCustomError = (error: CustomError) => { } //Function that handles the response depending on type -function handleResponse(response: AuthenticationResponse) { +const handleResponse = (response: AuthenticationResponse) => { if(response?.user) { return ""; } From 9b93ee77b332885b27bb38a25425ceeb25d5e21e Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 16:13:16 -0500 Subject: [PATCH 06/19] small bug fixes --- .../Auth/AuthenticationResponse.tsx | 96 ++++++++++--------- client/src/components/Auth/LoginScreen.tsx | 19 ++-- client/src/contexts/SocketContext.tsx | 4 +- 3 files changed, 64 insertions(+), 55 deletions(-) diff --git a/client/src/components/Auth/AuthenticationResponse.tsx b/client/src/components/Auth/AuthenticationResponse.tsx index d84f0e36a..077790681 100644 --- a/client/src/components/Auth/AuthenticationResponse.tsx +++ b/client/src/components/Auth/AuthenticationResponse.tsx @@ -1,16 +1,18 @@ import React from "react"; -import { StyleSheet, Text, Dimensions, TouchableOpacity} from "react-native"; +import { StyleSheet, Text, Dimensions, TouchableOpacity } from "react-native"; import { FirebaseError } from "firebase/app"; import { User } from "firebase/auth"; //Type to handle Authentication Responses from firebase -export type AuthenticationResponse = { - user: User | null; - error?: undefined; -} | { - user?: undefined; - error: unknown; -} +export type AuthenticationResponse = + | { + user: User | null; + error?: undefined; + } + | { + user?: undefined; + error: unknown; + }; export class CustomError { public code: string; @@ -23,79 +25,80 @@ export class CustomError { } //Custom responses -export const inValidEmailResponse = new CustomError("Invalid Email", "Please provide a valid email address") +export const inValidEmailResponse = new CustomError( + "Invalid Email", + "Please provide a valid email address" +); //Function that decodes the error code const decodeFirebaseError = (error: FirebaseError) => { - if(error.code === "auth/missing-email" || error.code === "auth/invalid-email") { - return "Please provide a valid email address"; - } - - if(error.code === "auth/weak-password") { - return "Password must be 6 characters or more"; - } - - if(error.code === "auth/missing-password") { - return "Please provide a password"; + switch (error.code) { + case "auth/missing-email" || "auth/invalid-email": + return "Please provide a valid email address"; + case "auth/weak-password": + return "Password must be 6 characters or more"; + case "auth/missing-password": + return "Please provide a password"; + case "auth/invalid-credential": + return "The password or email is incorrect"; + case "auth/too-many-requests": + return "Too many requests, please try again later"; + default: + return "Unknown error"; } - - if(error.code === "auth/invalid-credential") { - return "The password or email is incorrect"; - } - - return "Unknown error" -} +}; const decodeCustomError = (error: CustomError) => { return error.message; -} +}; //Function that handles the response depending on type const handleResponse = (response: AuthenticationResponse) => { - if(response?.user) { + if (response?.user) { + // If the user is not undefined return ""; } - console.log(response.error) - - if(response.error instanceof FirebaseError) { + if (response.error instanceof FirebaseError) { return decodeFirebaseError(response.error); } - if(response.error instanceof CustomError) { + if (response.error instanceof CustomError) { + // If the error is a custom error return decodeCustomError(response.error); } - return "Unknown error" -} + return "Unknown error"; +}; -//Something +// Authentication Message Component Props interface AuthenticationErrorMessageProps { response: AuthenticationResponse | undefined; onPress?: () => void; } -export const AuthenticationErrorMessage: React.FC = ({ response, onPress }) => { - if( response === undefined ) { +export const AuthenticationErrorMessage: React.FC< + AuthenticationErrorMessageProps +> = ({ response, onPress }) => { + if (response === undefined) { return null; } - const errorMessage = handleResponse(response) + const errorMessage = handleResponse(response); return ( - errorMessage && - + errorMessage && ( + {errorMessage} - + + ) ); -} - +}; const styles = StyleSheet.create({ error_text: { color: "white", fontSize: Dimensions.get("window").height * 0.02, - }, error_container: { display: "flex", @@ -106,7 +109,6 @@ const styles = StyleSheet.create({ marginTop: Dimensions.get("window").height * 0.005, width: Dimensions.get("window").width * 0.8, borderRadius: 10, - padding: 10 - } + padding: 10, + }, }); - diff --git a/client/src/components/Auth/LoginScreen.tsx b/client/src/components/Auth/LoginScreen.tsx index 477af597c..13de78217 100644 --- a/client/src/components/Auth/LoginScreen.tsx +++ b/client/src/components/Auth/LoginScreen.tsx @@ -30,18 +30,22 @@ const LoginScreen = () => { const [invalidLogin, invalidateLogin] = React.useState(false); const onHandleSubmit = async () => { + Keyboard.dismiss(); setAuthResponse(await appSignIn(email, password)); + }; + + useEffect(() => { + setEmail(inputEmail?.toString() || ""); // On load of the page, set the email to the inputEmail if they entered it! + }, []); + + useEffect(() => { if (authResponse?.user) { router.replace("(home)/chatchannel"); } else if (authResponse?.error) { console.log(authResponse.error); invalidateLogin(true); } - }; - - useEffect(() => { - setEmail(inputEmail?.toString() || ""); // On load of the page, set the email to the inputEmail if they entered it! - }, []); + }, [authResponse]) if (!fontsLoaded && !fontError) { return null; @@ -76,7 +80,10 @@ const LoginScreen = () => { - setAuthResponse(undefined)} /> + { + setAuthResponse(undefined) + invalidateLogin(false) + }} /> diff --git a/client/src/contexts/SocketContext.tsx b/client/src/contexts/SocketContext.tsx index 73403a4b5..622b52eee 100644 --- a/client/src/contexts/SocketContext.tsx +++ b/client/src/contexts/SocketContext.tsx @@ -17,7 +17,7 @@ export const SocketProvider = ({ children }: { children: React.ReactNode }) => { useEffect(() => { let isMounted = true; - const socketIo = io(`http://${EXPO_IP}:8080`); // Hardcoded IP address + const socketIo = io(`http://${ EXPO_IP }:8080`); // Hardcoded IP address socketIo.on("connect", () => { if (isMounted) { @@ -33,7 +33,7 @@ export const SocketProvider = ({ children }: { children: React.ReactNode }) => { return () => { isMounted = false; - socket?.disconnect(); + socketIo.disconnect(); }; }, []); From 415723be2e30ad5353114a0b4be7555325739a75 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 16:14:49 -0500 Subject: [PATCH 07/19] fixes pt2 --- client/src/contexts/SocketContext.tsx | 1 - client/src/services/store.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/client/src/contexts/SocketContext.tsx b/client/src/contexts/SocketContext.tsx index 622b52eee..e8428e91e 100644 --- a/client/src/contexts/SocketContext.tsx +++ b/client/src/contexts/SocketContext.tsx @@ -1,6 +1,5 @@ import React, { createContext, useContext, useEffect, useState } from "react"; import { io, Socket } from "socket.io-client"; -import * as Network from "expo-network"; import { useLocation } from "./LocationContext"; import { EXPO_IP } from "@env"; diff --git a/client/src/services/store.ts b/client/src/services/store.ts index f748dd7d7..817d338e1 100644 --- a/client/src/services/store.ts +++ b/client/src/services/store.ts @@ -1,7 +1,6 @@ import { User, createUserWithEmailAndPassword, onAuthStateChanged, signInWithEmailAndPassword, signOut } from 'firebase/auth' import { Store } from 'pullstate' -import { auth, app } from '../configs/firebaseConfig' -import { FirebaseError } from 'firebase/app'; +import { auth} from '../configs/firebaseConfig' interface AuthStoreInterface { isLoggedin: boolean, From 086c8d0064aea0cea8f428ded8a648c685f4639d Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 16:37:36 -0500 Subject: [PATCH 08/19] JWT WIP --- client/src/contexts/LocationContext.tsx | 2 +- client/src/contexts/SocketContext.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/contexts/LocationContext.tsx b/client/src/contexts/LocationContext.tsx index 4b219b3ed..3579e2266 100644 --- a/client/src/contexts/LocationContext.tsx +++ b/client/src/contexts/LocationContext.tsx @@ -60,7 +60,7 @@ export const LocationProvider = ({ } catch (error) { console.error("Error fetching location:", error); } - }, LOCATION_REFRESH_RATE); // Fetch location every 3 seconds + }, Number(LOCATION_REFRESH_RATE)); // Fetch location every 3 seconds // Cleanup function to clear interval when component unmounts return () => clearInterval(interval); diff --git a/client/src/contexts/SocketContext.tsx b/client/src/contexts/SocketContext.tsx index e8428e91e..ea665827f 100644 --- a/client/src/contexts/SocketContext.tsx +++ b/client/src/contexts/SocketContext.tsx @@ -16,7 +16,11 @@ export const SocketProvider = ({ children }: { children: React.ReactNode }) => { useEffect(() => { let isMounted = true; - const socketIo = io(`http://${ EXPO_IP }:8080`); // Hardcoded IP address + const socketIo = io(`http://${ EXPO_IP }:8080`, { + auth: { + token: "poop", + } + }); // Hardcoded IP address socketIo.on("connect", () => { if (isMounted) { From 0c89eb7dc9046723399e8443de6b0dfabc47b530 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 15:35:29 -0500 Subject: [PATCH 09/19] new branch + function fix --- client/src/components/Auth/AuthenticationResponse.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Auth/AuthenticationResponse.tsx b/client/src/components/Auth/AuthenticationResponse.tsx index cb74702f5..bfb0291c7 100644 --- a/client/src/components/Auth/AuthenticationResponse.tsx +++ b/client/src/components/Auth/AuthenticationResponse.tsx @@ -51,7 +51,7 @@ const decodeCustomError = (error: CustomError) => { } //Function that handles the response depending on type -function handleResponse(response: AuthenticationResponse) { +const handleResponse = (response: AuthenticationResponse) => { if(response?.user) { return ""; } From 47629e74925ac77eb65e8ac3377ac2ce605c2d9d Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 16:13:16 -0500 Subject: [PATCH 10/19] small bug fixes --- .../Auth/AuthenticationResponse.tsx | 96 ++++++++++--------- client/src/components/Auth/LoginScreen.tsx | 19 ++-- client/src/contexts/SocketContext.tsx | 4 +- 3 files changed, 64 insertions(+), 55 deletions(-) diff --git a/client/src/components/Auth/AuthenticationResponse.tsx b/client/src/components/Auth/AuthenticationResponse.tsx index bfb0291c7..187011aa6 100644 --- a/client/src/components/Auth/AuthenticationResponse.tsx +++ b/client/src/components/Auth/AuthenticationResponse.tsx @@ -1,16 +1,18 @@ import React from "react"; -import { StyleSheet, Text, Dimensions, TouchableOpacity} from "react-native"; +import { StyleSheet, Text, Dimensions, TouchableOpacity } from "react-native"; import { FirebaseError } from "firebase/app"; import { User } from "firebase/auth"; //Type to handle Authentication Responses from firebase -export type AuthenticationResponse = { - user: User | null; - error?: undefined; -} | { - user?: undefined; - error: unknown; -} +export type AuthenticationResponse = + | { + user: User | null; + error?: undefined; + } + | { + user?: undefined; + error: unknown; + }; export class CustomError { public code: string; @@ -23,79 +25,80 @@ export class CustomError { } //Custom responses -export const inValidEmailResponse = new CustomError("Invalid Email", "Please provide a valid email address") +export const inValidEmailResponse = new CustomError( + "Invalid Email", + "Please provide a valid email address" +); //Function that decodes the error code const decodeFirebaseError = (error: FirebaseError) => { - if(error.code === "auth/missing-email" || error.code === "auth/invalid-email") { - return "Please provide a valid email address"; - } - - if(error.code === "auth/weak-password") { - return "Password must be 6 characters or more"; - } - - if(error.code === "auth/missing-password") { - return "Please provide a password"; + switch (error.code) { + case "auth/missing-email" || "auth/invalid-email": + return "Please provide a valid email address"; + case "auth/weak-password": + return "Password must be 6 characters or more"; + case "auth/missing-password": + return "Please provide a password"; + case "auth/invalid-credential": + return "The password or email is incorrect"; + case "auth/too-many-requests": + return "Too many requests, please try again later"; + default: + return "Unknown error"; } - - if(error.code === "auth/invalid-credential") { - return "The password or email is incorrect"; - } - - return "Unknown error" -} +}; const decodeCustomError = (error: CustomError) => { return error.message; -} +}; //Function that handles the response depending on type const handleResponse = (response: AuthenticationResponse) => { - if(response?.user) { + if (response?.user) { + // If the user is not undefined return ""; } - console.log(response.error) - - if(response.error instanceof FirebaseError) { + if (response.error instanceof FirebaseError) { return decodeFirebaseError(response.error); } - if(response.error instanceof CustomError) { + if (response.error instanceof CustomError) { + // If the error is a custom error return decodeCustomError(response.error); } - return "Unknown error" -} + return "Unknown error"; +}; -//Something +// Authentication Message Component Props interface AuthenticationErrorMessageProps { response: AuthenticationResponse | undefined; onPress?: () => void; } -export const AuthenticationErrorMessage: React.FC = ({ response, onPress }) => { - if( response === undefined ) { +export const AuthenticationErrorMessage: React.FC< + AuthenticationErrorMessageProps +> = ({ response, onPress }) => { + if (response === undefined) { return null; } - const errorMessage = handleResponse(response) + const errorMessage = handleResponse(response); return ( - errorMessage && - + errorMessage && ( + {errorMessage} - + + ) ); -} - +}; const styles = StyleSheet.create({ error_text: { color: "white", fontSize: Dimensions.get("window").height * 0.02, - }, error_container: { display: "flex", @@ -106,7 +109,6 @@ const styles = StyleSheet.create({ marginTop: Dimensions.get("window").height * 0.005, width: Dimensions.get("window").width * 0.9, borderRadius: 10, - padding: 10 - } + padding: 10, + }, }); - diff --git a/client/src/components/Auth/LoginScreen.tsx b/client/src/components/Auth/LoginScreen.tsx index 477af597c..13de78217 100644 --- a/client/src/components/Auth/LoginScreen.tsx +++ b/client/src/components/Auth/LoginScreen.tsx @@ -30,18 +30,22 @@ const LoginScreen = () => { const [invalidLogin, invalidateLogin] = React.useState(false); const onHandleSubmit = async () => { + Keyboard.dismiss(); setAuthResponse(await appSignIn(email, password)); + }; + + useEffect(() => { + setEmail(inputEmail?.toString() || ""); // On load of the page, set the email to the inputEmail if they entered it! + }, []); + + useEffect(() => { if (authResponse?.user) { router.replace("(home)/chatchannel"); } else if (authResponse?.error) { console.log(authResponse.error); invalidateLogin(true); } - }; - - useEffect(() => { - setEmail(inputEmail?.toString() || ""); // On load of the page, set the email to the inputEmail if they entered it! - }, []); + }, [authResponse]) if (!fontsLoaded && !fontError) { return null; @@ -76,7 +80,10 @@ const LoginScreen = () => { - setAuthResponse(undefined)} /> + { + setAuthResponse(undefined) + invalidateLogin(false) + }} /> diff --git a/client/src/contexts/SocketContext.tsx b/client/src/contexts/SocketContext.tsx index 118035845..f38c95557 100644 --- a/client/src/contexts/SocketContext.tsx +++ b/client/src/contexts/SocketContext.tsx @@ -17,7 +17,7 @@ export const SocketProvider = ({ children }: { children: React.ReactNode }) => { useEffect(() => { let isMounted = true; - const socketIo = io(`http://${EXPO_IP}:8080`); // Hardcoded IP address + const socketIo = io(`http://${ EXPO_IP }:8080`); // Hardcoded IP address socketIo.on("connect", () => { if (isMounted) { @@ -34,7 +34,7 @@ export const SocketProvider = ({ children }: { children: React.ReactNode }) => { return () => { isMounted = false; - socket?.disconnect(); + socketIo.disconnect(); }; }, []); From 206b5bfc11298fee30215781e7f9c1779f48f987 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 16:14:49 -0500 Subject: [PATCH 11/19] fixes pt2 --- client/src/contexts/SocketContext.tsx | 1 - client/src/services/store.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/client/src/contexts/SocketContext.tsx b/client/src/contexts/SocketContext.tsx index f38c95557..3ecdb1521 100644 --- a/client/src/contexts/SocketContext.tsx +++ b/client/src/contexts/SocketContext.tsx @@ -1,6 +1,5 @@ import React, { createContext, useContext, useEffect, useState } from "react"; import { io, Socket } from "socket.io-client"; -import * as Network from "expo-network"; import { useLocation } from "./LocationContext"; import { EXPO_IP } from "@env"; diff --git a/client/src/services/store.ts b/client/src/services/store.ts index f748dd7d7..817d338e1 100644 --- a/client/src/services/store.ts +++ b/client/src/services/store.ts @@ -1,7 +1,6 @@ import { User, createUserWithEmailAndPassword, onAuthStateChanged, signInWithEmailAndPassword, signOut } from 'firebase/auth' import { Store } from 'pullstate' -import { auth, app } from '../configs/firebaseConfig' -import { FirebaseError } from 'firebase/app'; +import { auth} from '../configs/firebaseConfig' interface AuthStoreInterface { isLoggedin: boolean, From 6dbcf445b97df33e6e7e1c311ccab2aecea174bc Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 16:37:36 -0500 Subject: [PATCH 12/19] JWT WIP --- client/src/contexts/LocationContext.tsx | 6 +++--- client/src/contexts/SocketContext.tsx | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/client/src/contexts/LocationContext.tsx b/client/src/contexts/LocationContext.tsx index 95150db64..6c571c9a8 100644 --- a/client/src/contexts/LocationContext.tsx +++ b/client/src/contexts/LocationContext.tsx @@ -17,9 +17,9 @@ const LocationContext = createContext(null); const getLocation = async () => { return await Location.getCurrentPositionAsync({ - accuracy: Location.Accuracy.Balanced + accuracy: Location.Accuracy.Balanced, }); // Change accuracy while testing. Could become .env variable. -} +}; export const useLocation = () => { return useContext(LocationContext); @@ -66,7 +66,7 @@ export const LocationProvider = ({ } catch (error) { console.error("Error fetching location:", error); } - }, Number(LOCATION_REFRESH_RATE)); // Send location every few seconds + }, Number(LOCATION_REFRESH_RATE)); // Fetch location every 3 seconds // Cleanup function to clear interval when component unmounts return () => clearInterval(interval); diff --git a/client/src/contexts/SocketContext.tsx b/client/src/contexts/SocketContext.tsx index 3ecdb1521..db26c2b51 100644 --- a/client/src/contexts/SocketContext.tsx +++ b/client/src/contexts/SocketContext.tsx @@ -16,7 +16,11 @@ export const SocketProvider = ({ children }: { children: React.ReactNode }) => { useEffect(() => { let isMounted = true; - const socketIo = io(`http://${ EXPO_IP }:8080`); // Hardcoded IP address + const socketIo = io(`http://${ EXPO_IP }:8080`, { + auth: { + token: "poop", + } + }); // Hardcoded IP address socketIo.on("connect", () => { if (isMounted) { From 1f0526077e508d5b2a8cb1a7b0b65c742edff0b2 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 15:35:29 -0500 Subject: [PATCH 13/19] new branch + function fix --- client/src/components/Auth/AuthenticationResponse.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/components/Auth/AuthenticationResponse.tsx b/client/src/components/Auth/AuthenticationResponse.tsx index 187011aa6..2e2371138 100644 --- a/client/src/components/Auth/AuthenticationResponse.tsx +++ b/client/src/components/Auth/AuthenticationResponse.tsx @@ -55,7 +55,6 @@ const decodeCustomError = (error: CustomError) => { //Function that handles the response depending on type const handleResponse = (response: AuthenticationResponse) => { if (response?.user) { - // If the user is not undefined return ""; } From 7c6237dde673a3b19ffe918951f1cb86ac39ae85 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Tue, 13 Feb 2024 16:13:16 -0500 Subject: [PATCH 14/19] small bug fixes --- client/src/components/Auth/AuthenticationResponse.tsx | 4 +++- client/src/contexts/SocketContext.tsx | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/components/Auth/AuthenticationResponse.tsx b/client/src/components/Auth/AuthenticationResponse.tsx index 2e2371138..081a12640 100644 --- a/client/src/components/Auth/AuthenticationResponse.tsx +++ b/client/src/components/Auth/AuthenticationResponse.tsx @@ -55,13 +55,15 @@ const decodeCustomError = (error: CustomError) => { //Function that handles the response depending on type const handleResponse = (response: AuthenticationResponse) => { if (response?.user) { + // If the user is not undefined return ""; } if (response.error instanceof FirebaseError) { + // If the error is a firebase error return decodeFirebaseError(response.error); } - + // If the error is a custom error if (response.error instanceof CustomError) { // If the error is a custom error return decodeCustomError(response.error); diff --git a/client/src/contexts/SocketContext.tsx b/client/src/contexts/SocketContext.tsx index db26c2b51..e755a92f5 100644 --- a/client/src/contexts/SocketContext.tsx +++ b/client/src/contexts/SocketContext.tsx @@ -16,10 +16,10 @@ export const SocketProvider = ({ children }: { children: React.ReactNode }) => { useEffect(() => { let isMounted = true; - const socketIo = io(`http://${ EXPO_IP }:8080`, { + const socketIo = io(`http://${EXPO_IP}:8080`, { auth: { token: "poop", - } + }, }); // Hardcoded IP address socketIo.on("connect", () => { From 293ef4e40666940d16ea42393eddd1ccd3c47512 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Fri, 16 Feb 2024 20:59:17 -0500 Subject: [PATCH 15/19] added passport --- server/package-lock.json | 159 +++++++++++++++++++++++++++++++++++++++ server/package.json | 2 + server/src/index.ts | 4 + 3 files changed, 165 insertions(+) diff --git a/server/package-lock.json b/server/package-lock.json index 52a5aafd3..819318375 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -15,6 +15,8 @@ "express": "^4.18.2", "firebase": "^10.5.0", "geofire-common": "^6.0.0", + "passport": "^0.7.0", + "passport-jwt": "^4.0.1", "socket.io": "^4.7.4", "uuid": "^9.0.1" }, @@ -3808,6 +3810,11 @@ "node-int64": "^0.4.0" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -4299,6 +4306,14 @@ "url": "https://dotenvx.com" } }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -6877,6 +6892,76 @@ "node": ">=6" } }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jsonwebtoken/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jsonwebtoken/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -6924,6 +7009,41 @@ "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", @@ -7348,6 +7468,40 @@ "node": ">= 0.8" } }, + "node_modules/passport": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/passport/-/passport-0.7.0.tgz", + "integrity": "sha512-cPLl+qZpSc+ireUvt+IzqbED1cHHkDoVYMo30jbJIdOOjQ1MQYZBPiNvmi8UM6lJuOpTPXJGZQk0DtC4y61MYQ==", + "dependencies": { + "passport-strategy": "1.x.x", + "pause": "0.0.1", + "utils-merge": "^1.0.1" + }, + "engines": { + "node": ">= 0.4.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jaredhanson" + } + }, + "node_modules/passport-jwt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/passport-jwt/-/passport-jwt-4.0.1.tgz", + "integrity": "sha512-UCKMDYhNuGOBE9/9Ycuoyh7vP6jpeTp/+sfMJl7nLff/t6dps+iaeE0hhNkKN8/HZHcJ7lCdOyDxHdDoxoSvdQ==", + "dependencies": { + "jsonwebtoken": "^9.0.0", + "passport-strategy": "^1.0.0" + } + }, + "node_modules/passport-strategy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", + "integrity": "sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -7386,6 +7540,11 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, + "node_modules/pause": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", + "integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==" + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", diff --git a/server/package.json b/server/package.json index c4dfdf3d6..bcabe0ad6 100644 --- a/server/package.json +++ b/server/package.json @@ -30,6 +30,8 @@ "express": "^4.18.2", "firebase": "^10.5.0", "geofire-common": "^6.0.0", + "passport": "^0.7.0", + "passport-jwt": "^4.0.1", "socket.io": "^4.7.4", "uuid": "^9.0.1" }, diff --git a/server/src/index.ts b/server/src/index.ts index 69e9b98f6..0a2d287cc 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -16,6 +16,10 @@ import { ConnectedUser } from './types/User'; const { createServer } = require('http') const { Server } = require('socket.io') +const passport = require('passport') +const JWTStrategy = require('passport-jwt').Strategy +const ExtractJWT = require('passport-jwt').ExtractJwt + const socket_port = process.env.socket_port const express_port = process.env.express_port From 9a11d56dcce87e6db6cf83c7212b70a6a6a9fca5 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Fri, 16 Feb 2024 23:29:36 -0500 Subject: [PATCH 16/19] started auth + admin sdk --- client/package-lock.json | 153 ++-- client/src/components/Auth/LoginScreen.tsx | 12 +- client/src/configs/firebaseConfig.ts | 8 +- client/src/contexts/SocketContext.tsx | 13 +- client/src/services/store.ts | 4 +- server/.gitignore | 3 + server/package-lock.json | 819 ++++++++++++++++++++- server/package.json | 1 + server/src/index.ts | 16 + server/src/tests/socketio.test.ts | 2 +- server/src/utilities/adminInit.ts | 9 + 11 files changed, 920 insertions(+), 120 deletions(-) create mode 100644 server/src/utilities/adminInit.ts diff --git a/client/package-lock.json b/client/package-lock.json index 720fd9652..853ac67d0 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -28,7 +28,7 @@ "firebase": "^10.7.2", "pullstate": "^1.25.0", "react": "18.2.0", - "react-native": "0.72.10", + "react-native": "0.72.6", "react-native-dotenv": "^3.4.9", "react-native-fs": "^2.20.0", "react-native-safe-area-context": "4.6.3", @@ -4641,19 +4641,19 @@ } }, "node_modules/@react-native-community/cli": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-11.3.10.tgz", - "integrity": "sha512-bIx0t5s9ewH1PlcEcuQUD+UnVrCjPGAfjhVR5Gew565X60nE+GTIHRn70nMv9G4he/amBF+Z+vf5t8SNZEWMwg==", - "dependencies": { - "@react-native-community/cli-clean": "11.3.10", - "@react-native-community/cli-config": "11.3.10", - "@react-native-community/cli-debugger-ui": "11.3.10", - "@react-native-community/cli-doctor": "11.3.10", - "@react-native-community/cli-hermes": "11.3.10", - "@react-native-community/cli-plugin-metro": "11.3.10", - "@react-native-community/cli-server-api": "11.3.10", - "@react-native-community/cli-tools": "11.3.10", - "@react-native-community/cli-types": "11.3.10", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-11.3.7.tgz", + "integrity": "sha512-Ou8eDlF+yh2rzXeCTpMPYJ2fuqsusNOhmpYPYNQJQ2h6PvaF30kPomflgRILems+EBBuggRtcT+I+1YH4o/q6w==", + "dependencies": { + "@react-native-community/cli-clean": "11.3.7", + "@react-native-community/cli-config": "11.3.7", + "@react-native-community/cli-debugger-ui": "11.3.7", + "@react-native-community/cli-doctor": "11.3.7", + "@react-native-community/cli-hermes": "11.3.7", + "@react-native-community/cli-plugin-metro": "11.3.7", + "@react-native-community/cli-server-api": "11.3.7", + "@react-native-community/cli-tools": "11.3.7", + "@react-native-community/cli-types": "11.3.7", "chalk": "^4.1.2", "commander": "^9.4.1", "execa": "^5.0.0", @@ -4671,11 +4671,11 @@ } }, "node_modules/@react-native-community/cli-clean": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-clean/-/cli-clean-11.3.10.tgz", - "integrity": "sha512-g6QjW+DSqoWRHzmIQW3AH22k1AnynWuOdy2YPwYEGgPddTeXZtJphIpEVwDOiC0L4mZv2VmiX33/cGNUwO0cIA==", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-clean/-/cli-clean-11.3.7.tgz", + "integrity": "sha512-twtsv54ohcRyWVzPXL3F9VHGb4Qhn3slqqRs3wEuRzjR7cTmV2TIO2b1VhaqF4HlCgNd+cGuirvLtK2JJyaxMg==", "dependencies": { - "@react-native-community/cli-tools": "11.3.10", + "@react-native-community/cli-tools": "11.3.7", "chalk": "^4.1.2", "execa": "^5.0.0", "prompts": "^2.4.0" @@ -4877,11 +4877,11 @@ } }, "node_modules/@react-native-community/cli-config": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-config/-/cli-config-11.3.10.tgz", - "integrity": "sha512-YYu14nm1JYLS6mDRBz78+zDdSFudLBFpPkhkOoj4LuBhNForQBIqFFHzQbd9/gcguJxfW3vlYSnudfaUI7oGLg==", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-config/-/cli-config-11.3.7.tgz", + "integrity": "sha512-FDBLku9xskS+bx0YFJFLCmUJhEZ4/MMSC9qPYOGBollWYdgE7k/TWI0IeYFmMALAnbCdKQAYP5N29N55Tad8lg==", "dependencies": { - "@react-native-community/cli-tools": "11.3.10", + "@react-native-community/cli-tools": "11.3.7", "chalk": "^4.1.2", "cosmiconfig": "^5.1.0", "deepmerge": "^4.3.0", @@ -4954,22 +4954,22 @@ } }, "node_modules/@react-native-community/cli-debugger-ui": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-11.3.10.tgz", - "integrity": "sha512-kyitGV3RsjlXIioq9lsuawha2GUBPCTAyXV6EBlm3qlyF3dMniB3twEvz+fIOid/e1ZeucH3Tzy5G3qcP8yWoA==", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-11.3.7.tgz", + "integrity": "sha512-aVmKuPKHZENR8SrflkMurZqeyLwbKieHdOvaZCh1Nn/0UC5CxWcyST2DB2XQboZwsvr3/WXKJkSUO+SZ1J9qTQ==", "dependencies": { "serve-static": "^1.13.1" } }, "node_modules/@react-native-community/cli-doctor": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-doctor/-/cli-doctor-11.3.10.tgz", - "integrity": "sha512-DpMsfCWKZ15L9nFK/SyDvpl5v6MjV+arMHMC1i8kR+DOmf2xWmp/pgMywKk0/u50yGB9GwxBHt3i/S/IMK5Ylg==", - "dependencies": { - "@react-native-community/cli-config": "11.3.10", - "@react-native-community/cli-platform-android": "11.3.10", - "@react-native-community/cli-platform-ios": "11.3.10", - "@react-native-community/cli-tools": "11.3.10", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-doctor/-/cli-doctor-11.3.7.tgz", + "integrity": "sha512-YEHUqWISOHnsl5+NM14KHelKh68Sr5/HeEZvvNdIcvcKtZic3FU7Xd1WcbNdo3gCq5JvzGFfufx02Tabh5zmrg==", + "dependencies": { + "@react-native-community/cli-config": "11.3.7", + "@react-native-community/cli-platform-android": "11.3.7", + "@react-native-community/cli-platform-ios": "11.3.7", + "@react-native-community/cli-tools": "11.3.7", "chalk": "^4.1.2", "command-exists": "^1.2.8", "envinfo": "^7.7.2", @@ -5315,12 +5315,12 @@ } }, "node_modules/@react-native-community/cli-hermes": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-hermes/-/cli-hermes-11.3.10.tgz", - "integrity": "sha512-vqINuzAlcHS9ImNwJtT43N7kfBQ7ro9A8O1Gpc5TQ0A8V36yGG8eoCHeauayklVVgMZpZL6f6mcoLLr9IOgBZQ==", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-hermes/-/cli-hermes-11.3.7.tgz", + "integrity": "sha512-chkKd8n/xeZkinRvtH6QcYA8rjNOKU3S3Lw/3Psxgx+hAYV0Gyk95qJHTalx7iu+PwjOOqqvCkJo5jCkYLkoqw==", "dependencies": { - "@react-native-community/cli-platform-android": "11.3.10", - "@react-native-community/cli-tools": "11.3.10", + "@react-native-community/cli-platform-android": "11.3.7", + "@react-native-community/cli-tools": "11.3.7", "chalk": "^4.1.2", "hermes-profile-transformer": "^0.0.6", "ip": "^1.1.5" @@ -5391,11 +5391,11 @@ } }, "node_modules/@react-native-community/cli-platform-android": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-android/-/cli-platform-android-11.3.10.tgz", - "integrity": "sha512-RGu9KuDIXnrcNkacSHj5ETTQtp/D/835L6veE2jMigO21p//gnKAjw3AVLCysGr8YXYfThF8OSOALrwNc94puQ==", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-android/-/cli-platform-android-11.3.7.tgz", + "integrity": "sha512-WGtXI/Rm178UQb8bu1TAeFC/RJvYGnbHpULXvE20GkmeJ1HIrMjkagyk6kkY3Ej25JAP2R878gv+TJ/XiRhaEg==", "dependencies": { - "@react-native-community/cli-tools": "11.3.10", + "@react-native-community/cli-tools": "11.3.7", "chalk": "^4.1.2", "execa": "^5.0.0", "glob": "^7.1.3", @@ -5598,11 +5598,11 @@ } }, "node_modules/@react-native-community/cli-platform-ios": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-ios/-/cli-platform-ios-11.3.10.tgz", - "integrity": "sha512-JjduMrBM567/j4Hvjsff77dGSLMA0+p9rr0nShlgnKPcc+0J4TDy0hgWpUceM7OG00AdDjpetAPupz0kkAh4cQ==", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-ios/-/cli-platform-ios-11.3.7.tgz", + "integrity": "sha512-Z/8rseBput49EldX7MogvN6zJlWzZ/4M97s2P+zjS09ZoBU7I0eOKLi0N9wx+95FNBvGQQ/0P62bB9UaFQH2jw==", "dependencies": { - "@react-native-community/cli-tools": "11.3.10", + "@react-native-community/cli-tools": "11.3.7", "chalk": "^4.1.2", "execa": "^5.0.0", "fast-xml-parser": "^4.0.12", @@ -5866,12 +5866,12 @@ } }, "node_modules/@react-native-community/cli-plugin-metro": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-plugin-metro/-/cli-plugin-metro-11.3.10.tgz", - "integrity": "sha512-ZYAc5Hc+QVqJgj1XFbpKnIPbSJ9xKcBnfQrRhR+jFyt2DWx85u4bbzY1GSVc/USs0UbSUXv4dqPbnmOJz52EYQ==", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-plugin-metro/-/cli-plugin-metro-11.3.7.tgz", + "integrity": "sha512-0WhgoBVGF1f9jXcuagQmtxpwpfP+2LbLZH4qMyo6OtYLWLG13n2uRep+8tdGzfNzl1bIuUTeE9yZSAdnf9LfYQ==", "dependencies": { - "@react-native-community/cli-server-api": "11.3.10", - "@react-native-community/cli-tools": "11.3.10", + "@react-native-community/cli-server-api": "11.3.7", + "@react-native-community/cli-tools": "11.3.7", "chalk": "^4.1.2", "execa": "^5.0.0", "metro": "0.76.8", @@ -6079,12 +6079,12 @@ } }, "node_modules/@react-native-community/cli-server-api": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-server-api/-/cli-server-api-11.3.10.tgz", - "integrity": "sha512-WEwHWIpqx3gA6Da+lrmq8+z78E1XbxxjBlvHAXevhjJj42N4SO417eZiiUVrFzEFVVJSUee9n9aRa0kUR+0/2w==", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-server-api/-/cli-server-api-11.3.7.tgz", + "integrity": "sha512-yoFyGdvR3HxCnU6i9vFqKmmSqFzCbnFSnJ29a+5dppgPRetN+d//O8ard/YHqHzToFnXutAFf2neONn23qcJAg==", "dependencies": { - "@react-native-community/cli-debugger-ui": "11.3.10", - "@react-native-community/cli-tools": "11.3.10", + "@react-native-community/cli-debugger-ui": "11.3.7", + "@react-native-community/cli-tools": "11.3.7", "compression": "^1.7.1", "connect": "^3.6.5", "errorhandler": "^1.5.1", @@ -6115,9 +6115,9 @@ } }, "node_modules/@react-native-community/cli-tools": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-tools/-/cli-tools-11.3.10.tgz", - "integrity": "sha512-4kCuCwVcGagSrNg9vxMNVhynwpByuC/J5UnKGEet3HuqmoDhQW15m18fJXiehA8J+u9WBvHduefy9nZxO0C06Q==", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-tools/-/cli-tools-11.3.7.tgz", + "integrity": "sha512-peyhP4TV6Ps1hk+MBHTFaIR1eI3u+OfGBvr5r0wPwo3FAJvldRinMgcB/TcCcOBXVORu7ba1XYjkubPeYcqAyA==", "dependencies": { "appdirsjs": "^1.2.4", "chalk": "^4.1.2", @@ -6326,9 +6326,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/@react-native-community/cli-types": { - "version": "11.3.10", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-types/-/cli-types-11.3.10.tgz", - "integrity": "sha512-0FHK/JE7bTn0x1y8Lk5m3RISDHIBQqWLltO2Mf7YQ6cAeKs8iNOJOeKaHJEY+ohjsOyCziw+XSC4cY57dQrwNA==", + "version": "11.3.7", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-types/-/cli-types-11.3.7.tgz", + "integrity": "sha512-OhSr/TiDQkXjL5YOs8+hvGSB+HltLn5ZI0+A3DCiMsjUgTTsYh+Z63OtyMpNjrdCEFcg0MpfdU2uxstCS6Dc5g==", "dependencies": { "joi": "^17.2.1" } @@ -9658,13 +9658,13 @@ } }, "node_modules/deprecated-react-native-prop-types": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/deprecated-react-native-prop-types/-/deprecated-react-native-prop-types-4.2.3.tgz", - "integrity": "sha512-2rLTiMKidIFFYpIVM69UnQKngLqQfL6I11Ch8wGSBftS18FUXda+o2we2950X+1dmbgps28niI3qwyH4eX3Z1g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/deprecated-react-native-prop-types/-/deprecated-react-native-prop-types-4.1.0.tgz", + "integrity": "sha512-WfepZHmRbbdTvhcolb8aOKEvQdcmTMn5tKLbqbXmkBvjFjRVWAYqsXk/DBsV8TZxws8SdGHLuHaJrHSQUPRdfw==", "dependencies": { - "@react-native/normalize-colors": "<0.73.0", - "invariant": "^2.2.4", - "prop-types": "^15.8.1" + "@react-native/normalize-colors": "*", + "invariant": "*", + "prop-types": "*" } }, "node_modules/destroy": { @@ -17536,25 +17536,24 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/react-native": { - "version": "0.72.10", - "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.72.10.tgz", - "integrity": "sha512-AjVA1+hCm2VMk3KE9Ve5IeDR3aneEhhQJmBAM9xP3i2WqqS3GksxCz8+JdB83bV6x9mBLv5qPMP71vCged3USw==", + "version": "0.72.6", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.72.6.tgz", + "integrity": "sha512-RafPY2gM7mcrFySS8TL8x+TIO3q7oAlHpzEmC7Im6pmXni6n1AuufGaVh0Narbr1daxstw7yW7T9BKW5dpVc2A==", "dependencies": { "@jest/create-cache-key-function": "^29.2.1", - "@react-native-community/cli": "11.3.10", - "@react-native-community/cli-platform-android": "11.3.10", - "@react-native-community/cli-platform-ios": "11.3.10", + "@react-native-community/cli": "11.3.7", + "@react-native-community/cli-platform-android": "11.3.7", + "@react-native-community/cli-platform-ios": "11.3.7", "@react-native/assets-registry": "^0.72.0", - "@react-native/codegen": "^0.72.8", + "@react-native/codegen": "^0.72.7", "@react-native/gradle-plugin": "^0.72.11", "@react-native/js-polyfills": "^0.72.1", "@react-native/normalize-colors": "^0.72.0", "@react-native/virtualized-lists": "^0.72.8", "abort-controller": "^3.0.0", "anser": "^1.4.9", - "ansi-regex": "^5.0.0", "base64-js": "^1.1.2", - "deprecated-react-native-prop-types": "^4.2.3", + "deprecated-react-native-prop-types": "4.1.0", "event-target-shim": "^5.0.1", "flow-enums-runtime": "^0.0.5", "invariant": "^2.2.4", diff --git a/client/src/components/Auth/LoginScreen.tsx b/client/src/components/Auth/LoginScreen.tsx index 13de78217..d6bb18018 100644 --- a/client/src/components/Auth/LoginScreen.tsx +++ b/client/src/components/Auth/LoginScreen.tsx @@ -27,17 +27,15 @@ const LoginScreen = () => { const [email, setEmail] = React.useState(""); const [password, setPassword] = React.useState(""); const [authResponse, setAuthResponse] = React.useState(); - const [invalidLogin, invalidateLogin] = React.useState(false); + const [invalidLogin, invalidateLogin] = React.useState(false); // Possbily change this? + // Sign in function with email and password const onHandleSubmit = async () => { Keyboard.dismiss(); setAuthResponse(await appSignIn(email, password)); }; - useEffect(() => { - setEmail(inputEmail?.toString() || ""); // On load of the page, set the email to the inputEmail if they entered it! - }, []); - + // Listens for the response from the sign in function useEffect(() => { if (authResponse?.user) { router.replace("(home)/chatchannel"); @@ -47,6 +45,10 @@ const LoginScreen = () => { } }, [authResponse]) + useEffect(() => { + setEmail(inputEmail?.toString() || ""); // On load of the page, set the email to the inputEmail if they entered it! + }, []); + if (!fontsLoaded && !fontError) { return null; } diff --git a/client/src/configs/firebaseConfig.ts b/client/src/configs/firebaseConfig.ts index 28f8c1b95..0468e3797 100644 --- a/client/src/configs/firebaseConfig.ts +++ b/client/src/configs/firebaseConfig.ts @@ -6,10 +6,10 @@ import {API_KEY, AUTH_DOMAIN, PROJECT_ID, STORAGE_BUCKET, MESSAGING_SENDER_ID, A const firebaseConfig = { apiKey: API_KEY || "Mock-Key", authDomain: AUTH_DOMAIN, - projectId: PROJECT_ID, - storageBucket: STORAGE_BUCKET, - messagingSenderId: MESSAGING_SENDER_ID, - appId: APP_ID, + // projectId: PROJECT_ID, + // storageBucket: STORAGE_BUCKET, + // messagingSenderId: MESSAGING_SENDER_ID, + // appId: APP_ID, }; let app; diff --git a/client/src/contexts/SocketContext.tsx b/client/src/contexts/SocketContext.tsx index e781618af..3ecdb1521 100644 --- a/client/src/contexts/SocketContext.tsx +++ b/client/src/contexts/SocketContext.tsx @@ -16,18 +16,7 @@ export const SocketProvider = ({ children }: { children: React.ReactNode }) => { useEffect(() => { let isMounted = true; -<<<<<<< HEAD - const socketIo = io(`http://${EXPO_IP}:8080`, { - auth: { - token: "poop", - }, -======= - const socketIo = io(`http://${ EXPO_IP }:8080`, { - auth: { - token: "poop", - } ->>>>>>> 64101e9768089c05c0db54dc060e093837f7ba9c - }); // Hardcoded IP address + const socketIo = io(`http://${ EXPO_IP }:8080`); // Hardcoded IP address socketIo.on("connect", () => { if (isMounted) { diff --git a/client/src/services/store.ts b/client/src/services/store.ts index 817d338e1..77536358f 100644 --- a/client/src/services/store.ts +++ b/client/src/services/store.ts @@ -1,6 +1,6 @@ import { User, createUserWithEmailAndPassword, onAuthStateChanged, signInWithEmailAndPassword, signOut } from 'firebase/auth' import { Store } from 'pullstate' -import { auth} from '../configs/firebaseConfig' +import { auth } from '../configs/firebaseConfig' interface AuthStoreInterface { isLoggedin: boolean, @@ -30,7 +30,7 @@ export const appSignIn = async (email: string, password: string) => { store.user = response?.user; store.isLoggedin = response?.user ? true : false; }); - + console.log('appSignIn', await response.user.getIdToken()); // This is the token we need to send to the server return { user: auth.currentUser }; } catch (e) { return { error: e }; diff --git a/server/.gitignore b/server/.gitignore index 59a9766a7..16f6ab416 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -132,6 +132,9 @@ dist # Build files build +# Private Key JSON +private_key/ + # Other .env build/ diff --git a/server/package-lock.json b/server/package-lock.json index 819318375..2c941b895 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -14,6 +14,7 @@ "dotenv": "^16.3.1", "express": "^4.18.2", "firebase": "^10.5.0", + "firebase-admin": "^12.0.0", "geofire-common": "^6.0.0", "passport": "^0.7.0", "passport-jwt": "^4.0.1", @@ -2299,6 +2300,101 @@ "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.10.5.tgz", "integrity": "sha512-eSkJsnhBWv5kCTSU1tSUVl9mpFu+5NXXunZc83le8GMjMlsWwQArSc7cJJ4yl+aDFY0NGLi0AjZWMn1axOrkRg==" }, + "node_modules/@google-cloud/firestore": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-7.3.0.tgz", + "integrity": "sha512-2IftQLAbCuVp0nTd3neeu+d3OYIegJpV/V9R4USQj51LzJcXPe8h8jZ7j3+svSNhJVGy6JsN0T1QqlJdMDhTwg==", + "optional": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "functional-red-black-tree": "^1.0.1", + "google-gax": "^4.0.4", + "protobufjs": "^7.2.5" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/paginator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-5.0.0.tgz", + "integrity": "sha512-87aeg6QQcEPxGCOthnpUjvw4xAZ57G7pL8FS0C4e/81fr3FjkpUpibf1s2v5XGyGhUVGF4Jfg7yEcxqn2iUw1w==", + "optional": true, + "dependencies": { + "arrify": "^2.0.0", + "extend": "^3.0.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/projectify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-4.0.0.tgz", + "integrity": "sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA==", + "optional": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/promisify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.0.0.tgz", + "integrity": "sha512-Orxzlfb9c67A15cq2JQEyVc7wEsmFBmHjZWZYQMUyJ1qivXyMwdyNOs9odi79hze+2zqdTtu1E19IM/FtqZ10g==", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.7.0.tgz", + "integrity": "sha512-EMCEY+6JiIkx7Dt8NXVGGjy1vRdSGdHkoqZoqjJw7cEBkT7ZkX0c7puedfn1MamnzW5SX4xoa2jVq5u7OWBmkQ==", + "optional": true, + "dependencies": { + "@google-cloud/paginator": "^5.0.0", + "@google-cloud/projectify": "^4.0.0", + "@google-cloud/promisify": "^4.0.0", + "abort-controller": "^3.0.0", + "async-retry": "^1.3.3", + "compressible": "^2.0.12", + "duplexify": "^4.0.0", + "ent": "^2.2.0", + "fast-xml-parser": "^4.3.0", + "gaxios": "^6.0.2", + "google-auth-library": "^9.0.0", + "mime": "^3.0.0", + "mime-types": "^2.0.8", + "p-limit": "^3.0.1", + "retry-request": "^7.0.0", + "teeny-request": "^9.0.0", + "uuid": "^8.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage/node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "optional": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@google-cloud/storage/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@grpc/grpc-js": { "version": "1.9.14", "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.14.tgz", @@ -3112,6 +3208,15 @@ "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "optional": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -3181,17 +3286,21 @@ "version": "1.19.5", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", - "dev": true, "dependencies": { "@types/connect": "*", "@types/node": "*" } }, + "node_modules/@types/caseless": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz", + "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==", + "optional": true + }, "node_modules/@types/connect": { "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", - "dev": true, "dependencies": { "@types/node": "*" } @@ -3213,7 +3322,6 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", - "dev": true, "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", @@ -3225,7 +3333,6 @@ "version": "4.17.43", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", - "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -3245,8 +3352,7 @@ "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", - "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", - "dev": true + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==" }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", @@ -3282,11 +3388,24 @@ "pretty-format": "^29.0.0" } }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.5.tgz", + "integrity": "sha512-VRLSGzik+Unrup6BsouBeHsf4d1hOEgYWTm/7Nmw1sXoN1+tRly/Gy/po3yeahnP4jfnQWWAhQAqcNfH7ngOkA==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "optional": true + }, "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", - "dev": true + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" }, "node_modules/@types/node": { "version": "20.11.17", @@ -3299,20 +3418,43 @@ "node_modules/@types/qs": { "version": "6.9.11", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", - "dev": true + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==" }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", - "dev": true + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + }, + "node_modules/@types/request": { + "version": "2.48.12", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.12.tgz", + "integrity": "sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw==", + "optional": true, + "dependencies": { + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + } + }, + "node_modules/@types/request/node_modules/form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "optional": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } }, "node_modules/@types/send": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", - "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -3322,7 +3464,6 @@ "version": "1.15.5", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", - "dev": true, "dependencies": { "@types/http-errors": "*", "@types/mime": "*", @@ -3335,6 +3476,12 @@ "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "optional": true + }, "node_modules/@types/yargs": { "version": "17.0.32", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", @@ -3356,6 +3503,18 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "optional": true, + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -3389,6 +3548,18 @@ "node": ">=0.4.0" } }, + "node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "optional": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -3457,6 +3628,24 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/async-retry": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", + "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", + "optional": true, + "dependencies": { + "retry": "0.13.1" + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -3694,6 +3883,26 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true + }, "node_modules/base64id": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", @@ -3702,6 +3911,15 @@ "node": "^4.5.0 || >= 5.9" } }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "optional": true, + "engines": { + "node": "*" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -4008,6 +4226,18 @@ "node": ">= 0.8" } }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "optional": true, + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4306,6 +4536,18 @@ "url": "https://dotenvx.com" } }, + "node_modules/duplexify": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", + "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", + "optional": true, + "dependencies": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -4350,6 +4592,15 @@ "node": ">= 0.8" } }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "optional": true, + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/engine.io": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.4.tgz", @@ -4399,6 +4650,12 @@ "node": ">= 0.6" } }, + "node_modules/ent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", + "integrity": "sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==", + "optional": true + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -4479,6 +4736,15 @@ "node": ">= 0.6" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "optional": true, + "engines": { + "node": ">=6" + } + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -4581,12 +4847,46 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "optional": true + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "optional": true + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "node_modules/fast-xml-parser": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.4.tgz", + "integrity": "sha512-utnwm92SyozgA3hhH2I8qldf2lBqm6qHOICawRNRFu1qMe3+oqr+GcXjGqTmXTMGE5T4eC03kr/rlh5C1IRdZA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "optional": true, + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/faye-websocket": { "version": "0.11.4", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", @@ -4695,6 +4995,39 @@ "@firebase/util": "1.9.4" } }, + "node_modules/firebase-admin": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-12.0.0.tgz", + "integrity": "sha512-wBrrSSsKV++/+O8E7O/C7/wL0nbG/x4Xv4yatz/+sohaZ+LsnWtYUcrd3gZutO86hLpDex7xgyrkKbgulmtVyQ==", + "dependencies": { + "@fastify/busboy": "^1.2.1", + "@firebase/database-compat": "^1.0.2", + "@firebase/database-types": "^1.0.0", + "@types/node": "^20.10.3", + "jsonwebtoken": "^9.0.0", + "jwks-rsa": "^3.0.1", + "node-forge": "^1.3.1", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + }, + "optionalDependencies": { + "@google-cloud/firestore": "^7.1.0", + "@google-cloud/storage": "^7.7.0" + } + }, + "node_modules/firebase-admin/node_modules/@fastify/busboy": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-1.2.1.tgz", + "integrity": "sha512-7PQA7EH43S0CxcOa9OeAnaeA0oQ+e/DHNPZwSQM9CQHW76jle5+OvLdibRp/Aafs9KXbLhxyjOTkRjWUbQEd3Q==", + "dependencies": { + "text-decoding": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/follow-redirects": { "version": "1.15.5", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", @@ -4771,6 +5104,40 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "optional": true + }, + "node_modules/gaxios": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.2.0.tgz", + "integrity": "sha512-H6+bHeoEAU5D6XNc6mPKeN5dLZqEDs9Gpk6I+SZBEzK5So58JVrHPmevNi35fRl1J9Y5TaeLW0kYx3pCJ1U2mQ==", + "optional": true, + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/gcp-metadata": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz", + "integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==", + "optional": true, + "dependencies": { + "gaxios": "^6.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -4873,6 +5240,80 @@ "node": ">=4" } }, + "node_modules/google-auth-library": { + "version": "9.6.3", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.6.3.tgz", + "integrity": "sha512-4CacM29MLC2eT9Cey5GDVK4Q8t+MMp8+OEdOaqD9MG6b0dOyLORaaeJMPQ7EESVgm/+z5EKYyFLxgzBJlJgyHQ==", + "optional": true, + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "^6.1.1", + "gcp-metadata": "^6.1.0", + "gtoken": "^7.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-auth-library/node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "optional": true, + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/google-auth-library/node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "optional": true, + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/google-gax": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-4.3.1.tgz", + "integrity": "sha512-qpSfslpwqToIgQ+Tf3MjWIDjYK4UFIZ0uz6nLtttlW9N1NQA4PhGf9tlGo6KDYJ4rgL2w4CjXVd0z5yeNpN/Iw==", + "optional": true, + "dependencies": { + "@grpc/grpc-js": "~1.10.0", + "@grpc/proto-loader": "^0.7.0", + "@types/long": "^4.0.0", + "abort-controller": "^3.0.0", + "duplexify": "^4.0.0", + "google-auth-library": "^9.3.0", + "node-fetch": "^2.6.1", + "object-hash": "^3.0.0", + "proto3-json-serializer": "^2.0.0", + "protobufjs": "7.2.6", + "retry-request": "^7.0.0", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax/node_modules/@grpc/grpc-js": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.1.tgz", + "integrity": "sha512-55ONqFytZExfOIjF1RjXPcVmT/jJqFzbbDqxK9jmRV4nxiYWtL9hENSW1Jfx0SdZfrvoqd44YJ/GJTqfRrawSQ==", + "optional": true, + "dependencies": { + "@grpc/proto-loader": "^0.7.8", + "@types/node": ">=12.12.47" + }, + "engines": { + "node": "^8.13.0 || >=10.10.0" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -4890,6 +5331,40 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/gtoken": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", + "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", + "optional": true, + "dependencies": { + "gaxios": "^6.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/gtoken/node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "optional": true, + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/gtoken/node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "optional": true, + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -4969,6 +5444,45 @@ "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==" }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "optional": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "optional": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -5132,7 +5646,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, + "devOptional": true, "engines": { "node": ">=8" }, @@ -6843,6 +7357,14 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/jose": { + "version": "4.15.4", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.4.tgz", + "integrity": "sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -6874,6 +7396,15 @@ "node": ">=4" } }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "optional": true, + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -6953,6 +7484,22 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/jwks-rsa": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-3.1.0.tgz", + "integrity": "sha512-v7nqlfezb9YfHHzYII3ef2a2j1XnGeSE/bK3WfumaYCqONAIstJbrEGapz4kadScZzEt7zYCN7bucj8C0Mv/Rg==", + "dependencies": { + "@types/express": "^4.17.17", + "@types/jsonwebtoken": "^9.0.2", + "debug": "^4.3.4", + "jose": "^4.14.6", + "limiter": "^1.1.5", + "lru-memoizer": "^2.2.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/jws": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", @@ -6980,6 +7527,11 @@ "node": ">=6" } }, + "node_modules/limiter": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", + "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -7003,6 +7555,11 @@ "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" + }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -7058,6 +7615,29 @@ "yallist": "^3.0.2" } }, + "node_modules/lru-memoizer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.2.0.tgz", + "integrity": "sha512-QfOZ6jNkxCcM/BkIPnFsqDhtrazLRsghi9mBwFAzol5GCvj4EkFT899Za3+QwikCg5sRX8JstioBDwOxEyzaNw==", + "dependencies": { + "lodash.clonedeep": "^4.5.0", + "lru-cache": "~4.0.0" + } + }, + "node_modules/lru-memoizer/node_modules/lru-cache": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", + "integrity": "sha512-uQw9OqphAGiZhkuPlpFGmdTU2tEuhxTourM/19qGJrxBPHAr/f8BT1a0i/lOclESnGatdJG/UCkP9kZB/Lh1iw==", + "dependencies": { + "pseudomap": "^1.0.1", + "yallist": "^2.0.0" + } + }, + "node_modules/lru-memoizer/node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" + }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -7231,6 +7811,34 @@ "node": ">= 0.6" } }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "optional": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "engines": { + "node": ">= 6.13.0" + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -7348,6 +7956,15 @@ "node": ">=0.10.0" } }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "optional": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -7371,7 +7988,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, + "devOptional": true, "dependencies": { "wrappy": "1" } @@ -7395,7 +8012,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, + "devOptional": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -7623,6 +8240,18 @@ "node": ">= 6" } }, + "node_modules/proto3-json-serializer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-2.0.1.tgz", + "integrity": "sha512-8awBvjO+FwkMd6gNoGFZyqkHZXCFd54CIYTb6De7dPaufGJ2XNW+QUNqbMr8MaAocMdb+KpsD4rxEOaTBDCffA==", + "optional": true, + "dependencies": { + "protobufjs": "^7.2.5" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/protobufjs": { "version": "7.2.6", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", @@ -7663,6 +8292,11 @@ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" + }, "node_modules/pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", @@ -7727,6 +8361,20 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -7865,6 +8513,29 @@ "node": ">=10" } }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/retry-request": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-7.0.2.tgz", + "integrity": "sha512-dUOvLMJ0/JJYEn8NrpOaGNE7X3vpI5XlZS/u0ANjqtcZVKnIxP7IgCFwrKTxENw29emmwug53awKtaMm4i9g5w==", + "optional": true, + "dependencies": { + "@types/request": "^2.48.8", + "extend": "^3.0.2", + "teeny-request": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -8184,6 +8855,30 @@ "node": ">= 0.8" } }, + "node_modules/stream-events": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", + "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", + "optional": true, + "dependencies": { + "stubs": "^3.0.0" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "optional": true + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "optional": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -8251,6 +8946,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", + "optional": true + }, + "node_modules/stubs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", + "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", + "optional": true + }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -8275,6 +8982,47 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/teeny-request": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-9.0.0.tgz", + "integrity": "sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==", + "optional": true, + "dependencies": { + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.9", + "stream-events": "^1.0.5", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/teeny-request/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/teeny-request/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -8289,6 +9037,11 @@ "node": ">=8" } }, + "node_modules/text-decoding": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-decoding/-/text-decoding-1.0.0.tgz", + "integrity": "sha512-/0TJD42KDnVwKmDK6jj3xP7E2MG7SHAOG4tyTgyUCRPdHwvkquYNLEQltmdMa3owq3TkddCVcTsoctJI8VQNKA==" + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -8336,6 +9089,12 @@ "nodetouch": "bin/nodetouch.js" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "optional": true + }, "node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", @@ -8530,6 +9289,12 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "optional": true + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -8587,6 +9352,12 @@ "makeerror": "1.0.12" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "optional": true + }, "node_modules/websocket-driver": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", @@ -8608,6 +9379,16 @@ "node": ">=0.8.0" } }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "optional": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -8673,7 +9454,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "devOptional": true }, "node_modules/write-file-atomic": { "version": "4.0.2", @@ -8769,7 +9550,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, + "devOptional": true, "engines": { "node": ">=10" }, diff --git a/server/package.json b/server/package.json index bcabe0ad6..2c43f35b0 100644 --- a/server/package.json +++ b/server/package.json @@ -29,6 +29,7 @@ "dotenv": "^16.3.1", "express": "^4.18.2", "firebase": "^10.5.0", + "firebase-admin": "^12.0.0", "geofire-common": "^6.0.0", "passport": "^0.7.0", "passport-jwt": "^4.0.1", diff --git a/server/src/index.ts b/server/src/index.ts index 0a2d287cc..32444d759 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -13,6 +13,7 @@ import { deleteConnectedUserByIndex } from './actions/deleteConnectedUser' import {geohashForLocation} from 'geofire-common'; import { findNearbyUsers } from './actions/getConnectedUsers' import { ConnectedUser } from './types/User'; +import { adminApp } from './utilities/adminInit'; const { createServer } = require('http') const { Server } = require('socket.io') @@ -20,6 +21,8 @@ const passport = require('passport') const JWTStrategy = require('passport-jwt').Strategy const ExtractJWT = require('passport-jwt').ExtractJwt +adminApp.firestore() + const socket_port = process.env.socket_port const express_port = process.env.express_port @@ -28,6 +31,19 @@ const app = express() app.use(express.json()) app.use(express.urlencoded({ extended: true })) +// == Passport JWT Strategy == +const secret = 'secret' // TODO: Replace with process.env.JWT_SECRET +passport.use(new JWTStrategy({ + jwtFromRequest: ExtractJWT.fromAuthHeaderAsBearerToken(), + jsonWebTokenOptions: { + ignoreExpiration: false, + }, + secretOrKey: secret, + algorithims: ['HS256'], +}, (jwt_payload: any, done: any) => { + +})) + // === SOCKET API === const socketServer = createServer() diff --git a/server/src/tests/socketio.test.ts b/server/src/tests/socketio.test.ts index 4efb99a8e..878ec7f79 100644 --- a/server/src/tests/socketio.test.ts +++ b/server/src/tests/socketio.test.ts @@ -33,7 +33,7 @@ const connectClients = async () => { for (let i = 0; i < NUM_CLIENTS; i++) { const client = io(`http://localhost:${socket_test_client_port}`); - await new Promise(resolve => client.on('connect', resolve)); // Why is this an error? IDK + await new Promise(resolve => client.on('connect', resolve)); // Why is this an error? IDK clients.push(client); } diff --git a/server/src/utilities/adminInit.ts b/server/src/utilities/adminInit.ts new file mode 100644 index 000000000..a262efbd6 --- /dev/null +++ b/server/src/utilities/adminInit.ts @@ -0,0 +1,9 @@ +const { initializeApp } = require('firebase-admin/app'); +const admin = require('firebase-admin'); +const serviceAccount = require("../../src/private_key/.json"); + +export const adminApp = admin.initializeApp({ + credential: admin.credential.cert(serviceAccount) +}); + +console.log("[FIREBASE-ADMIN] Firebase admin SDK synced.") \ No newline at end of file From 4b69891c2eb10ec3e1fb833cb1670d1e4eb82517 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Sat, 17 Feb 2024 20:48:40 -0500 Subject: [PATCH 17/19] removed passport --- server/package-lock.json | 41 -------------------------------- server/package.json | 2 -- server/private_keys/private.json | 13 ++++++++++ server/src/index.ts | 15 ------------ 4 files changed, 13 insertions(+), 58 deletions(-) create mode 100644 server/private_keys/private.json diff --git a/server/package-lock.json b/server/package-lock.json index 2c941b895..d8bb07258 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -16,8 +16,6 @@ "firebase": "^10.5.0", "firebase-admin": "^12.0.0", "geofire-common": "^6.0.0", - "passport": "^0.7.0", - "passport-jwt": "^4.0.1", "socket.io": "^4.7.4", "uuid": "^9.0.1" }, @@ -8085,40 +8083,6 @@ "node": ">= 0.8" } }, - "node_modules/passport": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/passport/-/passport-0.7.0.tgz", - "integrity": "sha512-cPLl+qZpSc+ireUvt+IzqbED1cHHkDoVYMo30jbJIdOOjQ1MQYZBPiNvmi8UM6lJuOpTPXJGZQk0DtC4y61MYQ==", - "dependencies": { - "passport-strategy": "1.x.x", - "pause": "0.0.1", - "utils-merge": "^1.0.1" - }, - "engines": { - "node": ">= 0.4.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jaredhanson" - } - }, - "node_modules/passport-jwt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/passport-jwt/-/passport-jwt-4.0.1.tgz", - "integrity": "sha512-UCKMDYhNuGOBE9/9Ycuoyh7vP6jpeTp/+sfMJl7nLff/t6dps+iaeE0hhNkKN8/HZHcJ7lCdOyDxHdDoxoSvdQ==", - "dependencies": { - "jsonwebtoken": "^9.0.0", - "passport-strategy": "^1.0.0" - } - }, - "node_modules/passport-strategy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", - "integrity": "sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -8157,11 +8121,6 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, - "node_modules/pause": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", - "integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==" - }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", diff --git a/server/package.json b/server/package.json index 2c43f35b0..39f4fcfb7 100644 --- a/server/package.json +++ b/server/package.json @@ -31,8 +31,6 @@ "firebase": "^10.5.0", "firebase-admin": "^12.0.0", "geofire-common": "^6.0.0", - "passport": "^0.7.0", - "passport-jwt": "^4.0.1", "socket.io": "^4.7.4", "uuid": "^9.0.1" }, diff --git a/server/private_keys/private.json b/server/private_keys/private.json new file mode 100644 index 000000000..e66a7a5fc --- /dev/null +++ b/server/private_keys/private.json @@ -0,0 +1,13 @@ +{ + "type": "service_account", + "project_id": "fir-auth-89462", + "private_key_id": "0f8a62cb00e8b6172f5d7300378aa9fb4c733651", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCv3ZSGOHWG47LO\nogbYeJ7HeDNZwbTa7RTSGO/eNXAVukKML9+1o9H5PTZftzcIYgIweHNaLTFxSHQ6\nDdqlzd+lCMd7Wayjm7KH9sF5j8fm7BVL+BYK7QshCrurE+M+ENtQtaN3FmDaytqF\n9sc5pWN4Qb5XGWxq8PolKfI2LOrTNpU/c7pxtTT3wKDfdP90bFuD963yP8opfMOn\nFcgLH9WV8l7em9Np42+lA/fD487BS40+eadn9tkpxjYECmXqZHH5p7dYJeisgig3\n02EFAJn7TGvB9Y9rwhb1kJnnYqm3go5gwD3gLnRUXD1KO+50HjdyYSb6r3uSq6Tz\nrzQbf4CfAgMBAAECggEAC1dXFaocbNIlnM0MHfehXaxdu2MSM7AS+1LfsnfFvlD1\nq66xVuMKo8UTyuu4y9HuNuFS/F9qZIDPUKhwuj04N/SvUJVsMbIqZY7p09oMLSh6\nXcd7kcF5n0GJmrMR9isGHwKnrlgDb6NMoP5Uw13sDTxIIbvM/Gnaknz4Vrq3e16w\nC/4AqI9wVu2mfH2mr2+duRgHqOBlgSESAhU9XbXeZq7/X4x4JKKBMcDnfm5LchJx\nP2JRpo4eGkDzh8yDgHFgCkrsO5/Z6l8sIH2cfBexxiSjxmjq81imv0YBbzV95kNv\nBlb0vKYBot7J2izH2eokLwwPWewvh2V5qV50qPVoKQKBgQDU1tRqC5qLQtBsYzKX\nTF5/Ghwv2bS7r0VUZyU7uFb5lOIPsRqyGmkiv4xynRDf+hucXUXTfOR4SGQJSxaF\n0BEsAr69GIykyjVe9PioBvfTilEdZtMZSAsdSnBWi0mzLh92aAFYj1P9nvZWnB+i\nsfMLpyZXmf5I8XymHmq1b/bsEwKBgQDTh1RjADw/E6d+Jz9eGJwtQU8Ue61MIPAn\nCbZPiB1Z9jJy15TlPH/c+6FmtCcTV3pdhF70EdowE6fOTg88awkflOK6Fs7cAjdk\n31RLF1e/7fVQeRilpx7usG5WtbWENesFcz6t2vRKb/8bI2GRt9TUNvQT2JK+J1TZ\njMuhaeOSxQKBgCR0W1OCg0jg+8PkxbCGYxUQCs3jUwJmhdBsDkOJUlRTPNkFM5ZX\n0bQi7NJgtpg2RW5lx2Tu2k8DzyaMVuI6fgZ0veizgLtk6vlFqiVVdDMmWLhZeUS2\nQzkUG+Om3cuz1a25KKnber5Q8M5q1TxPkFppmbadaKFjwz7MrOhAsiFDAoGAbHYD\nqw+/1If7ZhAxycnMqtfF+LbB0TtCaIHuXTFp+2rly0UHL9OprGHKDKNrNduw/qqV\nFYjh26z4aixUW6J2dx8cclankuAAD1UEH8zETcFx++Vb4fSjQ7hrm0Jo5HXRIGZL\nSVHv2Qs8P2oQ6WrdUkMrO9HczGvWcgZjk0x8SBECgYEAtsHLGZIacFLtSqLL1QuA\n9fgjRlMEUpDYyEeNqfWg1hAXj5m8QZpPUjJT1gZfHQZ1ZSXm0/ALx2gkwISKbUvW\nyi7TQVbr6l+vPTWFnGwCL0INvGDf1wTv5PoIGWvfbD8EJfHQ1ejSMgBvupl62E5n\nmsMroEceDdTbtj3z68naRYQ=\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-f0nzi@fir-auth-89462.iam.gserviceaccount.com", + "client_id": "102183968562626917121", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-f0nzi%40fir-auth-89462.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" +} diff --git a/server/src/index.ts b/server/src/index.ts index 32444d759..926864984 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -17,9 +17,6 @@ import { adminApp } from './utilities/adminInit'; const { createServer } = require('http') const { Server } = require('socket.io') -const passport = require('passport') -const JWTStrategy = require('passport-jwt').Strategy -const ExtractJWT = require('passport-jwt').ExtractJwt adminApp.firestore() @@ -31,18 +28,6 @@ const app = express() app.use(express.json()) app.use(express.urlencoded({ extended: true })) -// == Passport JWT Strategy == -const secret = 'secret' // TODO: Replace with process.env.JWT_SECRET -passport.use(new JWTStrategy({ - jwtFromRequest: ExtractJWT.fromAuthHeaderAsBearerToken(), - jsonWebTokenOptions: { - ignoreExpiration: false, - }, - secretOrKey: secret, - algorithims: ['HS256'], -}, (jwt_payload: any, done: any) => { - -})) // === SOCKET API === From b8e07de84fa5d82920bc1b8cbad9e415d9b46c15 Mon Sep 17 00:00:00 2001 From: AlexanderWangY Date: Sat, 17 Feb 2024 20:54:36 -0500 Subject: [PATCH 18/19] added private key to gitignore --- server/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/.gitignore b/server/.gitignore index 16f6ab416..81da29c6f 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -133,7 +133,7 @@ dist build # Private Key JSON -private_key/ +./private_key/* # Other .env From 8d4373775018f3d8722a12c9ba72cd8b73060424 Mon Sep 17 00:00:00 2001 From: Alexander Wang <98280966+AlexanderWangY@users.noreply.github.com> Date: Sat, 17 Feb 2024 20:55:03 -0500 Subject: [PATCH 19/19] Delete server/private_keys/private.json --- server/private_keys/private.json | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 server/private_keys/private.json diff --git a/server/private_keys/private.json b/server/private_keys/private.json deleted file mode 100644 index e66a7a5fc..000000000 --- a/server/private_keys/private.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "service_account", - "project_id": "fir-auth-89462", - "private_key_id": "0f8a62cb00e8b6172f5d7300378aa9fb4c733651", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCv3ZSGOHWG47LO\nogbYeJ7HeDNZwbTa7RTSGO/eNXAVukKML9+1o9H5PTZftzcIYgIweHNaLTFxSHQ6\nDdqlzd+lCMd7Wayjm7KH9sF5j8fm7BVL+BYK7QshCrurE+M+ENtQtaN3FmDaytqF\n9sc5pWN4Qb5XGWxq8PolKfI2LOrTNpU/c7pxtTT3wKDfdP90bFuD963yP8opfMOn\nFcgLH9WV8l7em9Np42+lA/fD487BS40+eadn9tkpxjYECmXqZHH5p7dYJeisgig3\n02EFAJn7TGvB9Y9rwhb1kJnnYqm3go5gwD3gLnRUXD1KO+50HjdyYSb6r3uSq6Tz\nrzQbf4CfAgMBAAECggEAC1dXFaocbNIlnM0MHfehXaxdu2MSM7AS+1LfsnfFvlD1\nq66xVuMKo8UTyuu4y9HuNuFS/F9qZIDPUKhwuj04N/SvUJVsMbIqZY7p09oMLSh6\nXcd7kcF5n0GJmrMR9isGHwKnrlgDb6NMoP5Uw13sDTxIIbvM/Gnaknz4Vrq3e16w\nC/4AqI9wVu2mfH2mr2+duRgHqOBlgSESAhU9XbXeZq7/X4x4JKKBMcDnfm5LchJx\nP2JRpo4eGkDzh8yDgHFgCkrsO5/Z6l8sIH2cfBexxiSjxmjq81imv0YBbzV95kNv\nBlb0vKYBot7J2izH2eokLwwPWewvh2V5qV50qPVoKQKBgQDU1tRqC5qLQtBsYzKX\nTF5/Ghwv2bS7r0VUZyU7uFb5lOIPsRqyGmkiv4xynRDf+hucXUXTfOR4SGQJSxaF\n0BEsAr69GIykyjVe9PioBvfTilEdZtMZSAsdSnBWi0mzLh92aAFYj1P9nvZWnB+i\nsfMLpyZXmf5I8XymHmq1b/bsEwKBgQDTh1RjADw/E6d+Jz9eGJwtQU8Ue61MIPAn\nCbZPiB1Z9jJy15TlPH/c+6FmtCcTV3pdhF70EdowE6fOTg88awkflOK6Fs7cAjdk\n31RLF1e/7fVQeRilpx7usG5WtbWENesFcz6t2vRKb/8bI2GRt9TUNvQT2JK+J1TZ\njMuhaeOSxQKBgCR0W1OCg0jg+8PkxbCGYxUQCs3jUwJmhdBsDkOJUlRTPNkFM5ZX\n0bQi7NJgtpg2RW5lx2Tu2k8DzyaMVuI6fgZ0veizgLtk6vlFqiVVdDMmWLhZeUS2\nQzkUG+Om3cuz1a25KKnber5Q8M5q1TxPkFppmbadaKFjwz7MrOhAsiFDAoGAbHYD\nqw+/1If7ZhAxycnMqtfF+LbB0TtCaIHuXTFp+2rly0UHL9OprGHKDKNrNduw/qqV\nFYjh26z4aixUW6J2dx8cclankuAAD1UEH8zETcFx++Vb4fSjQ7hrm0Jo5HXRIGZL\nSVHv2Qs8P2oQ6WrdUkMrO9HczGvWcgZjk0x8SBECgYEAtsHLGZIacFLtSqLL1QuA\n9fgjRlMEUpDYyEeNqfWg1hAXj5m8QZpPUjJT1gZfHQZ1ZSXm0/ALx2gkwISKbUvW\nyi7TQVbr6l+vPTWFnGwCL0INvGDf1wTv5PoIGWvfbD8EJfHQ1ejSMgBvupl62E5n\nmsMroEceDdTbtj3z68naRYQ=\n-----END PRIVATE KEY-----\n", - "client_email": "firebase-adminsdk-f0nzi@fir-auth-89462.iam.gserviceaccount.com", - "client_id": "102183968562626917121", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-f0nzi%40fir-auth-89462.iam.gserviceaccount.com", - "universe_domain": "googleapis.com" -}