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

Fix/dev 3 authentication integration #46

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "nfs-atlas-3"
}
}
19 changes: 16 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
- epic/*

jobs:
build:
test:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false

environment: test

env:
VITE_IGNORE_MSW: false
VITE_FIREBASE_KEY: ${{ secrets.VITE_FIREBASE_KEY }}

steps:
- name: Checkout code
Expand All @@ -24,8 +26,19 @@ jobs:
node-version: 20
cache: "yarn"

- name: Cache Firebase Emulator
uses: actions/cache@v4
with:
path: ~/.cache/firebase/emulators
key: ${{ runner.os }}-firebase-emulator-${{ hashFiles('**/firebase.json') }}
restore-keys: |
${{ runner.os }}-firebase-emulator-

- name: Install Firebase Emulator Suite
run: npm install -g firebase-tools

- name: Install dependencies
run: yarn

- name: Run Vitest
run: yarn vitest
run: firebase emulators:exec "yarn test"
6 changes: 6 additions & 0 deletions database.rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rules": {
".read": "auth != null",
".write": "auth != null"
}
}
24 changes: 24 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"emulators": {
"auth": {
"port": 9099
},
"firestore": {
"port": 8080
},
"ui": {
"enabled": true
},
"singleProjectMode": true,
"storage": {
"port": 9199
}
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"storage": {
"rules": "storage.rules"
}
}
1 change: 1 addition & 0 deletions firebase/auth_export/accounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"kind":"identitytoolkit#DownloadAccountResponse","users":[{"localId":"LwOhVROfZ4XoQ0gl63KIQMyjuXNN","createdAt":"1716649824003","lastLoginAt":"1716972075102","displayName":"Test User","photoUrl":"","passwordHash":"fakeHash:salt=fakeSaltjAJOjdJPCzyTaFZ6C7rl:password=password","salt":"fakeSaltjAJOjdJPCzyTaFZ6C7rl","passwordUpdatedAt":1716903404914,"providerUserInfo":[{"providerId":"password","email":"user1@example.com","federatedId":"user1@example.com","rawId":"user1@example.com","displayName":"Test User","photoUrl":""}],"validSince":"1716903404","email":"user1@example.com","emailVerified":true,"disabled":false,"lastRefreshAt":"2024-05-29T08:41:15.102Z"}]}
1 change: 1 addition & 0 deletions firebase/auth_export/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"signIn":{"allowDuplicateEmails":false},"emailPrivacyConfig":{"enableImprovedEmailPrivacy":false}}
16 changes: 16 additions & 0 deletions firebase/firebase-export-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "13.10.1",
"firestore": {
"version": "1.19.6",
"path": "firestore_export",
"metadata_file": "firestore_export/firestore_export.overall_export_metadata"
},
"auth": {
"version": "13.10.1",
"path": "auth_export"
},
"storage": {
"version": "13.10.1",
"path": "storage_export"
}
}
Binary file not shown.
7 changes: 7 additions & 0 deletions firebase/storage_export/buckets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"buckets": [
{
"id": "nfs-atlas-3.appspot.com"
}
]
}
4 changes: 4 additions & 0 deletions firestore.indexes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"indexes": [],
"fieldOverrides": []
}
9 changes: 9 additions & 0 deletions firestore.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rules_version = '2';

service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if false;
}
}
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
"@types/js-cookie": "^3.0.6",
"@uidotdev/usehooks": "^2.4.1",
"date-fns": "^3.3.1",
"js-cookie": "^3.0.5",
"firebase": "^10.12.1",
"localforage": "^1.10.0",
"match-sorter": "^6.3.4",
"msw": "^2.1.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.51.2",
Expand All @@ -36,17 +35,20 @@
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/browser": "^1.6.0",
"eslint": "^8.56.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"firebase-tools": "^13.10.0",
"jsdom": "^24.0.0",
"prettier": "3.2.5",
"tsc-alias": "^1.8.8",
"typescript": "^5.4.2",
"vite": "^5.0.8",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.2.2"
"vitest": "^1.2.2",
"webdriverio": "^8.37.0"
},
"msw": {
"workerDirectory": [
Expand Down
Loading