-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π playwright config for auth tests #22
Merged
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5188343
π playwright config for auth tests
shon-button ad28ac5
modified package.json\scripts\dev to export GOOGLE_APPLICATION_CREDENβ¦
shon-button afd6057
This commit includes the following changes:
shon-button fb3d1fa
updated readme
shon-button b83b731
updated gitignore
shon-button c361fb9
Delete .env
shon-button 4f11460
Delete .env
shon-button 24eca9a
Delete .env
shon-button 993bcd2
Updated .gitignore file to exclude specific files.
shon-button decf72e
Updated README with scripts/tests/test-gcs.sh to set the export GOOGLβ¦
shon-button d705857
resolved conflicts
YaokunLin f95ada1
fixed import path
YaokunLin 6c93684
Update .gitignore to ignore all .env except env.example
shon-button 2543b5d
π Documented resolution for scripts/tests/test-gcs.sh error [next-autβ¦
shon-button 7685f2d
Delete user.json
shon-button File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,58 @@ | ||
/node_modules | ||
.env | ||
.env.local | ||
Dockerfile | ||
.git | ||
.gitignore | ||
docker-compose* | ||
|
||
|
||
# files form git-ignore | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
|
||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
|
||
/coverage | ||
|
||
# next.js | ||
|
||
/.next/ | ||
/out/ | ||
|
||
# production | ||
|
||
/build | ||
/dist | ||
|
||
# misc | ||
|
||
.DS_Store | ||
*.pem | ||
\*.pem | ||
|
||
# debug | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
|
||
.env*.local | ||
.env.* | ||
|
||
# vercel | ||
|
||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
|
||
\*.tsbuildinfo | ||
next-env.d.ts | ||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
|
||
# keycloak | ||
|
||
keycloak-sa-credential.json | ||
|
||
# gcp | ||
|
||
/credentials/service-account-key.json | ||
\nplaywright/.auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
API_HOST=http://localhost:3000/ | ||
DATABASE=eed | ||
DATABASE_HOST=34.125.92.26 | ||
DATABASE_PORT=5432 | ||
DATABASE_PROTOCOL=postgres | ||
DATABASE_SCHEMA_ADMIN=eed | ||
DATABASE_SCHEMA_CLEAN=data_clean_room | ||
DATABASE_SCHEMA_WORKSPACE=data_science_workspace | ||
DATABASE_SCHEMA_VAULT=published_vault | ||
DATABASE_USER_ADMIN=eed_internal | ||
DATABASE_USER_PW_ADMIN=secret | ||
DATABASE_USER_ANALYST=eed_internal | ||
DATABASE_USER_PW_ANALYST=secret | ||
DATABASE_USER_DROPPER=eed_internal | ||
DATABASE_USER_PW_DROPPER=secret | ||
DATABASE_USER_MANAGER=eed_internal | ||
DATABASE_USER_PW_MANAGER=secret | ||
DATABASE_INSTANCE_CONNECTION_NAME=emissions-elt-demo:us-west4:eed | ||
DB_USERNAME=keycloak_actor | ||
DB_PASSWORD=keycloak_pass | ||
GITHUB_ID=291382f53280c6de8f4d | ||
GITHUB_SECRET=aaa22549c1066fbf1138505fa03a28e03ab045b8 | ||
GOOGLE_BUCKET_NAME=eed_upload_file_storage | ||
GOOGLE_CLIENT_ID=77682378143-061racvi899q8vvgmcioqhbnu8pokm9o.apps.googleusercontent.com | ||
GOOGLE_CLIENT_SECRET=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 | ||
GOOGLE_PROJECT_NAME="emissions-elt-demo" | ||
NEXTAUTH_URL=http://localhost:3000 | ||
NEXTAUTH_SECRET=ozloLCYWDJNdMl5nh91QNdSj3qMWwpRk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"typescript.tsdk": "node_modules\\.pnpm\\typescript@4.9.4\\node_modules\\typescript\\lib", | ||
"typescript.enablePromptUseWorkspaceTsdk": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import Anonymized from "@/components/routes/anonymized/Anonymized"; | ||
|
||
export default function Page() { | ||
// ποΈ graphQL query endpoint for this role | ||
const endpoint = "api/analyst/graphql"; | ||
return ( | ||
<> | ||
{/* @ts-expect-error Server Component */} | ||
<Anonymized endpoint={endpoint}></Anonymized> | ||
<Anonymized></Anonymized> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import ImportedArea from "@/components/routes/imported/id/Area"; | ||
|
||
export default function Page({ | ||
params, | ||
}: { | ||
params: { | ||
id: string; | ||
}; | ||
}) { | ||
return ( | ||
<> | ||
{/* @ts-expect-error Server Component */} | ||
<ImportedArea id={params.id}></ImportedArea> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import Imported from "@/components/routes/imported/Imported"; | ||
|
||
export default function Page() { | ||
// ποΈ graphQL query endpoint for this role | ||
const endpoint = "api/analyst/graphql"; | ||
return ( | ||
<> | ||
{/* @ts-expect-error Server Component */} | ||
<Imported endpoint={endpoint}></Imported> | ||
<Imported></Imported> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,12 @@ | ||
"use client"; | ||
import { getProviders, signIn, ClientSafeProvider } from "next-auth/react"; | ||
import React, { useEffect, useState } from "react"; | ||
import styles from "./styles.module.css"; | ||
import { useTranslation } from "@/i18n/client"; | ||
import dynamic from "next/dynamic"; | ||
//ποΈ will not be rendered on the server, prevents error: Text content did not match. Server | ||
const Tag = dynamic(() => import("@/components/layout/Tag"), { | ||
const SignIn = dynamic(() => import("@/components/auth/SignIn"), { | ||
ssr: false, | ||
}); | ||
export default function Page() { | ||
const { t } = useTranslation("translation"); | ||
const [data, setData] = useState<Record<string, ClientSafeProvider> | null>( | ||
null | ||
); | ||
|
||
// ποΈ code running on the client-side should be placed inside a useEffect hook with the appropriate condition to ensure it only runs in the browser | ||
useEffect(() => { | ||
// ποΈ call to next-auth providers list | ||
const fetchData = async () => { | ||
const providers = await getProviders(); | ||
setData(providers); | ||
}; | ||
|
||
fetchData(); | ||
}, []); | ||
|
||
// ποΈ render the providers as login buttons with the correct calback url | ||
let hostUrl; | ||
if (typeof window !== "undefined") { | ||
hostUrl = window.location.origin; | ||
} | ||
// ποΈ nextauth signin calback url | ||
const callbackUrl = | ||
hostUrl && hostUrl.includes("http://localhost:4503") | ||
? "http://localhost:3000" | ||
: process.env.NEXTAUTH_URL || "http://localhost:3000"; | ||
|
||
// ποΈ nextauth provider signin | ||
const handleSignIn = async (providerId: string) => { | ||
await signIn(providerId, { | ||
callbackUrl, | ||
}); | ||
}; | ||
|
||
const content = data | ||
? Object.values(data).map((provider: ClientSafeProvider) => ( | ||
<div key={provider.id} className={styles.provider}> | ||
<button | ||
className={styles.button} | ||
onClick={() => handleSignIn(provider.id)} | ||
> | ||
<img | ||
alt={provider.name} | ||
src={`https://authjs.dev/img/providers/${provider.id}.svg`} | ||
/> | ||
<span> | ||
{t("auth.signin")} {provider.name} | ||
</span> | ||
</button> | ||
</div> | ||
)) | ||
: null; | ||
|
||
return ( | ||
<> | ||
<Tag tag={"auth.tag"} crumbs={[]}></Tag> | ||
{content} | ||
<SignIn /> | ||
</> | ||
); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to fix the .gitignore to hide this file?