Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Releases: JaneJeon/objection-authorize

v3.1.2

06 Jan 22:05
Compare
Choose a tag to compare

Dependency and documentation updates

v3.1.1...v3.1.2

v3.1.1

04 Jan 01:19
Compare
Choose a tag to compare

This release fixes a critical bug where .delete() and .deleteById() would break for non-authorize calls.

All users of v3 are encouraged to update to this version!

v3.1.0...v3.1.1

v3.1.0

03 Jan 09:03
Compare
Choose a tag to compare

Now you can use role-acl v4 with this plugin!
If you're using role-acl>=4.3.2, be SURE to select role-acl@4 as your library instead of role-acl@3!

v3.0.1...v3.1.0

v3.0.1

03 Jan 08:19
Compare
Choose a tag to compare

The release of version 3 took SO LONG that objection 2 actually came out in-between the time that I started working on v3 and the time I finished it.

So this release brings official support for BOTH Objection v1 and v2! 🎉

And yes, I know there's a deprecation message with objection@2: QueryBuilder#mergeContext method is deprecated. But since QueryBuilder#context doesn't work the same way in objection 1, we're going to keep using it until we have to drop support for objection 1!

v3.0.0...v3.0.1

v3.0.0

03 Jan 08:08
Compare
Choose a tag to compare

Version 3 is here!

