Commit Graph

7 Commits

Author SHA1 Message Date
Daniel Lockyer
ae336f19cd
Protected against missing NODE_ENV variable
- in the event NODE_ENV isn't set, this would throw an error because
  `startsWith` is a function call on `undefined`
2022-08-18 08:34:53 +02:00
Daniel Lockyer
0a68ea88fb Reduced number of hashing rounds during tests
- one of the reasons our tests are so slow is because we're running 10
  rounds of bcrypt hashing on shared hardware, nearly 300 times during
  the database tests
- we don't particularly care about password hash strength during tests
  so this commit reduces the number of rounds to 1 if we're running in a
  test environment
- this drops the time to produce an individual hash from ~140ms to ~3ms,
  saving us a lot of time overall
2022-08-15 12:38:42 +02:00
Vikas Potluri
59f4570ee7
refactored security.password to use native bcrypt promises (#15126)
refs: https://github.com/TryGhost/Ghost/issues/14882

* refactored security.password to use native bcrypt promises
* refactored security.string to use more modern es features
2022-08-01 16:21:19 +01:00
Hannah Wolfe
36675b6494 Updated var declarations to const/let and no lists
- All var declarations are now const or let as per ES6
- All comma-separated lists / chained declarations are now one declaration per line
- This is for clarity/readability but also made running the var-to-const/let switch smoother
- ESLint rules updated to match

How this was done:

- npm install -g jscodeshift
- git clone https://github.com/cpojer/js-codemod.git
- git clone git@github.com:TryGhost/Ghost.git shallow-ghost
- cd shallow-ghost
- jscodeshift -t ../js-codemod/transforms/unchain-variables.js . -v=2
- jscodeshift -t ../js-codemod/transforms/no-vars.js . -v=2
- yarn
- yarn test
- yarn lint / fix various lint errors (almost all indent) by opening files and saving in vscode
- grunt test-regression
- sorted!
2020-04-29 16:51:13 +01:00
Ivan Akulov
e9d1d34739 Fixed missing Bluebird require in security/password.js (#9624)
no issue
2018-05-28 23:01:01 +02:00
kirrg001
c19a0c9942 🔥 Drop Node v4 Support
no issue

- support ends today
- see https://github.com/nodejs/Release
- removed `use strict`
2018-05-01 14:06:18 +02:00
kirrg001
5d1a4418bd Added lib.security.password lib
no issue

- move password hashing and password comparison to lib/security/password
- added two unit test
- FYI: password hashing takes ~100ms
  - we could probably mock password hashing in certain cases when unit testing
2018-02-15 21:13:04 +01:00