Skip to content
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

redis-nonce-store should catch redis errors #73

Open
jasonblanchard opened this issue Oct 10, 2017 · 0 comments
Open

redis-nonce-store should catch redis errors #73

jasonblanchard opened this issue Oct 10, 2017 · 0 comments

Comments

@jasonblanchard
Copy link

jasonblanchard commented Oct 10, 2017

Calling code may want to know when calls to @redis.get or @redis.set fail. For example, in this code, err should be handled when @redis.get fails, perhaps because the redis client can't connect to the redis instance. And then despite this comment, I think you actually want to know when that write failed - otherwise, you're vulnerable to replay attacks.

Additionally, this code currently treats all nonceStore errors from @nonceStore.isNew in _valid_oauth as an "Expired nonce," which may not be the case if it can error out for other reasons (i.e. a call to @redis.get failed). It looks like you already have a StoreError, so you could use that in RedisNonceStore.isNew and then switch on the error type in the @nonceStore.isNew callback to determine which error to send to the next callback and ultimately up to the calling code.

I'm happy to submit a PR for this, just want to make sure you guys are ok with the architectural ideas above. I guess, technically, it's kind of a breaking change if people are relying on "Expired nonce" even when its not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant