north-star / commit
lint
database.rules.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/database.rules.json b/database.rules.json index 923735a..4230c1a 100644 --- a/database.rules.json +++ b/database.rules.json @@ -1,17 +1,17 @@ { - "rules": { - ".read": false, - ".write": false, - "rooms": { - "$roomId": { - ".read": "auth != null && $roomId.matches(/^[a-z0-9]{8}$/)", - "participants": { - "$uid": { - ".write": "auth != null && auth.uid === $uid", - ".validate": "!newData.exists() || (newData.hasChildren(['encryptedState']) && newData.child('encryptedState').isString() && newData.child('encryptedState').val().length > 0 && !newData.child('id').exists() && !newData.child('name').exists() && !newData.child('color').exists() && !newData.child('position').exists() && !newData.child('timestamp').exists()) || (newData.hasChildren(['id','name','color','position','timestamp']) && newData.child('id').isString() && newData.child('id').val() === auth.uid && newData.child('name').isString() && newData.child('name').val().length > 0 && newData.child('name').val().length <= 32 && newData.child('color').isString() && newData.child('color').val().matches(/^#[0-9a-fA-F]{6}$/) && newData.child('position').hasChildren(['lat','lon']) && newData.child('position/lat').isNumber() && newData.child('position/lon').isNumber() && newData.child('timestamp').isNumber())" - } + "rules": { + ".read": false, + ".write": false, + "rooms": { + "$roomId": { + ".read": "auth != null && $roomId.matches(/^[a-z0-9]{8}$/)", + "participants": { + "$uid": { + ".write": "auth != null && auth.uid === $uid", + ".validate": "!newData.exists() || (newData.hasChildren(['encryptedState']) && newData.child('encryptedState').isString() && newData.child('encryptedState').val().length > 0 && !newData.child('id').exists() && !newData.child('name').exists() && !newData.child('color').exists() && !newData.child('position').exists() && !newData.child('timestamp').exists()) || (newData.hasChildren(['id','name','color','position','timestamp']) && newData.child('id').isString() && newData.child('id').val() === auth.uid && newData.child('name').isString() && newData.child('name').val().length > 0 && newData.child('name').val().length <= 32 && newData.child('color').isString() && newData.child('color').val().matches(/^#[0-9a-fA-F]{6}$/) && newData.child('position').hasChildren(['lat','lon']) && newData.child('position/lat').isNumber() && newData.child('position/lon').isNumber() && newData.child('timestamp').isNumber())" + } + } + } } - } } - } -} +} \ No newline at end of file