8000 Merge tag 'v12.14.1' · laravel/framework@7f20c61 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f20c61

Browse files
committed
Merge tag 'v12.14.1'
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
2 parents 7672871 + 84b1429 commit 7f20c61

File tree

58 files changed

+2221
-311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2221
-311
lines changed

.github/workflows/databases.yml

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -293,53 +293,53 @@ jobs:
293293
DB_USERNAME: SA
294294
DB_PASSWORD: Forge123
295295

296-
# mssql_2017:
297-
# runs-on: ubuntu-20.04
298-
# timeout-minutes: 5
299-
300-
# services:
301-
# sqlsrv:
302-
# image: mcr.microsoft.com/mssql/server:2017-latest
303-
# env:
304-
# ACCEPT_EULA: Y
305-
# SA_PASSWORD: Forge123
306-
# ports:
307-
# - 1433:1433
308-
309-
# strategy:
310-
# fail-fast: true
311-
312-
# name: SQL Server 2017
313-
314-
# steps:
315-
# - name: Checkout code
316-
# uses: actions/checkout@v4
317-
318-
# - name: Setup PHP
319-
# uses: shivammathur/setup-php@v2
320-
# with:
321-
# php-version: 8.3
322-
# extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlsrv, pdo, pdo_sqlsrv, odbc, pdo_odbc, :php-psr
323-
# tools: composer:v2
324-
# coverage: none
325-
326-
# - name: Set Framework version
327-
# run: composer config version "13.x-dev"
328-
329-
# - name: Install dependencies
330-
# uses: nick-fields/retry@v3
331-
# with:
332-
# timeout_minutes: 5
333-
# max_attempts: 5
334-
# command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
335-
336-
# - name: Execute tests
337-
# run: vendor/bin/phpunit tests/Integration/Database
338-
# env:
339-
# DB_CONNECTION: sqlsrv
340-
# DB_DATABASE: master
341-
# DB_USERNAME: SA
342-
# DB_PASSWORD: Forge123
296+
mssql_2017:
297+
runs-on: ubuntu-22.04
298+
timeout-minutes: 5
299+
300+
services:
301+
sqlsrv:
302+
image: mcr.microsoft.com/mssql/server:2017-latest
303+
env:
304+
ACCEPT_EULA: Y
305+
SA_PASSWORD: Forge123
306+
ports:
307+
- 1433:1433
308+
309+
strategy:
310+
fail-fast: true
311+
312+
name: SQL Server 2017
313+
314+
steps:
315+
- name: Checkout code
316+
uses: actions/checkout@v4
317+
318+
- name: Setup PHP
319+
uses: shivammathur/setup-php@v2
320+
with:
321+
php-version: 8.3
322+
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlsrv, pdo, pdo_sqlsrv, odbc, pdo_odbc, :php-psr
323+
tools: composer:v2
324+
coverage: none
325+
326+
- name: Set Framework version
327+
run: composer config version "13.x-dev"
328+
329+
- name: Install dependencies
330+
uses: nick-fields/retry@v3
331+
with:
332+
timeout_minutes: 5
333+
max_attempts: 5
334+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
335+
336+
- name: Execute tests
337+
run: vendor/bin/phpunit tests/Integration/Database
338+
env:
339+
DB_CONNECTION: sqlsrv
340+
DB_DATABASE: master
341+
DB_USERNAME: SA
342+
DB_PASSWORD: Forge123
343343

344344
sqlite:
345345
runs-on: ubuntu-24.04

CHANGELOG.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
# Release Notes for 12.x
22

