Skip to content

Commit

Permalink
Merge branch hotfix/v2.3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Jun 19, 2024
1 parent a95c071 commit 774213f
Show file tree
Hide file tree
Showing 31 changed files with 41 additions and 288 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2023 Ambroise Maupate, Julien Blanchet
Copyright © 2024 Ambroise Maupate, Julien Blanchet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ roadiz_rozier:
open_id:
# Verify User info in JWT at each login
verify_user_info: false
# Force generating redirect uri with https scheme. (required by some OpenID providers)
force_ssl_on_redirect_uri: true
# Standard OpenID autodiscovery URL, required to enable OpenId login in Roadiz CMS.
discovery_url: '%env(string:OPEN_ID_DISCOVERY_URL)%'
# For public identity providers (such as Google), restrict users emails by their domain.
Expand Down
15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
}
],
"type": "symfony-bundle",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"symfony/framework-bundle": "5.4.*",
"roadiz/core-bundle": "2.2.*",
"roadiz/rozier": "2.2.*",
"roadiz/compat-bundle": "2.2.*",
"roadiz/openid": "2.2.*"
"symfony/framework-bundle": "6.4.*",
"roadiz/core-bundle": "2.3.*",
"roadiz/rozier": "2.3.*",
"roadiz/compat-bundle": "2.3.*",
"roadiz/openid": "2.3.*"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.4",
Expand Down Expand Up @@ -54,8 +55,8 @@
},
"extra": {
"branch-alias": {
"dev-main": "2.2.x-dev",
"dev-develop": "2.3.x-dev"
"dev-main": "2.3.x-dev",
"dev-develop": "2.4.x-dev"
}
}
}
1 change: 1 addition & 0 deletions config/packages/roadiz_rozier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ roadiz_rozier:
# OpenID identity provider OAuth2 client secret
oauth_client_secret: '%env(string:OPEN_ID_CLIENT_SECRET)%'
requires_local_user: false
force_ssl_on_redirect_uri: true
# Only when local users are not required, creating virtual users
# with following roles.
granted_roles:
Expand Down
3 changes: 3 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ services:
$addNodeFormTypeClass: '%roadiz_rozier.add_node_form.class%'
$googleServerId: '%roadiz_core.medias.google_server_id%'
$soundcloudClientId: '%roadiz_core.medias.soundcloud_client_id%'
$allowNodeTypeEdition: '%kernel.debug%'
$forceSslOnRedirectUri: '%roadiz_rozier.open_id.force_ssl_on_redirect_uri%'
$useGravatar: '%roadiz_core.use_gravatar%'

RZ\Roadiz\RozierBundle\:
resource: '../src/'
Expand Down
6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: 6
level: 7
paths:
- src
doctrine:
Expand All @@ -9,6 +9,8 @@ parameters:
- */bower_components/*
- */static/*
ignoreErrors:
- identifier: missingType.iterableValue
- identifier: missingType.generics
- '#Call to an undefined method RZ\\Roadiz\\CoreBundle\\Repository#'
- '#Call to an undefined method RZ\\Roadiz\\UserBundle\\Repository#'
- '#Call to an undefined method Doctrine\\Persistence\\ObjectRepository#'
Expand All @@ -32,8 +34,6 @@ parameters:
- '#does not accept Doctrine\\Common\\Collections\\ReadableCollection<int, [^\>]+>#'

reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
includes:
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-doctrine/rules.neon
6 changes: 1 addition & 5 deletions src/Aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ final class Aliases
*/
public static function getAliases(): array
{
return [
\RZ\Roadiz\RozierBundle\Form\DocumentTranslationType::class => \Themes\Rozier\Forms\DocumentTranslationType::class,
\RZ\Roadiz\RozierBundle\Form\CustomFormType::class => \Themes\Rozier\Forms\CustomFormType::class,
\RZ\Roadiz\RozierBundle\ListManager\SessionListFilters::class => \Themes\Rozier\Utils\SessionListFilters::class,
];
return [];
}
}
2 changes: 1 addition & 1 deletion src/Controller/Document/DocumentDuplicatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Doctrine\Persistence\ManagerRegistry;
use RZ\Roadiz\CoreBundle\Entity\Document;
use RZ\Roadiz\CoreBundle\ListManager\QueryBuilderListManager;
use RZ\Roadiz\CoreBundle\ListManager\SessionListFilters;
use RZ\Roadiz\CoreBundle\Repository\DocumentRepository;
use RZ\Roadiz\RozierBundle\ListManager\SessionListFilters;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Themes\Rozier\RozierApp;
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Document/DocumentPublicListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use RZ\Roadiz\CoreBundle\Entity\Document;
use RZ\Roadiz\CoreBundle\Entity\Folder;
use RZ\Roadiz\CoreBundle\Entity\Translation;
use RZ\Roadiz\CoreBundle\ListManager\SessionListFilters;
use RZ\Roadiz\Documents\Events\DocumentInFolderEvent;
use RZ\Roadiz\Documents\Events\DocumentOutFolderEvent;
use Symfony\Component\Form\ClickableInterface;
Expand All @@ -19,7 +20,6 @@
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotNull;
use Themes\Rozier\RozierApp;
use Themes\Rozier\Utils\SessionListFilters;
use Twig\Error\RuntimeError;

