We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Targaryen is allowing patch that should be rejected.
The following patch is invalid because a key -KwzSBcjqM_ydHz6415J is forgotten after the invites/:
-KwzSBcjqM_ydHz6415J
invites/
{ 'orgs/org1/invites/': { uid: '-KwzSBcjqM_ydHz6415J', role: 'admin', createdAt: 1508598138982 } }
The Firebase rules are:
.... "invites": { "$key2": { ".validate": "newData.hasChildren(['uid', 'role', 'createdAt']) && $key2 == newData.child('uid').val()", "uid": { ".validate": "newData.isString()" }, "role": { ".validate": "newData.isString() && (newData.val() == 'reader' || newData.val() == 'writer' || newData.val() == 'reviewer' || newData.val() == 'admin')" }, "createdAt": { ".validate": "newData.isNumber()" }, "$other": { ".validate": "false" }, ".read": "true" }, ".validate": "newData.hasChildren() && newData.parent().parent().parent().child('orgs').child($orgID).child('infos').val() != null", ".read": "root.child('orgs').child($orgID).child('members').child(auth.uid).child('role').val() == 'admin'", ".write": "newData.parent().parent().parent().child('orgs').child($orgID).child('members').child(auth.uid).child('role').val() == 'admin'" } ....
The update is accepted on Targaryen (log of data.update('/', update):
data.update('/', update)
Result { path: '/', auth: { uid: 'user3' }, type: 'patch', permitted: true, validated: true, database: Database { ... }, newDatabase: Database { ... }, newValue: { 'orgs/org1/invites/': { uid: '-KwzSBcjqM_ydHz6415J', role: 'admin', createdAt: 1508598138982 } } }
But on Firebase, the patch is rejected (as it should):
The text was updated successfully, but these errors were encountered:
I can reproduce it, and the problem seems to be with the trailing slash.
Sorry, something went wrong.
fix: handle update operation with trailing slashes
f98d2e4
fixes issue goldibex#134
@SamyPesse Should be fixed in v3.0.4.
No branches or pull requests
Targaryen is allowing patch that should be rejected.
The following patch is invalid because a key
-KwzSBcjqM_ydHz6415J
is forgotten after theinvites/
:The Firebase rules are:
The update is accepted on Targaryen (log of
data.update('/', update)
:But on Firebase, the patch is rejected (as it should):
The text was updated successfully, but these errors were encountered: