Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon committed Mar 15, 2024
1 parent 50e908a commit d57b7f4
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion api/composer.json
Expand Up @@ -34,7 +34,6 @@
"symfony/validator": "7.0.*",
"symfony/yaml": "7.0.*",
"web-token/jwt-bundle": "^3.3",
"web-token/jwt-library": "^3.3",
"webonyx/graphql-php": "^15.8",
"zenstruck/foundry": "^1.36"
},
Expand Down
2 changes: 1 addition & 1 deletion api/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/config/packages/framework.yaml
Expand Up @@ -26,6 +26,7 @@ framework:

http_client:
scoped_clients:
# use scoped client to ease mock on functional tests
security.authorization.client:
base_uri: '%env(OIDC_SERVER_URL_INTERNAL)%/'

Expand Down
8 changes: 4 additions & 4 deletions api/config/packages/security.yaml
Expand Up @@ -29,13 +29,13 @@ when@prod: &prod
main:
access_token:
token_handler: App\Security\Http\AccessToken\Oidc\OidcDiscoveryTokenHandler
# todo support Discovery in Symfony
# oidc:
# claim: 'email'
# todo support Discovery in Symfony
# oidc:
# claim: 'email'
# base_uri: '%env(OIDC_SERVER_URL)%'
# audience: '%env(OIDC_AUD)%'
# cache: '@cache.app' # default
# cache_ttl: 3600 # default
# cache_ttl: 600 # default

when@dev: *prod

Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Bookmark.php
Expand Up @@ -36,7 +36,7 @@
operations: [
new GetCollection(),
new Delete(
security: 'object.user == user'
security: 'object.user === user'
),
new Post(
processor: BookmarkPersistProcessor::class
Expand Down
4 changes: 2 additions & 2 deletions api/src/Entity/Review.php
Expand Up @@ -111,7 +111,7 @@
'bookId' => new Link(toProperty: 'book', fromClass: Book::class),
'id' => new Link(fromClass: Review::class),
],
security: 'object.user == user or is_granted("ADMIN")',
security: 'object.user === user',
// Mercure publish is done manually in MercureProcessor through ReviewPersistProcessor
processor: ReviewPersistProcessor::class
),
Expand All @@ -121,7 +121,7 @@
'bookId' => new Link(toProperty: 'book', fromClass: Book::class),
'id' => new Link(fromClass: Review::class),
],
security: 'object.user == user or is_granted("ADMIN")',
security: 'object.user === user',
// Mercure publish is done manually in MercureProcessor through ReviewRemoveProcessor
processor: ReviewRemoveProcessor::class
),
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/User.php
Expand Up @@ -40,7 +40,7 @@
),
new Get(
uriTemplate: '/users/{id}{._format}',
security: 'user.sub === object.sub'
security: 'object.sub === user.sub'
),
],
normalizationContext: [
Expand Down
Expand Up @@ -33,7 +33,7 @@ public function __construct(
private JWSLoader $jwsLoader,
private readonly HttpClientInterface $securityAuthorizationClient,
private string $claim = 'email',
private int $ttl = 3600,
private int $ttl = 600,
private ?LoggerInterface $logger = null,
) {
}
Expand Down

0 comments on commit d57b7f4

Please sign in to comment.