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

bcrypt support #24

Merged
merged 4 commits into from
Apr 24, 2017
Merged

bcrypt support #24

merged 4 commits into from
Apr 24, 2017

Conversation

elmigranto
Copy link
Collaborator

@elmigranto elmigranto commented Apr 21, 2017

See #22

@elmigranto
Copy link
Collaborator Author

Okay, this will check passwords against hash appropriately and not hash already hashed stuff. What left is to update ./bin/import-json to read bcrypt-ed stuff from JSON. I'll try to look up what the format is (field name, really) and do it, but if you already have info, add a prop to function argument and change this line to use it.

@elmigranto
Copy link
Collaborator Author

elmigranto commented Apr 22, 2017

Maybe we should additionally throw an error if password starts with $stormpath1$, though, and check for bcrypt-ness. Let me know about these or keep them in mind if you update it yourself:

  • format
  • strictness
  • could it be that user has no password

@j3k0
Copy link
Owner

j3k0 commented Apr 22, 2017

Docker image fails to build, bcrypt won't compile... seems like it requires python.

> bcrypt@1.0.2 install /home/app/code/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build
npm info lifecycle bcrypt@1.0.2~install: bcrypt@1.0.2
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.32
node-pre-gyp info using node@6.10.2 | linux | x64
node-pre-gyp info check checked for "/home/app/code/node_modules/bcrypt/lib/binding/bcrypt_lib.node" (not found)
node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-linux-x64.tar.gz
node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-linux-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.2 and node@6.10.2 (node-v48 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-linux-x64.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@3.4.0
gyp info using node@6.10.2 | linux | x64
gyp info ok
gyp
info it worked if it ends with ok
gyp info using node-gyp@3.4.0
gyp info using node@6.10.2 | linux | x64
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:449:14)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:353:11
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:69:16)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:81:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:90:16
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5
gyp ERR! stack at /usr/local/lib/node_mo
dules/npm/node_modules/which/node_modules/isexe/access.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Linux 4.4.0-72-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/app/code/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/home/app/code/node_modules/bcrypt/lib/binding"
gyp ERR! cwd /home/app/code/node_modules/bcrypt
gyp ERR! node -v v6.10.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/app/code/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/app/code/node_modules/bcrypt/lib/binding' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/app/code/node_modules/node-pre-gyp/lib/util/comp
ile.js:83:29)
node-pre-gyp ERR!
stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:886:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 4.4.0-72-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/app/code/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/app/code/node_modules/bcrypt
node-pre-gyp ERR! node -v v6.10.2
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/app/code/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/app/code/node_modules/bcrypt/lib/binding' (1)
npm info lifecycle bcrypt@1.0.2~install: Failed to exec install script

@elmigranto elmigranto changed the title [WIP] bcrypt support bcrypt support Apr 22, 2017
@elmigranto
Copy link
Collaborator Author

There might be JS-only implementation (looks like it should be part of OpenSSL which is shipped with node), but given how Stormpath docs mention that particular bcrypt library, would be best to stay with it.

@j3k0
Copy link
Owner

j3k0 commented Apr 22, 2017

Sure, hopefully fix is easy (install python)

@j3k0
Copy link
Owner

j3k0 commented Apr 22, 2017

(on it right now)

@j3k0 j3k0 merged commit 241e0cc into develop Apr 24, 2017
@j3k0 j3k0 removed the in progress label Apr 24, 2017
@j3k0 j3k0 deleted the feature/bcrypt branch April 24, 2017 05:32
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

Successfully merging this pull request may close these issues.

None yet

2 participants