2.7.0 • Published 1 year ago

@daaku/kombat-firestore v2.7.0

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

kombat-firestore

Kombat storage implemented using Firebase Firestore Database.

Sample rules for when Group ID is set to User ID:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    // allow exact or `uid.` prefix
    function allowGroupID(id) {
      let exact = request.auth.uid == id;
      let prefix = request.auth.uid == id.split('\\.')[0];
      return exact || prefix
    }

    // merkle is stored with same ID as user ID
    match /merkle/{document} {
      allow read: if resource == null
      allow read, write: if allowGroupID(document)
    }

    // messages are stored with group ID as user ID
    match /message_log/{document} {
      allow read: if resource == null
      allow create: if allowGroupID(request.resource.data.groupID)
      allow write: if resource == null && allowGroupID(request.resource.data.groupID)
      allow read, write: if allowGroupID(resource.data.groupID)
    }
  }
}

TODO

  • Retries
  • Pagination in runQuery
  • Splitting commit if too large
2.5.0

1 year ago

2.4.0

1 year ago

2.7.0

1 year ago

2.6.0

1 year ago

2.3.0

2 years ago

2.2.0

3 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.1.0

4 years ago

1.0.0

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago