Giter VIP home page Giter VIP logo

amazo's People

Contributors

kemoycampbell avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

celinelobban

amazo's Issues

Use a named immutable configuration object, not an array

https://github.com/kemoycampbell/amazo/blob/master/src/Amazo/Amazo.php#L37
By doing this, you let the language do the validating for you, no need to validate it yourself.
$config = new Amazo\Config('dbUser', 'dbPassword', 'dbDSN'); $amazo = new Amazo\Amazo($config);
Where Amazo\Amazo constructor typehints for Amazo\Config. And since Amazo\Config's constructor requires you to supply it with those arguments, you can be guaranteed that Amazo\Amazo has been constructed correctly. No need to validate an array. Leverage the language instead.

generatePassCost should be optional. Developer should use it in dev to find best cost

https://github.com/kemoycampbell/amazo/blob/master/src/Amazo/Amazo.php#L330
That's fine for testing things out and then setting the cost as a configuration option, but doing it on the fly is simply not good. It's being called multiple times, which completely defeats the purpose of trying to stick to a specific time cost!
The purpose of the 50ms rule of thumb is that it's just long enough to mitigate brute force if the database is breached, but not so costly that it would create a DOS vulnerability. If you're simply guessing every time it's run, then you're making the server do more work anyway.
Instruct the developer to use it as a utility on their production environment to determine what value to set ahead of time, and then set that value as configuration. Never call generatePassCost() in your code.

typo

You are referencing $GET when you really mean $_GET. code snippet:

if(isset($_POST[$crfname]) || isset($GET[$crfname]))

Fix other inconsistencies

In some places you have if( and in others you have if ( (notice the space between the parens and the keyword?)
Be consistent in everything you do.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.