-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Hi there,
This #2979 pull request fixed one part of the problem mentioned in #2965 where the default instance in hosting is different from the default instance in firebase-admin and both of them now reference the same instance which is project-id-default-rtdb.
However, the rules in database.rule.json are still being applied to project-id instead of project-id-default-rtdb, and I don't know how to change that manually.
[REQUIRED] Environment info
firebase-tools: 9.3.0
Platform: Windows
[REQUIRED] Test case
functions/index.js
const admin = require("firebase-admin");
// After #2979, The following line will uses `http://localhost:9000?ns=project-id-default-rtdb`
admin.initializeApp();
admin.database().ref('test').set(1);database.rules.json
{
"rules": {
"test":{
".read": true
},
".read": false,
".write": false
}
}[REQUIRED] Steps to reproduce
- Run the command:
curl localhost:9000/.settings/rules.json?ns=project-id-default-rtdb -H "Authorization: Bearer owner" - The output is:
{
"rules": {
".read": true,
".write": true
}
}- Run the command:
curl localhost:9000/.settings/rules.json?ns=project-id -H "Authorization: Bearer owner" - The output is:
{
"rules": {
"test":{
".read": true
},
".read": false,
".write": false
}
}[REQUIRED] Expected behavior
Since project-id-default-rtdb is now the default instance, the database.rules.json should also be applied to project-id-default-rtdb instance instead of project-id instance.
[REQUIRED] Actual behavior
Now, database.rules.json is applied to project-id.
StevenHallLtd
Metadata
Metadata
Assignees
Labels
No labels