-
Notifications
You must be signed in to change notification settings - Fork 19
Remove core instance dependency at plugin level #433
Conversation
All looks good to me @mihaidma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
I usually prefer explicit dependencies (in function parameters) to "hidden" dependencies using (i.e using request decoration), but I understand this is required to be able to use a different udaru core on different requests.
👍
@@ -4,7 +4,7 @@ const _ = require('lodash') | |||
const Boom = require('boom') | |||
const async = require('async') | |||
|
|||
function buildAuthorization (udaru, config) { | |||
function buildAuthorization (config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we also remove config here and use the decorated one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 As the PR got big I'll merge it then see what enhancements we can come up with.
The purpose of this PR is to remove the dependency on a common Udaru Core instance passed as parameter to routes and other functionality at the plugin level.
The changes are the following:
While doing the changes did also two fixes:
This dependency removal offers the users of Udaru the option to pass from outside their own Udaru core instance and in a multitenant environment pass different per tenant Udaru core Instances on each request. #430
Each step is made as a separate commit to make the review easier.