Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
url=$release-demo.api-platform.com
fi
echo "url=$url" >> "$GITHUB_OUTPUT"
cors="https://$url|http://localhost|https://localhost|http://localhost:3000"
cors="https://$url|http://localhost|https://localhost|http://localhost:3000|https://api-platform.github.io"
set -o pipefail
helm upgrade $release ./helm/api-platform -f ./helm/api-platform/values.yaml \
--install \
Expand Down
1 change: 1 addition & 0 deletions api/config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ doctrine:

profiling_collect_backtrace: '%kernel.debug%'
orm:
enable_native_lazy_objects: true
validate_xml_mapping: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
identity_generation_preferences:
Expand Down
1 change: 1 addition & 0 deletions api/src/Entity/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
*/
#[ApiResource(
uriTemplate: '/admin/books{._format}',
shortName: 'AdminBook',
types: [
'https://schema.org/Book',
'https://schema.org/Offer',
Expand Down
1 change: 1 addition & 0 deletions api/src/Entity/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
* @see https://schema.org/Review
*/
#[ApiResource(
shortName: 'AdminReview',
types: ['https://schema.org/Review'],
operations: [
new GetCollection(
Expand Down
10 changes: 10 additions & 0 deletions api/src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* @see https://schema.org/Person
*/
#[ApiResource(
shortName: 'AdminUser',
types: ['https://schema.org/Person'],
operations: [
new GetCollection(
Expand All @@ -38,6 +39,15 @@
uriTemplate: '/admin/users/{id}{._format}',
security: 'is_granted("OIDC_ADMIN")'
),
],
normalizationContext: [
AbstractNormalizer::GROUPS => ['User:read'],
AbstractObjectNormalizer::SKIP_NULL_VALUES => true,
]
)]
#[ApiResource(
types: ['https://schema.org/Person'],
operations: [
new Get(
uriTemplate: '/users/{id}{._format}',
security: 'object === user'
Expand Down
2 changes: 1 addition & 1 deletion api/tests/Api/Admin/schemas/Book/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@context": {
"readOnly": true,
"type": "string",
"pattern": "^/contexts/Book$"
"pattern": "^/contexts/AdminBook$"
},
"@type": {
"readOnly": true,
Expand Down
2 changes: 1 addition & 1 deletion api/tests/Api/Admin/schemas/Book/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@context": {
"readOnly": true,
"type": "string",
"pattern": "^/contexts/Book$"
"pattern": "^/contexts/AdminBook$"
},
"@type": {
"readOnly": true,
Expand Down
2 changes: 1 addition & 1 deletion api/tests/Api/Admin/schemas/Review/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"@context": {
"readOnly": true,
"type": "string",
"pattern": "^/contexts/Review$"
"pattern": "^/contexts/AdminReview$"
},
"@type": {
"readOnly": true,
Expand Down
2 changes: 1 addition & 1 deletion api/tests/Api/Admin/schemas/Review/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@context": {
"readOnly": true,
"type": "string",
"pattern": "^/contexts/Review$"
"pattern": "^/contexts/AdminReview$"
},
"@id": {
"readOnly": true,
Expand Down
2 changes: 1 addition & 1 deletion api/tests/Api/Admin/schemas/User/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@context": {
"readOnly": true,
"type": "string",
"pattern": "^/contexts/User$"
"pattern": "^/contexts/AdminUser$"
},
"@type": {
"readOnly": true,
Expand Down
2 changes: 1 addition & 1 deletion api/tests/Api/Admin/schemas/User/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@context": {
"readOnly": true,
"type": "string",
"pattern": "^/contexts/User$"
"pattern": "^/contexts/AdminUser$"
},
"@id": {
"readOnly": true,
Expand Down
Loading