my-phonebook_v1.0.6
Summary
April 16, 2023
- Export contacts API endpoint on
/api/contacts/export
, #14- Exports contacts to a CSV file
- Exports contacts to a PDF file
- API documentation and example usage is available on the dev api docs for reference
- use route instead of state ref ui.. or show.. in the client app
- added sidebar
- adjusted mobile responsiveness
- Strict Firestore Security Rules for Issue #50
- Minimal Firebase Storage Security Rules for Issue #51
What's Changed
- Feature/weaponsforge 14 by @weaponsforge in #99
- Feature/viky 98 by @vikyw89 in #100
- Feature/weaponsforge 50 by @weaponsforge in #101
- v1.0.6 by @weaponsforge in #102
Full Changelog: v1.0.5...v1.0.6
Firestore Security Rules Summary
-
Allow writing (create, update, delete) documents under the
users
root-level collection only- success:
/users/{userId}
- fail:
/mycollection/{docId}
- success:
-
Allow writing (create, update, delete) of only uid-named documents under the
/users
root collection- success:
/users/{userId}
- fail:
/users/mydocument
- success:
-
Allow writing (create, update, delete) documents in allowed subcollections only. Currently, only the
users/{userId}/contacts
subcollection is allowed to contain documents- success:
/users/{userId}/contacts/{docId}
- fail:
/users/{userId}/tickets/{docId}
- success:
-
Allow reading documents only when a user is signed-in, the user has an
request.auth.account_level
key and the requested document falls under (or is) a/{userId}
document- success (requires sign-in):
/users/{userId}/contacts/{docId}
,/users/{userId}
- success (requires sign-in):
-
Disable creating new subcollections under documents in
users/{userId}/contacts/{docId}
- Creating subcollections under a document in a subcollection is disabled by default
- fail (creating mysubcollection):
/users/{userId}/contacts/{docId}/mysubcollection/{newId}
Create New Contact Document Rules
The following fields and their field type and character lengths are required when creating a new Contact under /users/{userId}/contacts/{docId}
. Adding extra fields will cause the Contact document creation to fail.
Field | Type | Length |
---|---|---|
doc_id | string | 50 |
email_address | string | 50 |
first_name | string | 50 |
last_name | string | 50 |
middle_name | string | 50 |
phone_number | string | 50 |
profile_picture_url | string | 600 |
sorting | string | 200 |
date_created | Firestore Timestamp | - |
date_updated | Firestore Timestamp | - |
Update Contact Document Rules
The following fields and their field type and character lengths are required when updating an existing Contact under `/users/{userId}/contacts/{docId}. Adding extra fields will also cause the Contact document update to fail.
Provide the Required fields and do not supply the Not Allowed fields when updating a Contact. One or more Optional fields may be set for update.
Required
Field | Type | Length |
---|---|---|
date_updated | Firestore Timestamp | - |
Not Allowed
Field | Type | Length |
---|---|---|
doc_id | string | 50 |
date_created | Firestore Timestamp | - |
Optional
Field | Type | Length |
---|---|---|
email_address | string | 50 |
first_name | string | 50 |
last_name | string | 50 |
middle_name | string | 50 |
phone_number | string | 50 |
profile_picture_url | string | 600 |
sorting | string | 200 |
Update User Profile Document Rules
The following fields and their field type and character lengths are required when updating an existing User profile document in /users/{userId}
. Adding extra fields will also cause the document update to fail.
Provide the Required fields and do not supply the Not Allowed fields when updating a User profile document. One or more Optional fields may be set for update.
Required
Field | Type | Length |
---|---|---|
date_updated | Firestore Timestamp | - |
Not Allowed
Field | Type | Length |
---|---|---|
doc_id | string | 50 |
date_created | Firestore Timestamp | - |
Optional
Field | Type | Length |
---|---|---|
email_address | string | 50 |
first_name | string | 50 |
last_name | string | 50 |
middle_name | string | 50 |
phone_number | string | 50 |