google cloud platform – Firebase Realtime Database write only permission

To grant the service account the ability to write to a specific branch but not read, update, or delete anything else, you can use Firebase’s database security rules to set up the appropriate authorization. You will need to add a rule to the parent node that grants the service account write access, then add a rule to the specific branch that denies all other operations (read, update, or delete). Example :

{
  "rules": {
    "parent_node": {
      ".write": "auth.uid == 'service_account_uid'",
      ".read": false,         
    },
    "parent_node/specific_branch": {
      ".write": true,
      ".read": false,        
    }
  }
}

You can find more information about it in this blog by Julio Maren.

Read more here: Source link