-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optionally persist [Github] tokens in Redis #1939
Conversation
Save the tokens things change instead of on a timer. Use EventEmitter to keep the components loosely coupled. This is easier to reason about, much easier to test, and better supports adapting to backends which support atomic operations. This switches from json-autosave, which was a bit difficult to read and also hard to test, to fsos, the lower-level utility it’s built on.
I will review this when #1906 is merged. 😉 |
Generated by 🚫 dangerJS |
# Conflicts: # lib/token-persistence.js # lib/token-persistence.spec.js # services/github/github-constellation.js
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 overall good to me, well done! 👍
CONTRIBUTING.md
Outdated
@@ -130,6 +130,10 @@ e.g. **[Travis] Fix timeout issues** | |||
|
|||
When changing other code, please add unit tests. | |||
|
|||
To run the integration tests, you must have redis installed and in your PATH. | |||
Use `brew install redis`, `yum install redis`, etc. Ths test runner will |
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.
Small typo: "Ths".
}) | ||
} | ||
|
||
beforeEach(function() {}) |
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.
I'm guessing this should be deleted? 😄
This is a fairly simple addition of a Redis-backed TokenPersistence. When GithubConstellation is initialized, it will create a FsTokenPersistence or a RedisTokenPersistence based on configuration. Have added tests of the Redis backend as an integration test, and ensured the server starts up correctly when a
REDIS_URL
is configured.This is based off #1906 and the diff will clean up when that lands. Tests are failing due to #1938.
Ref: #1848