Skip to content

Commit 4dfe07f

Browse files
committed
redo firebase server component
1 parent 48e9ee2 commit 4dfe07f

15 files changed

Lines changed: 984 additions & 1117 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ find dist \
4343
! -name highs.wasm \
4444
! -name homotopy_web.js \
4545
! -name homotopy_web_bg.wasm \
46-
! -name snippets \
4746
-type f -exec rm -f {} +
4847
cp -r homotopy-web/static/* dist/
4948
ls dist

firestore.rules

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
rules_version = '2';
22
service cloud.firestore {
33
match /databases/{database}/documents {
4-
match /{document=**} {
5-
allow read, write: if false;
4+
match /users/{user} {
5+
allow create: if true;
6+
allow read, write: if request.auth.uid == user;
7+
}
8+
match /projects/{project} {
9+
allow create: if request.resource.data.uid == request.auth.uid;
10+
allow read, write: if request.auth.uid == resource.data.uid;
11+
allow read: if resource.data.public;
12+
}
13+
match /personal-rs/{user} {
14+
allow read: if true;
15+
match /projects/{project} {
16+
allow read: if resource.data.public || request.auth.uid == user;
17+
allow create: if request.auth.uid == user
18+
&& (request.resource.data.keys().hasOnly([]));
19+
allow update: if request.auth.uid == user
20+
&& (request.resource.data.diff(resource.data).affectedKeys().hasOnly(['public']));
21+
}
22+
}
23+
match /published-rs/{document=**} {
24+
allow read: if true;
625
}
726
}
827
}
28+

flake.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
{ package = gdb; }
8181
{ package = rust-analyzer; }
8282
{ package = wasm-bindgen-cli; }
83+
{ package = nodejs; }
84+
{ package = jdk; }
8385
{ package = nodePackages.firebase-tools; }
8486
]);
8587
};

functions/.eslintrc.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
module.exports = {
2-
root: true,
3-
env: {
4-
es6: true,
5-
node: true,
6-
},
7-
extends: [
8-
"eslint:recommended",
9-
"plugin:import/errors",
10-
"plugin:import/warnings",
11-
"plugin:import/typescript",
12-
"google",
13-
"plugin:@typescript-eslint/recommended",
14-
],
15-
parser: "@typescript-eslint/parser",
16-
parserOptions: {
17-
project: ["tsconfig.json", "tsconfig.dev.json"],
18-
sourceType: "module",
19-
},
20-
ignorePatterns: [
21-
"/lib/**/*", // Ignore built files.
22-
],
23-
plugins: [
24-
"@typescript-eslint",
25-
"import",
26-
],
27-
rules: {
28-
"quotes": ["error", "double"],
29-
"import/no-unresolved": 0,
30-
"indent": ["error", 4],
31-
"object-curly-spacing": ["error", "always"],
32-
},
2+
root: true,
3+
env: {
4+
es6: true,
5+
node: true,
6+
},
7+
extends: [
8+
"eslint:recommended",
9+
"plugin:import/errors",
10+
"plugin:import/warnings",
11+
"plugin:import/typescript",
12+
"google",
13+
"plugin:@typescript-eslint/recommended",
14+
],
15+
parser: "@typescript-eslint/parser",
16+
parserOptions: {
17+
project: ["tsconfig.json", "tsconfig.dev.json"],
18+
sourceType: "module",
19+
},
20+
ignorePatterns: [
21+
"/lib/**/*", // Ignore built files.
22+
],
23+
plugins: [
24+
"@typescript-eslint",
25+
"import",
26+
],
27+
rules: {
28+
"quotes": ["error", "double"],
29+
"import/no-unresolved": 0,
30+
"indent": ["error", 2],
31+
"object-curly-spacing": ["error", "always"],
32+
},
3333
};

0 commit comments

Comments
 (0)