How do I specify read access for known paths but disable enumeration in Firebase Database?
<p>I'd like to specify rules in Firebase such that a path can only be accessed if it's known.</p>

<pre><code>/root
  /messages
    /message1
    /message2
    /message3
</code></pre>

<p>If you access /messages you can receive a permission denied (or nothing).</p>

<p>If you explicitly access /messages/message2 you get the contents.</p>

<p>Update 1: Expected behaviour (iOS)</p>

<p>FIRDatabase
  .database()
  .reference()
  .child("invitations")
  .observeEventType(.Value, withBlock: { snapshot in</p>

<p>// snapshot returns nothing or permission denied.
})</p>

<pre><code>FIRDatabase
  .database()
  .reference()
  .child("invitations/message1")
  .observeEventType(.Value, withBlock: { snapshot in

  // snapshot returns message1
})
</code></pre>