From ce5fb0067b9776676e06b3bfe3f5aa13af1e11ad Mon Sep 17 00:00:00 2001 From: Kiahna Tucker Date: Tue, 8 Oct 2024 10:32:52 -0400 Subject: [PATCH 1/3] Remove env variable-related DPG assets --- .env | 2 -- .env.development.local | 2 -- .env.test | 1 - src/utils/env-utils.ts | 13 ------------- 4 files changed, 18 deletions(-) diff --git a/.env b/.env index ff4ffe82e..a1bb5da80 100644 --- a/.env +++ b/.env @@ -7,8 +7,6 @@ PORT=3000 VITE_SUPABASE_URL=https://eyrcnmuzzyriypdajwdk.supabase.co VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImV5cmNubXV6enlyaXlwZGFqd2RrIiwicm9sZSI6ImFub24iLCJpYXQiOjE2NDg3NTA1NzksImV4cCI6MTk2NDMyNjU3OX0.y1OyXD3-DYMz10eGxzo1eeamVMMUwIIeOoMryTRAoco -VITE_GATEWAY_AUTH_TOKEN_URL=https://eyrcnmuzzyriypdajwdk.supabase.co/rest/v1/rpc/gateway_auth_token - VITE_TASK_AUTHORIZATION_URL=https://agent-api-1084703453822.us-central1.run.app/authorize/user/task VITE_COLLECTION_AUTHORIZATION_URL=https://agent-api-1084703453822.us-central1.run.app/authorize/user/collection diff --git a/.env.development.local b/.env.development.local index be2c8e825..2158b107f 100644 --- a/.env.development.local +++ b/.env.development.local @@ -8,8 +8,6 @@ VITE_SUPABASE_URL=http://localhost:5431 # Supabase CLI v1.40 VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0 -VITE_GATEWAY_AUTH_TOKEN_URL=http://localhost:5431/rest/v1/rpc/gateway_auth_token - VITE_TASK_AUTHORIZATION_URL=http://localhost:8675/authorize/user/task VITE_COLLECTION_AUTHORIZATION_URL=http://localhost:8675/authorize/user/collection diff --git a/.env.test b/.env.test index c6c601b38..f72d3857c 100644 --- a/.env.test +++ b/.env.test @@ -2,4 +2,3 @@ VITE_SUPABASE_ANON_KEY=__test_mode__supabaseAnonKey VITE_SUPABASE_URL=http://example.com/supabase VITE_ENCRYPTION_URL=http://example.com/encryption VITE_MARKETPLACE_VERIFY_URL=http://example.com/marketplaceVerify -VITE_GATEWAY_AUTH_TOKEN_URL=http://example.com/gatewayAuthToken \ No newline at end of file diff --git a/src/utils/env-utils.ts b/src/utils/env-utils.ts index 543bde572..55d54ddfa 100644 --- a/src/utils/env-utils.ts +++ b/src/utils/env-utils.ts @@ -149,19 +149,6 @@ export const getMarketplaceSettings = () => { } }; -export const getGatewayAuthTokenSettings = () => { - const gatewayAuthTokenEndpoint = import.meta.env - .VITE_GATEWAY_AUTH_TOKEN_URL; - - if (gatewayAuthTokenEndpoint) { - return { gatewayAuthTokenEndpoint }; - } else { - throw new Error( - 'Missing endpoint for creating gateway auth tokens: VITE_GATEWAY_AUTH_TOKEN_URL' - ); - } -}; - export const getTaskAuthorizationSettings = () => { const taskAuthorizationEndpoint = import.meta.env .VITE_TASK_AUTHORIZATION_URL; From f82c1a4f603724f6455f3d1cfb7bbd9a84a3cc27 Mon Sep 17 00:00:00 2001 From: Kiahna Tucker Date: Tue, 8 Oct 2024 10:38:06 -0400 Subject: [PATCH 2/3] Remove schema inference helper --- src/services/schema-inference.ts | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/services/schema-inference.ts diff --git a/src/services/schema-inference.ts b/src/services/schema-inference.ts deleted file mode 100644 index 9dc0c3f12..000000000 --- a/src/services/schema-inference.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { client } from 'services/client'; -import { GatewayAuthTokenResponse, Schema } from 'types'; - -export interface InferSchemaResponse { - documents_read: number; - exceeded_deadline: boolean; - schema: Schema; -} - -const getInferredSchema = ( - gatewayConfig: GatewayAuthTokenResponse, - collection: string -): Promise => { - const { gateway_url, token } = gatewayConfig; - - const headers: HeadersInit = {}; - - headers.Authorization = `Bearer ${token}`; - headers['Content-Type'] = 'application/json'; - - return client(`${gateway_url}infer_schema?collection=${collection}`, { - headers, - }); -}; - -export default getInferredSchema; From 7ecda4e837a41434d3f067ea8f8f1761df41bab6 Mon Sep 17 00:00:00 2001 From: Kiahna Tucker Date: Tue, 8 Oct 2024 10:39:12 -0400 Subject: [PATCH 3/3] Remove gateway auth token response interface --- src/types/index.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/types/index.ts b/src/types/index.ts index 66fe89cb5..8e64b5943 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -299,11 +299,6 @@ export interface LiveSpecsExtBaseQuery extends LiveSpecsExtBareMinimum { spec: any; } -export interface GatewayAuthTokenResponse { - gateway_url: URL; - token: string; -} - export interface MarketPlaceVerifyResponse { data: any; error: any;