Version 3 brings a MASSIVE amount of internal rewrite to get casl and role-acl to play nice together (seriously, look at #61).

The only breaking changes are that the plugin initialization now requires you to specify a library (your choices currently are role-acl@3 and casl), and the resourceName option was dropped (unfortunately, due to the fundamental differences in the way the two libraries work).

That means once you plug in the library, you really shouldn't have to change your code at all!

There have been a bunch of cleanup (again, all internal), and a minor change with the way we handle resources: now, it's always wrapped in the model class.

This is the most exciting release this library has ever seen yet, and I hope it fixes all the little bugs and edge cases you had!

  • V3 (#61) a9085f9
  • closes #37 f99bf32
  • wrap resource with model class only when it's a POJO 5177b62
  • adds support for casl, closes #37 2a5ad1c
  • [skip ci] 3.0 in progress 10f0a00
  • factor out changes to allow testing separate plugins 45df2a3
  • add notes about the ACL restrictions 14700ef
  • update deps f3d5cc9
  • rely on model class name for resource name 327c69d
  • decouple authZ library with the plugin logic 40e6968
  • add back readme changes c64f634
  • Merge pull request #59 from JaneJeon/dependabot/npm_and_yarn/knex-0.20.6 2729d5b
  • Merge pull request #60 from JaneJeon/dependabot/npm_and_yarn/types/jest-24.0.25 ecab7ba
  • Bump @types/jest from 24.0.24 to 24.0.25 05aedb5
  • Bump knex from 0.20.4 to 0.20.6 5154c5b
  • Merge pull request #56 from JaneJeon/dependabot/npm_and_yarn/types/jest-24.0.24 ed7cfe0
  • Bump @types/jest from 24.0.23 to 24.0.24 c32dd13
  • Merge pull request #55 from JaneJeon/dependabot/npm_and_yarn/knex-0.20.4 1e3719c
  • Merge pull request #54 from JaneJeon/dependabot/npm_and_yarn/prettier-standard-16.1.0 6ed40bf
  • Merge pull request #53 from JaneJeon/dependabot/npm_and_yarn/sqlite3-4.1.1 2e04d86
  • Bump knex from 0.20.3 to 0.20.4 ff50898
  • Bump prettier-standard from 16.0.0 to 16.1.0 b5562bc
  • Bump sqlite3 from 4.1.0 to 4.1.1 9b1a40e
  • Bump prettier-standard from 15.0.1 to 16.0.0 (#49) 7a9ccb4
  • Bump jest-junit from 9.0.0 to 10.0.0 (#50) bc18593
  • Bump prettier-standard from 15.0.1 to 16.0.0 4563976
  • Bump jest-junit from 9.0.0 to 10.0.0 6549bf9
  • Merge pull request #51 from JaneJeon/dependabot/npm_and_yarn/lint-staged-9.5.0 93763d0
  • Bump lint-staged from 9.4.3 to 9.5.0 c12c8a1
  • Merge pull request #52 from JaneJeon/dependabot/npm_and_yarn/knex-0.20.3 cd0bf48
  • Bump knex from 0.20.2 to 0.20.3 d9bc966
  • [Security] Bump https-proxy-agent from 2.2.2 to 2.2.4 (#47) 4c2553c
  • [Security] Bump https-proxy-agent from 2.2.2 to 2.2.4 c5ba244
  • Merge pull request #43 from JaneJeon/dependabot/npm_and_yarn/lint-staged-9.4.3 58e8f22
  • Bump lint-staged from 9.4.2 to 9.4.3 145623e
  • Merge pull request #46 from JaneJeon/dependabot/npm_and_yarn/knex-0.20.2 54e3957
  • Merge pull request #44 from JaneJeon/dependabot/npm_and_yarn/types/jest-24.0.23 55edf93
  • Merge pull request #45 from JaneJeon/dependabot/npm_and_yarn/husky-3.1.0 e9d32c8
  • Bump knex from 0.20.1 to 0.20.2 7129010
  • Bump husky from 3.0.9 to 3.1.0 23329e1
  • Bump @types/jest from 24.0.22 to 24.0.23 04c227f
  • Merge pull request #41 from JaneJeon/dependabot/npm_and_yarn/types/jest-24.0.22 a999d90
  • Merge pull request #40 from JaneJeon/dependabot/npm_and_yarn/knex-0.20.1 692a236
  • Bump @types/jest from 24.0.20 to 24.0.22 1c9aa8c
  • Bump knex from 0.20.0 to 0.20.1 ff6e505
  • Merge remote-tracking branch 'origin/master' 92e079c
  • add note on dropping support for role-acl@4 511704c
  • Update README.md 7c97c55

v2.0.0...v3.0.0

v2.0.0

28 Oct 21:34
Compare
Choose a tag to compare

The 2.0 release is focused on reverting to synchronous methods and dropping support for role-acl@4, since the asynchronous nature was preventing us from checking the modelOrObjects in insert/update/create methods (yes, I know I said it would be supported in the 1.0 release, but it apparently slipped my mind, my apologies)!

Also, more methods are supported now (e.g. patchAndFetch, updateAndFetchById, insertAndFetch, etc) and we also added the ability to specify a custom action!

v1.1.2...v2.0.0

v1.1.2

20 Oct 22:27
Compare
Choose a tag to compare

You can now check if a resource property is undefined by checking it against $.undefined.

  • add undefined to resource arguments f4e5f51

v1.1.1...v1.1.2

v1.1.1

18 Oct 05:03
Compare
Choose a tag to compare

Mostly documentation update. There was a slight change in the order in which properties were merged (look at the Object.assign() call in the _checkAccess method) - basically, the resource object itself and the resource argument options take precedence over req.user and req.body now.

Documentation on the resource/access context was light to begin with, so I added some clarifications.

v1.1.0...v1.1.1

v1.1.0

12 Oct 19:19
Compare
Choose a tag to compare

Internal context variable names were renamed to be scoped/underscored, so now it shouldn't conflict with existing context variable names.

v1.0.0...v1.1.0

v1.0.0

12 Oct 19:13
Compare
Choose a tag to compare

This is a major release of objection-authorize.

The main change is working around the clusterfuck that came with role-acl v4, which turned EVERY method async.
Given that most of the hooks that this library was using were expected to be synchronous, I had to make major changes to the way it handles "access checks" (which, again, were now asynchronous).
Therefore, all of the actual access control checks had to be pushed to right after the query is built and before it is executed. The benefit of this approach is that it is very backwards-compatible - in fact, I didn't have to change a SINGLE line of tests!

HOWEVER, there is ONE breaking change (that was undocumented before) - when you passed in a body/object to insert/update/patch pre-1.0, when access was granted to the operation as a whole (e.g. a user is allowed to edit their own profile) BUT certain properties that the user was trying to create/modify were restricted (e.g. a user can't edit their own role), we simply trimmed off those restricted properties from the request body.
This is no longer possible as we're checking access only after the entire query has been built. So when you try to create/modify and you're trying to change some restricted fields (but your changes were otherwise allowed), you now will get an error instead of simply ignoring requests to change those fields.

  • fix merge conflicts b174119
  • works with ACL4 (breaking version) 167cf46
  • combine standard with prettier ed2d056
  • Merge pull request #26 from JaneJeon/dependabot/npm_and_yarn/lint-staged-9.4.1 458a6a6
  • Bump lint-staged from 9.4.0 to 9.4.1 b78d5c9
  • Merge pull request #25 from JaneJeon/dependabot/npm_and_yarn/knex-0.19.5 ecf8c58
  • Merge pull request #23 from JaneJeon/dependabot/npm_and_yarn/husky-3.0.8 6e39a73
  • Bump knex from 0.19.4 to 0.19.5 28136db
  • Bump husky from 3.0.7 to 3.0.8 ce98e29
  • Merge pull request #22 from JaneJeon/dependabot/npm_and_yarn/husky-3.0.7 0baa52a
  • Merge pull request #21 from JaneJeon/dependabot/npm_and_yarn/lint-staged-9.4.0 da76a97
  • Bump husky from 3.0.5 to 3.0.7 8278897
  • Bump lint-staged from 9.3.0 to 9.4.0 2dffde8
  • Update _config.yml 36f01e1
  • Merge pull request #16 from JaneJeon/dependabot/npm_and_yarn/standard-14.3.1 c9009cb
  • Merge pull request #19 from JaneJeon/dependabot/npm_and_yarn/objection-1.6.11 5dfc3bb
  • Bump objection from 1.6.9 to 1.6.11 6f80a53
  • Merge pull request #18 from JaneJeon/dependabot/npm_and_yarn/lint-staged-9.3.0 8ae38f0
  • Merge pull request #17 from JaneJeon/dependabot/npm_and_yarn/codecov-3.6.1 153e4f0
  • Bump lint-staged from 9.2.5 to 9.3.0 949ea34
  • Bump codecov from 3.5.0 to 3.6.1 c940cf1
  • Bump standard from 14.3.0 to 14.3.1 da6121b
  • Merge pull request #14 from JaneJeon/dependabot/npm_and_yarn/standard-14.3.0 d3026d2
  • Merge pull request #15 from JaneJeon/dependabot/npm_and_yarn/knex-0.19.4 85b035e
  • Bump knex from 0.19.3 to 0.19.4 6fb9361
  • Bump standard from 14.1.0 to 14.3.0 dd01a7f

v0.6.2...v1.0.0