-
Notifications
You must be signed in to change notification settings - Fork 943
New issue
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
RTDB emulator doesn't work properly with databaseAuthVariableOverride #2554
Comments
Just to add to this, I think the missing evaluations might be to do with |
I'm also tackling with similar. If you're still on this (2 years later!!!!):
I've created a request for proper documentation on how to use |
@akauppi I don't understand your points sorry. The |
@rhodgkins - have you tried running this with the latest version of firebase-admin and firebase-database-emulator? |
@maneesht yep, if you run the reproduction steps above the same thing happens. Ran |
@rhodgkins thank you for your patience. We might have identified what the problem is, however we do not have the bandwidth to support this right now. I will keep this open until we can look further into this. |
[REQUIRED] Environment info
firebase-tools: 8.7.0
Platform: macOS
node: v10.22.0
firebase-admin: 9.1.0
firebase-database-emulator: v4.5.0
[REQUIRED] Test case
Add some rules like the following:
[REQUIRED] Steps to reproduce
firebase --project blah emulators:start --only database
(can't useemulators:exec
as need to keep it running to view the rule evaluations).FIREBASE_DATABASE_EMULATOR_HOST=localhost:9000 node script.js
.http://localhost:9000/.inspect/coverage?ns=blah
[REQUIRED] Expected behavior
I'd expect the tests to pass and the
auth_time
rule to be evaluated 3 times - returningtrue
once andfalse
twice.[REQUIRED] Actual behavior
Rules are not always evaluated - seems to bail out...
To simplify the case when running:
I'd expect this rule to be evaluated (as there's no
auth.uid
):(auth.token.auth_time >= ((now / 1000) - 60 * 60) && auth.token.customClaimAccess === $userId) || data.parent().child('publicAccess').val() === true
The whole rule seems not to be evaluated, despite the first rule being evaluated...!
The text was updated successfully, but these errors were encountered: