Skip to content

Commit dbf6085

Browse files
committed
Merge 3.3
2 parents 2055e08 + 4062853 commit dbf6085

File tree

5 files changed

+34
-3
lines changed

5 files changed

+34
-3
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,13 @@ You should now install `api-platform/symfony` instead of `api-platform/core`.
265265
* [74986cb55](https://github.com/api-platform/core/commit/74986cb552182dc645bd1fc967faa0954dd59e0a) feat: inflector as service (#6447)
266266
* [b47edb2a4](https://github.com/api-platform/core/commit/b47edb2a499c34e79c167f963e3a626a3e9d040a) feat(serializer): context IRI in HAL or JsonApi format (#6215)
267267

268+
## v3.3.15
269+
270+
### Bug fixes
271+
272+
* [dc4fc84ba](https://github.com/api-platform/core/commit/dc4fc84ba93e22b4f44a37e90a93c6d079c1c620) fix(graphql): securityAfterResolver not called
273+
* [9eb5c4e94](https://github.com/api-platform/core/commit/9eb5c4e941d0ebf59bc8ef5777b144db9b4a0899) fix(symfony): suggest `DocumentationAction` as replacement for deprecated `SwaggerUiAction` (#6894)
274+
268275
## v3.3.14
269276

270277
### Bug fixes
@@ -2707,4 +2714,4 @@ Please read #2825 if you have issues with the behavior of Readable/Writable Link
27072714
## 1.0.0 beta 2
27082715

27092716
* Preserve indexes when normalizing and denormalizing associative arrays
2710-
* Allow setting default order for property when registering a `Doctrine\Orm\Filter\OrderFilter` instance
2717+
* Allow setting default order for property when registering a `Doctrine\Orm\Filter\OrderFilter` instance

features/graphql/query.feature

+17
Original file line numberDiff line numberDiff line change
@@ -677,3 +677,20 @@ Feature: GraphQL query support
677677
Then the response status code should be 200
678678
And the header "Content-Type" should be equal to "application/json"
679679
And the JSON node "data.getSecurityAfterResolver.name" should be equal to "test"
680+
681+
682+
Scenario: Call security after resolver with 403 error (ensure /2 does not match securityAfterResolver)
683+
When I send the following GraphQL request:
684+
""""
685+
{
686+
getSecurityAfterResolver(id: "/security_after_resolvers/2") {
687+
name
688+
}
689+
}
690+
"""
691+
Then the response status code should be 200
692+
And the response should be in JSON
693+
And the header "Content-Type" should be equal to "application/json"
694+
And the JSON node "errors[0].extensions.status" should be equal to 403
695+
And the JSON node "errors[0].message" should be equal to "Access Denied."
696+
And the JSON node "data.getSecurityAfterResolver.name" should not exist

src/Symfony/Bundle/SwaggerUi/SwaggerUiAction.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/**
2727
* Displays the swaggerui interface.
2828
*
29-
* @deprecated use ApiPlatform\Symfony\Bundle\SwaggerUi\Processor instead
29+
* @deprecated use ApiPlatform\Symfony\Action\DocumentationAction instead
3030
*
3131
* @author Antoine Bluchet <[email protected]>
3232
*/

src/Symfony/Security/State/AccessCheckerProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function provide(Operation $operation, array $uriVariables = [], array $c
5353

5454
$isGranted = $operation->getSecurityAfterResolver();
5555
$message = $operation->getSecurityMessageAfterResolver();
56-
// no break
56+
break;
5757
default:
5858
$isGranted = $operation->getSecurity();
5959
$message = $operation->getSecurityMessage();

tests/Fixtures/TestBundle/ApiResource/Issue6427/SecurityAfterResolverResolver.php

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ final class SecurityAfterResolverResolver implements QueryItemResolverInterface
2323
*/
2424
public function __invoke($item, array $context): SecurityAfterResolver
2525
{
26+
$idUrl = $context['args']['id'];
27+
28+
if (str_contains($idUrl, '2')) {
29+
// Unknown to simulate a 403 error
30+
return new SecurityAfterResolver('2', 'nonexistent');
31+
}
32+
2633
return new SecurityAfterResolver('1', 'test');
2734
}
2835
}

0 commit comments

Comments
 (0)