Skip to content
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

Add Firebase Auth emulator #9

Merged
merged 5 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
GOOGLE_SERVICE_ACCOUNT_KEY='<...Firebaseプロジェクトのサービスアカウントキーの中身を直接記入>'
PUBLIC_FIREBASE_PROJECT_ID=fukada-delete-me
Copy link

@coderabbitai coderabbitai bot Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Firebase プロジェクト ID をプレースホルダーに置き換えてください。

実際のプロジェクト ID を使用すると、意図しない使用につながる可能性があります。また、"delete-me" という名前は例示用としては適切ではありません。

以下のように変更することをお勧めします:

-PUBLIC_FIREBASE_PROJECT_ID=fukada-delete-me
+PUBLIC_FIREBASE_PROJECT_ID=your-project-id
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
PUBLIC_FIREBASE_PROJECT_ID=fukada-delete-me
PUBLIC_FIREBASE_PROJECT_ID=your-project-id

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あとで、このリポジトリ自体をリセットする予定です。

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ciscorn、承知しました。それではそのまま進めますね。

(。•́︿•̀。)


✏️ Learnings added
Learnt from: ciscorn
PR: MIERUNE/sveltekit-firebase-auth-ssr#9
File: .env.example:1-1
Timestamp: 2024-09-28T00:58:56.411Z
Learning: リポジトリを後でリセットする予定の場合、`.env.example` に実際の Firebase プロジェクト ID を記載しても問題ありません。

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

PUBLIC_FIREBASE_API_KEY=AIzaSyCqkxdTAOegNHszt2gHJp8Jkss2v9IZ71c
Copy link

@coderabbitai coderabbitai bot Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

重大なセキュリティリスク:Firebase API キーを削除してください。

実際の API キーをバージョン管理システムにコミットすることは、重大なセキュリティリスクです。この API キーは直ちに無効化し、新しいキーを生成する必要があります。

以下のように変更してください:

-PUBLIC_FIREBASE_API_KEY=AIzaSyCqkxdTAOegNHszt2gHJp8Jkss2v9IZ71c
+PUBLIC_FIREBASE_API_KEY=your-api-key

また、Firebase コンソールで現在の API キーを無効化し、新しいキーを生成することを強くお勧めします。

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
PUBLIC_FIREBASE_API_KEY=AIzaSyCqkxdTAOegNHszt2gHJp8Jkss2v9IZ71c
PUBLIC_FIREBASE_API_KEY=your-api-key
🧰 Tools
🪛 Gitleaks

2-3: Uncovered a GCP API key, which could lead to unauthorized access to Google Cloud services and data breaches.

(gcp-api-key)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FirebaseのAPIキーはクライアントコードに公開される情報です。ここで強く秘匿しても意味がありません。

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ciscorn ご指摘ありがとうございます。FirebaseのAPIキーがクライアントに公開される情報であること、理解しました。今後のレビューで考慮いたします。 (・_・)ゞ


🧠 Learnings used
Learnt from: ciscorn
PR: MIERUNE/asia-turidoco-poc#141
File: .env.example:4-4
Timestamp: 2024-09-17T14:24:57.044Z
Learning: FirebaseのAPIキーはクライアントに公開されるものであり、`.env`ファイルに含めても問題ない。

PUBLIC_FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099
GOOGLE_SERVICE_ACCOUNT_KEY=
PUBLIC_STRIPE_KEY=pk_test_51Pid8OLtNIgQdVMELz3Zbod4CjWiZdG5NBpZVUfKEGr2Vc7MYEbEwSHkMpJAfKVGSQLxDXk66YVma4qi0uMkwLrV00R5lQ4ZwP
Copy link

@coderabbitai coderabbitai bot Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Stripe の公開キーをプレースホルダーに置き換えてください。

テストキーであっても、実際のキーを例示ファイルに含めることは避けるべきです。意図しない使用を防ぐため、プレースホルダーを使用することをお勧めします。

以下のように変更してください:

-PUBLIC_STRIPE_KEY=pk_test_51Pid8OLtNIgQdVMELz3Zbod4CjWiZdG5NBpZVUfKEGr2Vc7MYEbEwSHkMpJAfKVGSQLxDXk66YVma4qi0uMkwLrV00R5lQ4ZwP
+PUBLIC_STRIPE_KEY=your_stripe_public_key
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
PUBLIC_STRIPE_KEY=pk_test_51Pid8OLtNIgQdVMELz3Zbod4CjWiZdG5NBpZVUfKEGr2Vc7MYEbEwSHkMpJAfKVGSQLxDXk66YVma4qi0uMkwLrV00R5lQ4ZwP
PUBLIC_STRIPE_KEY=your_stripe_public_key

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あとで、このリポジトリ自体をリセットする予定です。

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ciscorn、了解しました。リポジトリをリセットされる予定であれば、そのままで問題ありません。

(;_;)

SECRET_STRIPE_KEY=
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ node_modules
.DS_Store
Thumbs.db

# Log
*.log

# Env
.env
.env.*
Expand Down
10 changes: 10 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"emulators": {
"auth": {
"port": 9099
},
"ui": {
"enabled": true
}
}
}
Loading