{"id":21017534,"url":"https://github.com/rootz491/connect-491","last_synced_at":"2026-03-17T21:05:50.970Z","repository":{"id":119738840,"uuid":"303376627","full_name":"rootz491/connect-491","owner":"rootz491","description":"maybe a serious web app for social media. ","archived":false,"fork":false,"pushed_at":"2020-10-21T15:08:22.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-31T12:23:37.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://connect-491.web.app","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootz491.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-10-12T11:55:30.000Z","updated_at":"2023-04-11T15:32:29.000Z","dependencies_parsed_at":"2023-07-18T01:15:16.884Z","dependency_job_id":null,"html_url":"https://github.com/rootz491/connect-491","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rootz491/connect-491","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootz491%2Fconnect-491","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootz491%2Fconnect-491/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootz491%2Fconnect-491/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootz491%2Fconnect-491/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootz491","download_url":"https://codeload.github.com/rootz491/connect-491/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootz491%2Fconnect-491/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30631441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T10:19:45.463Z","updated_at":"2026-03-17T21:05:50.966Z","avatar_url":"https://github.com/rootz491.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FIREBASE \n\n## security rules\n    \u003e   .read       describes if and when data is allowed to be read by users.\n    \u003e   .write      describes if and when data is allowed to be written.\n    \u003e   .validate   defines what a correctly formatted value will look like, whether it has child attributes, and the data type.\n    \u003e   .indexOn    specifies a child index to support ordering and querying.\n\n    *to validate write by autherisation*\n    \"user\" {\n        \"$uid\": {\n            \".write\": \"$uid === auth.uid\"\n        }\n    }\n\n    *incoming data validation*\n    \"post\": {\n        \".validate\": \"newData.isString() \u0026\u0026 newData.val().length \u003c 100\"\n    }\n\n    *defining database indexes*\n    \"user\": {\n        \"indexOn\": [\"userName\", \"age\", \"rank\"]\n    }\n\n    *structuring security rules*\n    \"parent\": {\n        \"child\": {\n            \".read\": \u003ccondition\u003e,\n            \".write\": \u003ccondition\u003e,\n            \".validate\": \u003cconditon\u003e\n        }\n    }\n\n    *wildcard capture variables*\n    \"posts\": {\n        \"$pid\": {\n            \"comments\": {\n                \".write\": \"$pid.contains('public')\"\n            }\n        }\n    }\n\n    *Any write that would result in additional children being created would fail*\n    \"user\": {\n        \"$uid\": {\n            \"name\": {\".validate\": \u003ccondition\u003e},\n            \"age\": {\".validate\": \u003ccondition\u003e},\n            \"role\": {\".validate\": \u003ccondition\u003e},\n            \"$other\": {\".validate\": false}\n        }\n    }\n\n    \u003e   a path is always string, so can't compare it with number.\n        so bypass:\n        $key === newData.val+()     will work just fine.\n\n    *this is a delete or a create, but not an update*\n    \".write\": \"!data.exists() || !newData.exists()\"\n\n    *reference data in other path*\n    \u003e   root, data, newData.\n\n    *EXAMPLE*\n    \".write\": \"root.child('allow_writes').val() === true \u0026\u0026\n          !data.parent().child('readOnly').exists() \u0026\u0026\n          newData.child('foo').exists()\"\n\n    *EXAMPLE RULES OVERVIEW*\n    {\n      \"rules\": {\n        // write is allowed for all paths\n        \".write\": true,\n        \"widget\": {\n          // a valid widget must have attributes \"color\" and \"size\"\n          // allows deleting widgets (since .validate is not applied to delete rules)\n          \".validate\": \"newData.hasChildren(['color', 'size'])\",\n          \"size\": {\n            // the value of \"size\" must be a number between 0 and 99\n            \".validate\": \"newData.isNumber() \u0026\u0026\n                          newData.val() \u003e= 0 \u0026\u0026\n                          newData.val() \u003c= 99\"\n          },\n          \"color\": {\n            // the value of \"color\" must exist as a key in our mythical\n            // /valid_colors/ index\n            \".validate\": \"root.child('valid_colors/' + newData.val()).exists()\"\n          }\n        }\n      }\n}","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootz491%2Fconnect-491","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootz491%2Fconnect-491","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootz491%2Fconnect-491/lists"}