Overview
Our current Firebase Realtime Database contains data for various resources. We need to ensure that the data remains in the correct format by creating and configuring Firebase Security Rules. Due to a lack of JavaScript experience, we need assistance in configuring these rules to their full capacity for better control and safety of our database queries.
Task
We need a developer experienced in Firebase Security Rules to create rules for our Firebase Realtime Database, using the provided JSON data and example rules as a starting point.
Experience with Firebase Security Rules and JavaScript.
Familiarity with Firebase Realtime Database.
Ability to design and implement data validation using Firebase Security Rules.
Steps to complete this task
Review the provided JSON data and example Firebase Security Rules.
Create the Firebase Security Rules using the JSON data and example rules as a guide.
Test the rules against the current Firebase Realtime Database to ensure they work as expected.
Submit the final Firebase Security Rules.
Please provide an estimate of the time needed to complete this task and any other information you might need to get started. Your assistance in configuring these security rules will help us maintain better control over our database and improve its security.
Since Phlask 2.0 is looking to be released within the next month we are escalating this issue to high priority and this should be handled by Tuesday 4/17 during or before the Phlask Hack Night
Overview Our current Firebase Realtime Database contains data for various resources. We need to ensure that the data remains in the correct format by creating and configuring Firebase Security Rules. Due to a lack of JavaScript experience, we need assistance in configuring these rules to their full capacity for better control and safety of our database queries.
Task We need a developer experienced in Firebase Security Rules to create rules for our Firebase Realtime Database, using the provided JSON data and example rules as a starting point.
The JSON data we want to validate is as follows:
{"1": {"access": "Public", "address": "1020 Lombard St.", "city": "Philadelphia", "description": "Drinking fountain located within the Recreation Center building; subject to recreation center hours", "filtration": "No", "gp_id": "ChIJocPgsybGxokR3QyYHHmQ118", "handicap": "Unsure", "hours": [{"close": {"day": 0, "time": "2100"}, "open": {"day": 0, "time": "0700"}}, {"close": {"day": 1, "time": "2200"}, "open": {"day": 1, "time": "0700"}}, {"close": {"day": 2, "time": "2200"}, "open": {"day": 2, "time": "0700"}}, {"close": {"day": 3, "time": "2200"}, "open": {"day": 3, "time": "0700"}}, {"close": {"day": 4, "time": "2200"}, "open": {"day": 4, "time": "0700"}}, {"close": {"day": 5, "time": "2200"}, "open": {"day": 5, "time": "0700"}}, {"close": {"day": 6, "time": "2100"}, "open": {"day": 6, "time": "0700"}}], "lat": 39.943787, "lon": -75.159048, "norms_rules": "", "organization": "Seger Recreation Center", "permanently_closed": false, "phone": "(215) 686-1780", "quality": "1-4 Missing - Good", "service": "Self-serve", "statement": "", "status": "OPERATIONAL", "tap_type": "Drinking Fountain", "tapnum": 1, "vessel": "No", "zip_code": ""}}
And here's a possible example of how the Firebase rules for this could look like:
{ "rules": { "$id": { "access": { ".validate": "newData.isString()" }, "address": { ".validate": "newData.isString()" }, "city": { ".validate": "newData.isString()" }, "description": { ".validate": "newData.isString()" }, "filtration": { ".validate": "newData.isString()" }, "gp_id": { ".validate": "newData.isString()" }, "handicap": { ".validate": "newData.isString()" }, "hours": { ".validate": "newData.hasChildren(['close', 'open'])", "close": { ".validate": "newData.hasChildren(['day', 'time'])", "day": { ".validate": "newData.isNumber() && newData.val() >= 0 && newData.val() <= 6" }, "time": { ".validate": "newData.isString() && newData.val().matches(/^(0[0-9]|1[0-9]|2[0-3])[0-5][0-9]$/)" }, "$other": { ".validate": false } }, "open": { ".validate": "newData.hasChildren(['day', 'time'])", "day": { ".validate": "newData.isNumber() && newData.val() >= 0 && newData.val() <= 6" }, "time": { ".validate": "newData.isString() && newData.val().matches(/^(0[0-9]|1[0-9]|2[0-3])[0-5][0-9]$/)" }, "$other": { ".validate": false } }, "$other": { ".validate": false } }, "lat": { ".validate": "newData.isNumber()" }, "lon": { ".validate": "newData.isNumber()" }, "norms_rules": { ".validate": "newData.isString()" }, "organization": { ".validate": "newData.isString()" }, "permanently_closed": { ".validate": "newData.isBoolean()" }, "phone": { ".validate": "newData.isString()" }, "quality": { ".validate": "newData.isString()" }, "service": { ".validate": "newData.isString()" }, "statement": { ".validate": "newData.isString()" }, "status": { ".validate": "newData.isString()" }, "tap_type": { ".validate": "newData.isString()" }, "tapnum": { ".validate": "newData.isNumber()" }, "vessel": { ".validate": "newData.isString()" }, "zip_code": { ".validate": "newData.isString()" } } } }
RequirementsSteps to complete this task
Please provide an estimate of the time needed to complete this task and any other information you might need to get started. Your assistance in configuring these security rules will help us maintain better control over our database and improve its security.