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

Modified package to now use class based approach #10

Closed
wants to merge 4 commits into from

Conversation

gavinhenderson
Copy link

Here are the changes proposed in #9. They are by no means complete just wanted to get some opinions on the changes made so far before I put more time into tidying the code and adding more tests.

@simonepri
Copy link
Owner

Hi @gavinhenderson I'll review this asap.
Thank you for the time you spent contributing!

index.js Outdated
@@ -16,7 +25,7 @@ const queue = [];
* @param {Function} algorithm.identifiers A function that returns the list of
* identifiers that this password hashing algorithm is able to generate / verify.
*/
function install(name, algorithm) {
Upash.prototype.install = function(name, algorithm) {
Copy link
Owner

@simonepri simonepri Sep 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be private, we want the instance to be immutable

index.js Outdated

/**
* Uninstalls a password hashing function previously installed.
* @public
* @param {string} name The name of the algorithm to uninstall or 'last' to
* uninstall the last one installed.
*/
function uninstall(name) {
Upash.prototype.uninstall = function(name) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this

@@ -102,32 +111,32 @@ function list() {
* @param {string|undefined} name The name of the algorithm to use.
* @return {Object} The password hashing function object.
*/
function use(name) {
Upash.prototype.use = function(name) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should set the default for the current instance

@gavinhenderson
Copy link
Author

@simonepri Thats those three changes made now. If you think these changes are okay let me know and I'll add more tests for the new API and I'll improve the way setting default works.

@gavinhenderson
Copy link
Author

Hey @simonepri , just wondering if there was any more changes you wanted me to make 👍

@simonepri
Copy link
Owner

Hey @gavinhenderson sorry for the long delay, It looks cool.
I'll dive into this during the weekend and I'll let know you know.

Thank you for contributing!

@gavinhenderson
Copy link
Author

Hey @simonepri, I hope youre well! I noticed there hasn't been any changes on master for 4 months. Is there plans to mainain this project or should I close my pull request?

@simonepri
Copy link
Owner

@gavinhenderson
No Gavin, I'm super happy with this PR.
I'm working on a refactor for all the phc-* packages that upash relies on, and I want to finish it before merging this pr.

Sorry for the long delay.

@indo-dev-0
Copy link

Updates on this? I would like to contribute changes that would benefit from a class based system.

@gavinhenderson
Copy link
Author

@indo-dev-0 no updates from me

@simonepri
Copy link
Owner

Sorry for the 1-year long delay. (I had an intense year)
I'll try to review and merge this before end of next week.

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.

3 participants