feat: Security Rules Management API#645
Conversation
* Implementing the Firebase Security Rules API * More argument validation and assertions * Cleaning up the rules impl * Internal API renamed * Fixing a typo in a comment
* Implementing the Firebase Security Rules API * More argument validation and assertions * Adding the rest of the CRUD operations for rulesets * Cleaning up the rules impl * Cleaned up tests * Adding some missing comments * Removing support for multiple rules files in create()
* Added deleteRuleset API * Merged with source
* Implemented the API for releasing rulesets * Removed createRelease logic * Updated comment
* Implemented the API for releasing rulesets * Removed createRelease logic * Added getStorageRules() API * Removed some redundant tests
* Added rules API to the public admin namespace * Updated docs * Addressing comments regarding the d.ts file * Updated App typings
* Rules integration tests * Refactored by adding some helper methods * Cleaned up some conditionals * Added verification for deleteRuleset test * Renamed tempRulesets
| * | ||
| * @example | ||
| * ```javascript | ||
| * // Get the SecurityRules service for the default app |
There was a problem hiding this comment.
Suggest backticks like you have below: "the SecurityRules service"
There was a problem hiding this comment.
Does it matter here? This is a comment inside an example. It would be rendered as is.
There was a problem hiding this comment.
Oh that's right :)
We can skip this one and the others inside comments for sure.
src/index.d.ts
Outdated
| * | ||
| * @param app Optional app to return the `SecurityRules` service | ||
| * for. If not provided, the default `SecurityRules` service will | ||
| * be returned. |
There was a problem hiding this comment.
A good case for just "is returned."
src/index.d.ts
Outdated
| * limit. | ||
| * @param nextPageToken The next page token. If not specified, returns rulesets | ||
| * starting without any offset. | ||
| * @return A promise that fulfills a page of rulesets. |
There was a problem hiding this comment.
Should this be "fulfills with" ?
egilmorez
left a comment
There was a problem hiding this comment.
A few formatting things to look at. Thanks Hiranya!
|
Thanks @egilmorez. Made some of the changes suggested. As for adding backticks, I don't think it's needed there since they are rendered as comments in an example snippet. WDYT? |
RELEASE NOTE: Added a new
admin.securityRules()API for managing Firebase security rules applied on services like Cloud Firestore and Cloud Storage.RELEASE NOTE: Added
getFirestoreRuleset()andgetStorageRuleset()methods for retrieving rulesets that are currently in effect.RELEASE NOTE: Added
releaseFirestoreRuleset()andreleaseStorageRuleset()methods for creating new rulesets and applying them to Firestore and Storage.RELEASE NOTE: Added
getRuleset(),createRuleset()anddeleteRuleset()methods for managing the lifecycle of a ruleset.