tempest-framework icon indicating copy to clipboard operation
tempest-framework copied to clipboard

feat: Adds Timebox utility class and extends Clock

Open przemyslaw-przylucki opened this issue 1 year ago • 1 comments

Motivation: Timebox is useful in:

  • authentication, to prevent certain types of attacks (https://ephort.dk/blog/laravel-timing-attack-vulnerability/?ref=securinglaravel.com)
  • sub-minute scheduler, where we want every iteration of scheduler to run for exactly one second

After this gets merged, I'll adjust https://github.com/tempestphp/tempest-console/pull/24 to utilize it

przemyslaw-przylucki avatar May 05 '24 13:05 przemyslaw-przylucki

Pull Request Test Coverage Report for Build 9045933531

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 30 of 33 (90.91%) changed or added relevant lines in 4 files are covered.
  • 21 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.3%) to 86.566%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Clock/GenericClock.php 1 2 50.0%
src/Clock/MockClock.php 4 6 66.67%
<!-- Total: 30 33
Files with Coverage Reduction New Missed Lines %
src/Http/Session/Managers/FileSessionManager.php 1 97.73%
src/Tempest.php 4 0.0%
src/Application/ApplicationInitializer.php 7 0.0%
src/functions.php 9 64.0%
<!-- Total: 21
Totals Coverage Status
Change from base Build 8947731007: 0.3%
Covered Lines: 1321
Relevant Lines: 1526

💛 - Coveralls

coveralls avatar May 05 '24 13:05 coveralls

Since we're not going for sub-minute scheduling, I don't think we should add this PR for now.

Maybe when we're further working on Auth we can reconsider it, but I'm gonna close it for now. Thanks for thinking along though! Really appreciate all your work 😁

brendt avatar May 30 '24 18:05 brendt