class DocumentPublicListController extends RozierApp
Expand Down
6 changes: 4 additions & 2 deletions src/Controller/Document/DocumentUnusedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
use Doctrine\Persistence\ManagerRegistry;
use RZ\Roadiz\CoreBundle\Entity\Document;
use RZ\Roadiz\CoreBundle\ListManager\QueryBuilderListManager;
use RZ\Roadiz\CoreBundle\ListManager\SessionListFilters;
use RZ\Roadiz\CoreBundle\Repository\DocumentRepository;
use RZ\Roadiz\RozierBundle\ListManager\SessionListFilters;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Themes\Rozier\RozierApp;
use Twig\Error\RuntimeError;

final class DocumentUnusedController extends RozierApp
{
Expand All @@ -28,8 +29,9 @@ public function __construct(ManagerRegistry $managerRegistry)
/**
* See unused documents.
*
* @param Request $request
* @param Request $request
* @return Response
* @throws RuntimeError
*/
public function unusedAction(Request $request): Response
{
Expand Down
8 changes: 2 additions & 6 deletions src/Controller/Node/RealmNodeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ public function defaultAction(Request $request, Node $id): Response
'node.%node%.joined.%realm%',
[
'%node%' => $nodeSource->getTitle(),
'%realm%' => $realmNode->getRealm() ?
$realmNode->getRealm()->getName() :
$this->translator->trans('node.no_realm')
'%realm%' => $realmNode->getRealm()->getName()
]
);
$this->publishConfirmMessage($request, $msg);
Expand Down Expand Up @@ -118,9 +116,7 @@ public function deleteAction(Request $request, int $id, int $realmNodeId): Respo
'node.%node%.left.%realm%',
[
'%node%' => $nodeSource->getTitle(),
'%realm%' => $realmNode->getRealm() ?
$realmNode->getRealm()->getName() :
$this->translator->trans('node.no_realm')
'%realm%' => $realmNode->getRealm()->getName()
]
);
$this->publishConfirmMessage($request, $msg);
Expand Down
2 changes: 0 additions & 2 deletions src/DependencyInjection/Compiler/RozierPathsCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

namespace RZ\Roadiz\RozierBundle\DependencyInjection\Compiler;

use RZ\Roadiz\RozierBundle\DependencyInjection\Configuration;
use Symfony\Component\Asset\PathPackage;
use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
Expand Down
7 changes: 7 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ protected function addOpenIdNode()
->defaultTrue()
->info(<<<EOD
Verify User info in JWT at each login
EOD
)
->end()
->booleanNode('force_ssl_on_redirect_uri')
->defaultTrue()
->info(<<<EOD
Force generating redirect uri with https scheme. (required by some OpenID providers)
EOD
)
->end()
Expand Down
7 changes: 6 additions & 1 deletion src/DependencyInjection/RoadizRozierExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function load(array $configs, ContainerBuilder $container): void
private function registerOpenId(array $config, ContainerBuilder $container): void
{
$container->setParameter('roadiz_rozier.open_id.verify_user_info', $config['open_id']['verify_user_info']);
$container->setParameter('roadiz_rozier.open_id.force_ssl_on_redirect_uri', $config['open_id']['force_ssl_on_redirect_uri']);
$container->setParameter('roadiz_rozier.open_id.discovery_url', $config['open_id']['discovery_url']);
$container->setParameter('roadiz_rozier.open_id.hosted_domain', $config['open_id']['hosted_domain']);
$container->setParameter('roadiz_rozier.open_id.oauth_client_id', $config['open_id']['oauth_client_id']);
Expand All @@ -65,7 +66,9 @@ private function registerOpenId(array $config, ContainerBuilder $container): voi
->setPublic(true)
->setArguments([
$config['open_id']['discovery_url'],
new Reference(\Psr\Cache\CacheItemPoolInterface::class)
new Reference(\Psr\Cache\CacheItemPoolInterface::class),
new Reference(\Symfony\Contracts\HttpClient\HttpClientInterface::class),
new Reference(\Psr\Log\LoggerInterface::class)
])
);
}
Expand Down Expand Up @@ -97,10 +100,12 @@ private function registerOpenId(array $config, ContainerBuilder $container): voi
new Reference(\RZ\Roadiz\OpenId\Authentication\Provider\ChainJwtRoleStrategy::class),
new Reference('roadiz_rozier.open_id.jwt_configuration_factory'),
new Reference(\Symfony\Component\Routing\Generator\UrlGeneratorInterface::class),
new Reference(\Symfony\Contracts\HttpClient\HttpClientInterface::class),
'loginPage',
'adminHomePage',
$config['open_id']['oauth_client_id'],
$config['open_id']['oauth_client_secret'],
$config['open_id']['force_ssl_on_redirect_uri'],
$config['open_id']['requires_local_user'],
$config['open_id']['openid_username_claim'],
'_target_path',
Expand Down
121 changes: 0 additions & 121 deletions src/Form/CustomFormType.php

This file was deleted.

Loading

0 comments on commit 774213f

Please sign in to comment.