UNPKG

targaryen

Version:

Test Firebase security rules without connecting to Firebase.

203 lines (138 loc) 10.4 kB
## 3.1.0 2018-05-13 - Add [jest matcher] ([#150]) - Validate literal regular expression ([#146]). - Add support for the `query` variable ([#142]). Thanks to @a-xin to implementing the new plugin and for his help troubleshooting RexExp validation. [#150]: https://github.com/goldibex/targaryen/pull/150 [jest matcher]: https://github.com/goldibex/targaryen/tree/master/docs/jest ## 3.1.0-beta.3 2018-05-09 - Allow dot in literal regexp ([#148]); Thanks @a-xin for notice it. - Support literal closing bracket ([#149]). [#148]: https://github.com/goldibex/targaryen/pull/148 [#149]: https://github.com/goldibex/targaryen/pull/149 ## 3.1.0-beta.2 2018-05-07 - Publish generated regexp parser; Thanks @a-xin for notice it. ## 3.1.0-beta.1 2018-05-06 - Validate literal regular expression ([#146]). [#146]: https://github.com/goldibex/targaryen/pull/146 ## 3.1.0-beta.0 2018-03-07 - Add support for the `query` variable ([#142]). [#142]: https://github.com/goldibex/targaryen/issues/142 ## 3.0.5 2017-10-23 - Fix regression in v3.0.3 regarding invalid location in rules evaluation - should have been allowed ([#136]). Thanks to @chetbox for reporting the issue. [#136]: https://github.com/goldibex/targaryen/issues/136 ## 3.0.4 2017-10-21 - Fix handling of trailing slashes in update operation patch data keys ([#134]). Thanks to @SamyPesse for reporting the issue. [#134]: https://github.com/goldibex/targaryen/issues/134 ## 3.0.3 2017-10-07 - Fix handling of tests with invalid locations ([#131]). Thanks to @dannycochran for reporting the issue. [#131]: https://github.com/goldibex/targaryen/issues/131 ## 3.0.2 2017-08-10 - Fix falsy member property evaluation ([#125]); `foo.bar` would have evaluated to `foo` if `foo.bar` had been falsy (e.g. an empty string). - Fix patch example ([#123]). Thanks to @SamyPesse and @a-xin for their contributions. [#125]: https://github.com/goldibex/targaryen/issues/125 [#123]: https://github.com/goldibex/targaryen/pull/123 ## 3.0.1 2017-01-24 - Fix computed property type infering ([#114], [#116], [#117] & [#118]) Thanks to @pthrasher for his contribution. [#114]: https://github.com/goldibex/targaryen/pull/114 [#116]: https://github.com/goldibex/targaryen/pull/116 [#117]: https://github.com/goldibex/targaryen/pull/117 [#118]: https://github.com/goldibex/targaryen/pull/118 ## 3.0.0 (2017-01-12) - [Fix type validation](https://github.com/goldibex/targaryen/issues/62): * Type inferring doesn't throw when it cannot infer a node type; set the type to "any" or "primitive". * Type inferring of each side of a binary expression, or of method argument accepts "any" or "primitive" and delay type validation until evaluation. * Validate type of string and snapshot method arguments during evaluation. * Validate type of each sides of binary expression during evaluation: most arithmetic expressions require numbers, addition also accept operation on string, comparison require string, number or null, equality operations require a primitive or a plain Object. - [Add live testing for Firebase parity](https://github.com/goldibex/targaryen/pull/63). - [Stop evaluating child write rules](https://github.com/goldibex/targaryen/issues/73). - [Add more debugging info](https://github.com/goldibex/targaryen/pull/83). - [Fix snapshot root parent access](https://github.com/goldibex/targaryen/pull/97). - [Fix data node snapshot priority handling](https://github.com/goldibex/targaryen/pull/96). - [Refactor API](https://github.com/goldibex/targaryen/pull/80): + Plugins scripts should be imported directly, e.g. `require('targaryen/plugins/chai')`: * Add `targaryen/plugins/chai`. * Add `targaryen/plugins/jasmine`. * Deprecate `targaryen.chai`. * Deprecate `targaryen.jasmine`. * Deprecate `targaryen.setFirebaseData`. * Deprecate `targaryen.setFirebaseRules`. * Deprecate `targaryen.setDebug`. * Deprecate `targaryen.users`. + Simpler API to use targaryen directly: * Add `targaryen.database(rules: object|Ruleset, data: object|DataNode, now: null|number): Database`. * Add `targaryen.util` functions used by the CLI and the reference plugins for chai and jasmin * Remove `targaryen.Ruleset`. * Remove `targaryen.DataSnapshot`. * Remove `targaryen.helpers`. - Refactor internal: * [Refactor data access and Ruleset](https://github.com/goldibex/targaryen/pull/72). * [Refactor public api](https://github.com/goldibex/targaryen/pull/80). * [Format source based on eslint xo shared configuration](https://github.com/goldibex/targaryen/pull/81). * [Refactor rule parser](https://github.com/goldibex/targaryen/pull/91). * [Simpler tests](https://github.com/goldibex/targaryen/pull/94). * [Move `lib/database`](https://github.com/goldibex/targaryen/pull/98). * [Fix deleting a missing node](https://github.com/goldibex/targaryen/pull/103). * [Add `DataNode.$merge` (`Database.root.$merge`)](https://github.com/goldibex/targaryen/pull/104). * [Better debug info when an operation doesn't trigger any read/write rules](https://github.com/goldibex/targaryen/pull/107). * [Fix regression bug in removing and prune nodes](https://github.com/goldibex/targaryen/pull/109). * [Describe operation in result info (were previously generated by error helpers in `targaryen.utils`)](https://github.com/goldibex/targaryen/pull/110). - [Targaryen CLI can parse rules containing multi lines string (would previously only support comments)](https://github.com/goldibex/targaryen/pull/111). - [Chai and jasmine plugins include json parser helpers (supporting comments and multi line strings)](https://github.com/goldibex/targaryen/pull/112) Thanks goes to @alisson446, @georgesboris, @mhuebert, @RomansBermans and @simenbrekken for their contributions. ## 2.3.3 (2016-12-04) - [Fix write/patch debug message](https://github.com/goldibex/targaryen/pull/93). Thanks to @RomansBermans for reporting the issue. ## 2.3.2 (2016-11-18) - [Fix runtime handling of null value](https://github.com/goldibex/targaryen/issues/86). Thanks to @RomansBermans and @simenbrekken for spotting the issue. ## 2.3.1 (2016-11-08) - Fix npm description ## 2.3.0 (2016-11-01) - [Expose Ruleset, DataSnapshot and helpers](https://github.com/goldibex/targaryen/pull/50). - [Write operations now replace nodes instead of merging them](https://github.com/goldibex/targaryen/pull/52). - [Fix initial timestamps](https://github.com/goldibex/targaryen/pull/41); The timestamp used to replace a server value will match the `now` variable in rule tests. - [Fix parsing rules with unknown identifers](https://github.com/goldibex/targaryen/pull/55). - [Fix `Ruleset#tryWrite` returning `data` and `newData` as a value instead of a snapshot](https://github.com/goldibex/targaryen/pull/59). - [Fix inconsistence between Ruleset's `tryRead`, `tryWrite`, and `tryPatch` returned result](https://github.com/goldibex/targaryen/pull/59): they now all return a root and data snapshot, and a newRoot and newData snapshot when appropriate. - [Prune off null value and empty node after any update](https://github.com/goldibex/targaryen/pull/56). - [Partially fix type inference while building the rules](https://github.com/goldibex/targaryen/pull/57). - [Fix missing auth properties evaluation](https://github.com/goldibex/targaryen/issues/60). - [Fix evaluation error handling in write/patch operations](https://github.com/goldibex/targaryen/issues/61). - [Fix evaluation of computed member expression](https://github.com/goldibex/targaryen/issues/75). - `setFirebaseData` gains a `now` parameter: `targaryen.setFirebaseData(data[, now]);`. - jasmine matchers gain an optional `now` parameter. - chai plugin `write` and `patch` methods gain an optional `now` parameter. - chai plugin gains a `readAt(now)` method. Thanks goes to @georgesboris and @mhuebert for their contributions. ## 2.2.1 (2016-10-21) - [Properly merge literal value nodes (including null)](https://github.com/goldibex/targaryen/pull/44); a node would have been set to null but it's - deleted - children would still have been validated with their old value. - [Skipping validation of node set to null would skip validation of sibling nodes; this is now fixed](https://github.com/goldibex/targaryen/pull/48). - [Treat empty objects as null](https://github.com/goldibex/targaryen/pull/51). Thanks to @mhuebert. ## 2.2.0 (2016-08-12) Starting from this release, Node.js version 0.12 is no longer supported. Please use 2.1 for Node versions 0.12 and below. - [Wildcards are now correctly propagated at multiple levels](https://github.com/goldibex/targaryen/pull/39). Thanks to @dinoboff. - [Support for testing update operations, including multi-location updates](https://github.com/goldibex/targaryen/pull/37). Thanks to @dinoboff. - [.validate rules are now ignored during delete operations, reflecting the actual behavior of Firebase](https://github.com/goldibex/targaryen/pull/36). Thanks to @matijse. Fun fact: "ij" is a single letter in Dutch. - ["JSON comments" in rules files are now correctly ignored, reflecting the actual behavior of Firebase](https://github.com/goldibex/targaryen/pull/32). Thanks to @sebastianovide. - [The .priority key was inadvertently overwritten under some conditions; this is now fixed.](https://github.com/goldibex/targaryen/pull/35). Thanks to @matijse. ## 2.1.1 (2016-05-11) - [You can now use unauthenticated users in CLI testing](https://github.com/goldibex/targaryen/pull/28). Thanks to @jbearer. ## 2.1.0 (2016-05-04) - [newData is now correctly merged with existing root state](https://github.com/goldibex/targaryen/pull/27). Fixes [a bug demonstrated](https://github.com/goldibex/targaryen/pull/25) by @bijoutrouvaille. Thanks to @ibash for fixing it. ## 2.0.1 (2016-03-23) - [Nested variables in rules](https://github.com/goldibex/targaryen/pull/23). Thanks to @petrusek. - [Fix validate rules running on null](https://github.com/goldibex/targaryen/pull/21). Thanks to @jtwebman. ## 2.0.0 (2015-10-23) - Major version bump that _should_ have happened in association with #14. Sorry about that. - Fixed a bug in parsing binary expressions (#18). Thanks to @CurtisHumphrey. ## 1.1.7 (2015-10-21) - You can now use leading `/` in tests. Thanks to @CurtisHumphrey for this.