Closed benoitvidis closed 5 years ago
Merging #74 into 3-dev will increase coverage by
0.87%
. The diff coverage is82.6%
.
@@ Coverage Diff @@
## 3-dev #74 +/- ##
==========================================
+ Coverage 57.03% 57.91% +0.87%
==========================================
Files 4 4
Lines 533 537 +4
==========================================
+ Hits 304 311 +7
+ Misses 229 226 -3
Impacted Files | Coverage Δ | |
---|---|---|
lib/redis/manager.js | 33.33% <0%> (+2.18%) |
:arrow_up: |
lib/index.js | 49.44% <100%> (+0.37%) |
:arrow_up: |
lib/node.js | 77.72% <93.75%> (+0.17%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 5cd1285...9dc742e. Read the comment docs.
@scottinet not really. Some cleaning is done when a node is exiting but only for realtime subscriptions.
I see at least 2 cases where this fix is needed:
I don't question the fix, I see clearly why it's needed.
I only wonder what happens if persisted strategy information gets obsoleted when a cluster restarts (e.g. an auth plugin is uninstalled).
From the top of my head, I don't think that this pose a security risk, as Kuzzle will believe that the strategy exists at first, but an error will be issued when it'll try to use it. So credentials should never be leaked. But this may warrant a check just to be sure. What do you think?
Ah yes, you're right. I will check what happens in this case.
@scottinet Just checked and the strategy is rejected on the login attempt stating the strategy is unknown. So yes, we properly get an error in this situation.
What does this PR do ?
This PR fixes the case where some strategies could be lost across a cluster of Kuzzle nodes if one or more of them came to not respond by persisting the strategies in Redis.
How should this be manually tested?
dummy
strategy does not exist by trying to log indummy
strategy is known on all nodesdummy
strategy has been deleted from all nodes