Comments (7)
Intuitively, I would categorise both of those errors as "implementation errors" or "programmer errors" that should not be caught but blow up the stack and exit the process. The reason I believe so is that they are checking that your input is not violating the interface/specification rather than being operational errors. They are simply sort of a helping hand during implementation and for debugging, and even removing those checks would be, in my opinion, entirely legit.
from credential.
Intuitively, I would categorise both of those errors as "implementation errors" or "programmer errors"
@tjconcept definitely and linked errors are implementation (controlled) errors, it would be good to give them some recognition.
On my side when there's malformed hash stored in database I want to (in controlled way): reject login attempt and log event, but not crash the process. While current options that I have are:
a) Crash (overreaction, as I can handle some recognizable errors gently and allow process going)
b) Introduce some hard to maintain not future proof error detection
c) Catch all errors, this is bad as it will also catch programmatical errors (e.g. eventual bugs in credential) that doesn't seem solid.
from credential.
btw. Node.js migrated all errors recently to be equipped with such codes (for this very reason of programmatical recognition) -> https://github.com/nodejs/node/blob/master/doc/guides/using-internal-errors.md#adding-new-errors
from credential.
Catch all errors, this is bad as it will also catch programmatical errors
This is exactly my argument. These are such errors you do not want to catch.
Anyways, I think the idea of having a code is fine, and aligning with Node.js as well makes sense.
Whether to catch such error is another matter, in which it seems we don't agree entirely.
from credential.
Whether to catch such error is another matter, in which it seems we don't agree entirely.
Exactly, and this decision should not be made (or forced) by credential. It's library dependent that should be in power to decide :)
from credential.
Well, we don't agree on that either xD It's linked to my former argument that removing these throw
would be a completely sane move as well. They are only there to help you during integration. You could add 100 of these input checks if you wanted.
For the same reason the dependent libraries should not catch these: it would be completely arbitrary which programming errors would be caught or not.
from credential.
Closing all stale issues and PRs. Please update, ensure all tests pass, and reopen if you really want this in.
from credential.
Related Issues (20)
- callback, promise or both HOT 10
- I can't make the cli work HOT 8
- Verifying with a pre-parsed JSON object HOT 4
- What if an attacker know that I am using this library? HOT 9
- The use of "time" - a weakness worth noting? HOT 13
- Why hash() just return string rather than object? HOT 2
- fix failing CI server
- Does it really needs webpack? HOT 7
- Node v6 deprecation - "crypto.pbkdf2 without specifying a digest is deprecated" HOT 3
- Release v2.0.0 on npm HOT 3
- Support bcrypt hashing method? HOT 1
- performance optimisation HOT 4
- Do not encourage people to write security issue in public places HOT 1
- Default number of iterations seems extreme HOT 2
- Due to the large number of iterations, Its consuming the full CPU usage. HOT 7
- Update deps, freshen code, release new major version. HOT 7
- Bad default settings HOT 4
- the 'verify' function takes too much time, about 1.3 seconds HOT 2
- Inconsistent use of bytes length/encodings? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from credential.