Conversation
Change to SignStream class as it uses DataStream objects to create secret and payload streams. This error should then be caught by jwsSign to adequately fail users downstream instead of failing silently.
All tests expect an undefined to be returned on failure, so using a naked return back to jwsSign rather than raising an explicit ReferenceError.
|
You need to handle the case where |
|
Yeah, I'm failing the streaming signing of RSA tests specifically because of this. Trying to figure out a way to do just that, it just sucks that I can't run automated build and tests without creating PRs (failing in public is fun, right?) |
|
You can, just run |
|
I don't have a node server at work, so I edit in atom directly and then create PRs. I'm not even using this library, yet, but got down this rabbit hole when investigating using jwts for authentication on an app I'm working on in cloud9, then saw this issue. . . ;) |
undefined keys should raise no value, so that errors during jws.Sign can emit an error. added tests to ensure the same are check upon HMAC testing
|
There, I added the test reported from the issue that raised this. I did a naked return whenever a secret is undefined to make an undefined value propagate up through to jws.Sign, at which point, an 'error' should emit. @willm , does this address your concern without having to change DataStream directly for streams? I'd love a suggestion on how to write a test to catch the emit('error') functions though, for completeness. |
Change to SignStream class as it uses DataStream objects to create secret and payload streams. This error should then be caught by jwsSign to adequately fail users downstream instead of failing silently.