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

[10.x] Verify hash config #48814

Merged
merged 2 commits into from
Oct 25, 2023
Merged

Conversation

timacdonald
Copy link
Member

No description provided.

@timacdonald timacdonald force-pushed the cost-less-than branch 7 times, most recently from 01fc91f to 17d0606 Compare October 24, 2023 23:47
@timacdonald timacdonald marked this pull request as ready for review October 24, 2023 23:52
if (
$options['memory_cost'] > $this->memory ||
$options['time_cost'] > $this->time ||
$options['threads'] > $this->threads
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should compare the other way, allowing more threads (maybe until a limit) because less threads means more computation time

@taylorotwell taylorotwell merged commit 98ffb75 into laravel:10.x Oct 25, 2023
20 checks passed
@ismaail
Copy link

ismaail commented Oct 31, 2023

If someone is getting the error RuntimeException: Could not verify the hashed value's configuration. in tests,

the cause is <env name="BCRYPT_ROUNDS" value="4"/> in phpunit.xml

solution: remove this line from phpunit.xml

@bastien-phi
Copy link
Contributor

@ismaail You should not. I will slow down your tests.

Best way to fix it is to follow the changes made in laravel/laravel#6259

class UserFactory extends Factory
{
+   protected static ?string $password;

    // ...

    public function definition(): array
    {
        return [
            // ...
-           'password' => '$2y$12$Z/vhVO3e.UXKaG11EWgxc.EL7uej3Pi1M0Pq0orF5cbFGtyVh0V3C', // password
+           'password' => static::$password ??= Hash::make('password'),

@citricguy
Copy link

citricguy commented Oct 31, 2023

Thank you @bastien-phi.

'password' => Hash::make('password'), resolved this failure in my tests.

This issue cropped up for me in 10.30 specifically in the event someone else runs into this.

@mattvb91
Copy link

mattvb91 commented Nov 1, 2023

If someone is getting the error RuntimeException: Could not verify the hashed value's configuration. in tests,

the cause is <env name="BCRYPT_ROUNDS" value="4"/> in phpunit.xml

solution: remove this line from phpunit.xml

I didnt feel comfortable removing it. Checked the updated laravel hash config and seen the value was updated to 12. I changed the phpunit.xml value: <env name="BCRYPT_ROUNDS" value="12"/> fixed it for me. Thanks for the pointer tho i was completely stuck

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.

6 participants