3-
## [Unreleased](https://github.com/laravel/framework/compare/v12.13.0...12.x)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v12.14.0...12.x)
4+
5+
## [v12.14.0](https://github.com/laravel/framework/compare/v12.13.0...v12.14.0) - 2025-05-13
6+
7+
* [12.x] Support `useCurrent` on date and year column types by [@nicholasbrantley](https://github.com/nicholasbrantley) in https://github.com/laravel/framework/pull/55619
8+
* [12.x] Update "Number::fileSize" to use correct prefix and add prefix param by [@Boy132](https://github.com/Boy132) in https://github.com/laravel/framework/pull/55678
9+
* [12.x] Update PHPDoc for whereRaw to allow Expression as $sql by [@mitoop](https://github.com/mitoop) in https://github.com/laravel/framework/pull/55674
10+
* Revert "[12.x] Make Blueprint Resolver Statically" by [@taylorotwell](https://github.com/taylorotwell) in https://github.com/laravel/framework/pull/55690
11+
* [12.x] Support Virtual Properties When Serializing Models by [@beschoenen](https://github.com/beschoenen) in https://github.com/laravel/framework/pull/55691
12+
* [12.X] Fix `Http::preventStrayRequests` error propagation when using `Http::pool` by [@LeTamanoir](https://github.com/LeTamanoir) in https://github.com/laravel/framework/pull/55689
13+
* [12.x] incorrect use of generics in Schema\Builder by [@taka-oyama](https://github.com/taka-oyama) in https://github.com/laravel/framework/pull/55687
14+
* [12.x] Add option to disable MySQL ssl when restoring or squashing migrations by [@andersonls](https://github.com/andersonls) in https://github.com/laravel/framework/pull/55683
15+
* [12.x] Add `except` and `exceptHidden` methods to `Context` class by [@xurshudyan](https://github.com/xurshudyan) in https://github.com/laravel/framework/pull/55692
16+
* [12.x] Container `currentlyResolving` utility by [@jrseliga](https://github.com/jrseliga) in https://github.com/laravel/framework/pull/55684
17+
* [12.x] Container `currentlyResolving` test by [@jrseliga](https://github.com/jrseliga) in https://github.com/laravel/framework/pull/55694
18+
* [12.x] Fix handling of default values for route parameters with a binding field by [@stancl](https://github.com/stancl) in https://github.com/laravel/framework/pull/55697
19+
* Move Timebox for Authentication and add to password resets by [@valorin](https://github.com/valorin) in https://github.com/laravel/framework/pull/55701
20+
* [12.x] perf: Optimize BladeCompiler by [@rzv-me](https://github.com/rzv-me) in https://github.com/laravel/framework/pull/55703
21+
* [12.x] perf: support iterables for event discovery paths by [@calebdw](https://github.com/calebdw) in https://github.com/laravel/framework/pull/55699
22+
* [12.x] Types: AuthorizesRequests::resourceAbilityMap by [@liamduckett](https://github.com/liamduckett) in https://github.com/laravel/framework/pull/55706
23+
* [12.x] Add flexible support to memoized cache store by [@timacdonald](https://github.com/timacdonald) in https://github.com/laravel/framework/pull/55709
24+
* [12.x] Introduce Arr::from() by [@daniser](https://github.com/daniser) in https://github.com/laravel/framework/pull/55715
25+
* [12.x] Fix the `getCurrentlyAttachedPivots` wrong `morphClass` for morph to many relationships by [@amir9480](https://github.com/amir9480) in https://github.com/laravel/framework/pull/55721
26+
* [12.x] Improve typehints for Http classes by [@cosmastech](https://github.com/cosmastech) in https://github.com/laravel/framework/pull/54783
27+
* Add deleteWhen for throttle exceptions job middleware by [@moshe-autoleadstar](https://github.com/moshe-autoleadstar) in https://github.com/laravel/framework/pull/55718
428

529
## [v12.13.0](https://github.com/laravel/framework/compare/v12.12.0...v12.13.0) - 2025-05-07
630

src/Illuminate/Auth/AuthManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ public function createSessionDriver($name, $config)
126126
$this->createUserProvider($config['provider'] ?? null),
127127
$this->app['session.store'],
128128
rehashOnLogin: $this->app['config']->get('hashing.rehash_on_login', true),
129+
timeboxDuration: $this->app['config']->get('auth.timebox_duration', 200000),
129130
);
130131

131132
// When using the remember me functionality of the authentication services we

src/Illuminate/Auth/Passwords/PasswordBroker.php

Lines changed: 76 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Contracts\Auth\UserProvider;
1010
use Illuminate\Contracts\Events\Dispatcher;
1111
use Illuminate\Support\Arr;
12+
use Illuminate\Support\Timebox;
1213
use UnexpectedValueException;
1314

1415
class PasswordBroker implements PasswordBrokerContract
@@ -34,18 +35,41 @@ class PasswordBroker implements PasswordBrokerContract
3435
*/
3536
protected $events;
3637

38+
/**
39+
* The timebox instance.
40+
*
41+
* @var \Illuminate\Support\Timebox
42+
*/
43+
protected $timebox;
44+
45+
/**
46+
* The number of microseconds that the timebox should wait for.
47+
*
48+
* @var int
49+
*/
50+
protected $timeboxDuration;
51+
3752
/**
3853
* Create a new password broker instance.
3954
*
4055
* @param \Illuminate\Auth\Passwords\TokenRepositoryInterface $tokens
4156
* @param \Illuminate\Contracts\Auth\UserProvider $users
4257
* @param \Illuminate\Contracts\Events\Dispatcher|null $dispatcher
58+
* @param \Illuminate\Support\Timebox|null $timebox
59+
* @param int $timeboxDuration
4360
*/
44-
public function __construct(#[\SensitiveParameter] TokenRepositoryInterface $tokens, UserProvider $users, ?Dispatcher $dispatcher = null)
45-
{
61+
public function __construct(
62+
#[\SensitiveParameter] TokenRepositoryInterface $tokens,
63+
UserProvider $users,
64+
?Dispatcher $dispatcher = null,
65+
?Timebox $timebox = null,
66+
int $timeboxDuration = 200000,
67+
) {
4668
$this->users = $users;
4769
$this->tokens = $tokens;
4870
$this->events = $dispatcher;
71+
$this->timebox = $timebox ?: new Timebox;
72+
$this->timeboxDuration = $timeboxDuration;
4973
}
5074

5175
/**
@@ -57,33 +81,35 @@ public function __construct(#[\SensitiveParameter] TokenRepositoryInterface $tok
5781
*/
5882
public function sendResetLink(#[\SensitiveParameter] array $credentials, ?Closure $callback = null)
5983
{
60-
// First we will check to see if we found a user at the given credentials and
61-
// if we did not we will redirect back to this current URI with a piece of
62-
// "flash" data in the session to indicate to the developers the errors.
63-
$user = $this->getUser($credentials);
84+
return $this->timebox->call(function () use ($credentials, $callback) {
85+
// First we will check to see if we found a user at the given credentials and
86+
// if we did not we will redirect back to this current URI with a piece of
87+
// "flash" data in the session to indicate to the developers the errors.
88+
$user = $this->getUser($credentials);
6489

65-
if (is_null($user)) {
66-
return static::INVALID_USER;
67-
}
90+
if (is_null($user)) {
91+
return static::INVALID_USER;
92+
}
6893

69-
if ($this->tokens->recentlyCreatedToken($user)) {
70-
return static::RESET_THROTTLED;
71-
}
94+
if ($this->tokens->recentlyCreatedToken($user)) {
95+
return static::RESET_THROTTLED;
96+
}
7297

73-
$token = $this->tokens->create($user);
98+
$token = $this->tokens->create($user);
7499

75-
if ($callback) {
76-
return $callback($user, $token) ?? static::RESET_LINK_SENT;
77-
}
100+
if ($callback) {
101+
return $callback($user, $token) ?? static::RESET_LINK_SENT;
102+
}
78103

79-
// Once we have the reset token, we are ready to send the message out to this
80-
// user with a link to reset their password. We will then redirect back to
81-
// the current URI having nothing set in the session to indicate errors.
82-
$user->sendPasswordResetNotification($token);
104+
// Once we have the reset token, we are ready to send the message out to this
105+
// user with a link to reset their password. We will then redirect back to
106+
// the current URI having nothing set in the session to indicate errors.
107+
$user->sendPasswordResetNotification($token);
83108

84-
$this->events?->dispatch(new PasswordResetLinkSent($user));
109+
$this->events?->dispatch(new PasswordResetLinkSent($user));
85110

86-
return static::RESET_LINK_SENT;
111+
return static::RESET_LINK_SENT;
112+
}, $this->timeboxDuration);
87113
}
88114

89115
/**
@@ -95,25 +121,29 @@ public function sendResetLink(#[\SensitiveParameter] array $credentials, ?Closur
95121
*/
96122
public function reset(#[\SensitiveParameter] array $credentials, Closure $callback)
97123
{
98-
$user = $this->validateReset($credentials);
124+
return $this->timebox->call(function ($timebox) use ($credentials, $callback) {
125+
$user = $this->validateReset($credentials);
99126

100-
// If the responses from the validate method is not a user instance, we will
101-
// assume that it is a redirect and simply return it from this method and
102-
// the user is properly redirected having an error message on the post.
103-
if (! $user instanceof CanResetPasswordContract) {
104-
return $user;
105-
}
127+
// If the responses from the validate method is not a user instance, we will
128+
// assume that it is a redirect and simply return it from this method and
129+
// the user is properly redirected having an error message on the post.
130+
if (! $user instanceof CanResetPasswordContract) {
131+
return $user;
132+
}
106133

107-
$password = $credentials['password'];
134+
$password = $credentials['password'];
108135

109-
// Once the reset has been validated, we'll call the given callback with the
110-
// new password. This gives the user an opportunity to store the password
111-
// in their persistent storage. Then we'll delete the token and return.
112-
$callback($user, $password);
136+
// Once the reset has been validated, we'll call the given callback with the
137+
// new password. This gives the user an opportunity to store the password
138+
// in their persistent storage. Then we'll delete the token and return.
139+
$callback($user, $password);
113140

114-
$this->tokens->delete($user);
141+
$this->tokens->delete($user);
142+
143+
$timebox->returnEarly();
115144

116-
return static::PASSWORD_RESET;
145+
return static::PASSWORD_RESET;
146+
}, $this->timeboxDuration);
117147
}
118148

119149
/**
@@ -199,4 +229,14 @@ public function getRepository()
199229
{
200230
return $this->tokens;
201231
}
232+
233+
/**
234+
* Get the timebox instance used by the guard.
235+
*
236+
* @return \Illuminate\Support\Timebox
237+
*/
238+
public function getTimebox()
239+
{
240+
return $this->timebox;
241+
}
202242
}

src/Illuminate/Auth/Passwords/PasswordBrokerManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ protected function resolve($name)
7070
$this->createTokenRepository($config),
7171
$this->app['auth']->createUserProvider($config['provider'] ?? null),
7272
$this->app['events'] ?? null,
73+
timeboxDuration: $this->app['config']->get('auth.timebox_duration', 200000),
7374
);
7475
}
7576

0 commit comments

Comments
 (0)
0