Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/0x-First-Prototype' into 6-trans…
Browse files Browse the repository at this point in the history
…lation-endpoint

# Conflicts:
#	config/services.yaml
#	src/Exception/NoRequestException.php
  • Loading branch information
mattamon committed Mar 5, 2024
2 parents 6309abf + c20d2d8 commit 22d58c4
Show file tree
Hide file tree
Showing 102 changed files with 38,972 additions and 170 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/php-cs-fixer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ name: "PHP-CS-Fixer"
on:
pull_request:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"
- "feature-*"
- "*"
push:
branches:
- "[0-9]+.[0-9]+"
Expand Down
7 changes: 5 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => 'Pimcore' . PHP_EOL . PHP_EOL .
'This source file is available under following license:' . PHP_EOL .
'This source file is available under two different licenses:' . PHP_EOL .
'- GNU General Public License version 3 (GPLv3)' . PHP_EOL .
'- Pimcore Commercial License (PCL)' . PHP_EOL .
'Full copyright and license information is available in' . PHP_EOL .
'LICENSE.md which is distributed with this source code.' . PHP_EOL .
PHP_EOL .
' @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)' . PHP_EOL .
' @license http://www.pimcore.org/license PCL'
' @license http://www.pimcore.org/license GPLv3 and PCL'
],

'blank_line_before_statement' => true,
Expand Down
31 changes: 28 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
# License
Copyright (C) Pimcore GmbH

This software is available under following license:
This software is available under two different licenses:
* GNU General Public License version 3 (GPLv3) as Pimcore Community Edition
* Pimcore Commercial License (PCL)

The default Pimcore license, without a valid Pimcore Commercial License agreement, is the Open-Source GPLv3 license.

## GNU General Public License version 3 (GPLv3)
If you decide to choose the GPLv3 license, you must comply with the following terms:

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

## Pimcore Commercial License (PCL)
Commercial and supported versions of the program - also known as
Alternatively, commercial and supported versions of the program - also known as
Commercial Distributions - must be used in accordance with the terms and conditions
contained in a separate written agreement between you and Pimcore GmbH.
For more information about the Pimcore Commercial License (PCL) please contact [email protected].
For more information about the Pimcore Commercial License (PCL) please contact [email protected].



Please see also (files in this directory):
- [Licensing FAQ - license-faq.md](https://github.com/pimcore/pimcore/blob/master/license-faq.md)
- [GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - gpl-3.0.txt](gpl-3.0.txt)
1 change: 1 addition & 0 deletions config/api_platform/resources/asset.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
resources:
Pimcore\Bundle\StudioApiBundle\Dto\Asset:
#security: 'is_granted("API_PLATFORM")'
operations:
ApiPlatform\Metadata\GetCollection:
filters:
Expand Down
13 changes: 13 additions & 0 deletions config/api_platform/resources/token/create.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resources:
Pimcore\Bundle\StudioApiBundle\Dto\Token\Create:
shortName: Token-Create
operations:
ApiPlatform\Metadata\Post:
processor: Pimcore\Bundle\StudioApiBundle\State\Token\Create\Processor
output: Pimcore\Bundle\StudioApiBundle\Dto\Token\Output
uriTemplate: '/token/create'
openapiContext:
summary: 'Creates and returns a token'

normalizationContext:
groups: [ 'token:read' ]
13 changes: 13 additions & 0 deletions config/api_platform/resources/token/refresh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resources:
Pimcore\Bundle\StudioApiBundle\Dto\Token\Refresh:
shortName: Token-Refresh
operations:
ApiPlatform\Metadata\Post:
processor: Pimcore\Bundle\StudioApiBundle\State\Token\Refresh\Processor
output: Pimcore\Bundle\StudioApiBundle\Dto\Token\Output
uriTemplate: '/token/refresh'
openapiContext:
summary: 'Refreshes an existing token'

normalizationContext:
groups: [ 'tokenrefresh:read' ]
8 changes: 7 additions & 1 deletion config/pimcore/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ api_platform:
enable_docs: true
enable_entrypoint: false
enable_swagger_ui: false
enable_re_doc: false
enable_re_doc: false
show_webby: false
swagger:
api_keys:
access_token:
name: 'Authorization'
type: 'header'
10 changes: 10 additions & 0 deletions config/serialization/token.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Pimcore\Bundle\StudioApiBundle\Dto\Token\Output:
attributes:
token:
groups: ['token:read', 'tokenrefresh:read']
username:
groups: [ 'token:read' , 'tokenrefresh:read']
lifetime:
groups: ['token:read', 'tokenrefresh:read']
validUntil:
groups: ['token:read', 'tokenrefresh:read']
26 changes: 25 additions & 1 deletion config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ services:
# Processors
Pimcore\Bundle\StudioApiBundle\State\ResetPasswordProcessor: ~
Pimcore\Bundle\StudioApiBundle\State\TranslationProcessor: ~
Pimcore\Bundle\StudioApiBundle\State\Token\Create\Processor: ~
Pimcore\Bundle\StudioApiBundle\State\Token\Refresh\Processor: ~

# Filters
Pimcore\Bundle\StudioApiBundle\Filter\AssetParentIdFilter:
Expand Down Expand Up @@ -91,4 +93,26 @@ services:
Pimcore\Bundle\StudioApiBundle\Security\Voter\PublicTokenVoter:
arguments: [ '@request_stack' ]
tags:
- { name: security.voter }
- { name: security.voter }

Pimcore\Bundle\StudioApiBundle\Service\TokenServiceInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\TokenService

Pimcore\Bundle\StudioApiBundle\Service\SecurityServiceInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\SecurityService


#Voters
Pimcore\Bundle\StudioApiBundle\Security\Voter\TokenVoter:
arguments: ['@request_stack']
tags:
- { name: security.voter }

Pimcore\Bundle\StudioApiBundle\Security\Voter\PublicTokenVoter:
arguments: [ '@request_stack' ]
tags:
- { name: security.voter }

#Decorators
Pimcore\Bundle\StudioApiBundle\ApiPlatform\OpenApiFactoryDecorator:
decorates: 'api_platform.openapi.factory'
Loading

0 comments on commit 22d58c4

Please sign in to comment.