Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade #2

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
cd9fd36
TASK: Import core migration log to composer.json
dimaip Feb 25, 2019
a7085c4
TASK: Apply migration TYPO3.FLOW3-201201261636
dimaip Feb 25, 2019
2b6e788
TASK: Apply migration TYPO3.Fluid-201205031303
dimaip Feb 25, 2019
ae7fa46
TASK: Apply migration TYPO3.FLOW3-201205292145
dimaip Feb 25, 2019
bc535a9
TASK: Apply migration TYPO3.FLOW3-201206271128
dimaip Feb 25, 2019
aa9cc18
TASK: Apply migration TYPO3.FLOW3-201209201112
dimaip Feb 25, 2019
7fa916d
TASK: Apply migration TYPO3.Flow-201209251426
dimaip Feb 25, 2019
6574ebe
TASK: Apply migration TYPO3.Flow-201211151101
dimaip Feb 25, 2019
2fba78e
TASK: Apply migration TYPO3.Flow-201212051340
dimaip Feb 25, 2019
03dff49
TASK: Apply migration TYPO3.TypoScript-130516234520
dimaip Feb 25, 2019
83fd347
TASK: Apply migration TYPO3.TypoScript-130516235550
dimaip Feb 25, 2019
f1429f6
TASK: Apply migration TYPO3.TYPO3CR-130523180140
dimaip Feb 25, 2019
3db3171
TASK: Apply migration TYPO3.Flow-201310031523
dimaip Feb 25, 2019
65388b5
TASK: Apply migration TYPO3.Flow-201405111147
dimaip Feb 25, 2019
cd441fe
TASK: Apply migration TYPO3.Neos-201409071922
dimaip Feb 25, 2019
e3b4165
TASK: Apply migration TYPO3.TYPO3CR-140911160326
dimaip Feb 25, 2019
9d655f1
TASK: Apply migration TYPO3.Neos-201410010000
dimaip Feb 25, 2019
232490c
TASK: Apply migration TYPO3.TYPO3CR-141101082142
dimaip Feb 25, 2019
3f9b4b1
TASK: Apply migration TYPO3.Neos-20141113115300
dimaip Feb 25, 2019
4fae2a9
TASK: Apply migration TYPO3.Fluid-20141113120800
dimaip Feb 25, 2019
c7f17c7
TASK: Apply migration TYPO3.Flow-20141113121400
dimaip Feb 25, 2019
e26f0fd
TASK: Apply migration TYPO3.Fluid-20141121091700
dimaip Feb 25, 2019
00cb8cf
TASK: Apply migration TYPO3.Neos-20141218134700
dimaip Feb 25, 2019
361357b
TASK: Apply migration TYPO3.Fluid-20150214130800
dimaip Feb 25, 2019
8cdab34
TASK: Apply migration TYPO3.Neos-20150303231600
dimaip Feb 25, 2019
af68964
TASK: Apply migration TYPO3.TYPO3CR-20150510103823
dimaip Feb 25, 2019
b83b91a
TASK: Apply migration TYPO3.Flow-20151113161300
dimaip Feb 25, 2019
a118d44
TASK: Apply migration TYPO3.Form-20160601101500
dimaip Feb 25, 2019
49e1bc3
TASK: Apply migration TYPO3.Flow-20161115140400
dimaip Feb 25, 2019
15e3389
TASK: Apply migration TYPO3.Flow-20161115140430
dimaip Feb 25, 2019
603ce29
TASK: Apply migration Neos.Flow-20161124204700
dimaip Feb 25, 2019
e735a2e
TASK: Apply migration Neos.Flow-20161124204701
dimaip Feb 25, 2019
1e524b6
TASK: Apply migration Neos.Twitter.Bootstrap-20161124204912
dimaip Feb 25, 2019
d3e48de
TASK: Apply migration Neos.Form-20161124205254
dimaip Feb 25, 2019
4835c94
TASK: Apply migration Neos.Flow-20161124224015
dimaip Feb 25, 2019
5ac8bc6
TASK: Apply migration Neos.Party-20161124225257
dimaip Feb 25, 2019
fd5dae5
TASK: Apply migration Neos.Eel-20161124230101
dimaip Feb 25, 2019
270e5c8
TASK: Apply migration Neos.Setup-20161124230842
dimaip Feb 25, 2019
324f358
TASK: Apply migration Neos.Imagine-20161124231742
dimaip Feb 25, 2019
c44cb3c
TASK: Apply migration Neos.Media-20161124233100
dimaip Feb 25, 2019
fb94c67
TASK: Apply migration Neos.Neos-20161125002322
dimaip Feb 25, 2019
ffc1a9c
TASK: Apply migration Neos.ContentRepository-20161125012000
dimaip Feb 25, 2019
390acf4
TASK: Apply migration Neos.Fusion-20161125013710
dimaip Feb 25, 2019
5e5842c
TASK: Apply migration Neos.Setup-20161125014759
dimaip Feb 25, 2019
d179c2b
TASK: Apply migration Neos.Fusion-20161125104701
dimaip Feb 25, 2019
b755b09
TASK: Apply migration Neos.Neos-20161125104802
dimaip Feb 25, 2019
54a6ac5
TASK: Apply migration Neos.Neos-20161125122412
dimaip Feb 25, 2019
cff6b50
TASK: Apply migration Neos.Flow-20161125124112
dimaip Feb 25, 2019
549c30b
TASK: Apply migration TYPO3.FluidAdaptor-20161130112935
dimaip Feb 25, 2019
7ac006d
TASK: Apply migration Neos.Fusion-20161201202543
dimaip Feb 25, 2019
2a85b80
TASK: Apply migration Neos.Neos-20161201222211
dimaip Feb 25, 2019
875a5f4
TASK: Apply migration Neos.Fusion-20161202215034
dimaip Feb 25, 2019
e600f74
TASK: Apply migration Neos.ContentRepository.Search-20161210231100
dimaip Feb 25, 2019
d14ec9b
TASK: Apply migration Neos.Fusion-20161219092345
dimaip Feb 25, 2019
9fe8bb9
TASK: Apply migration Neos.ContentRepository-20161219093512
dimaip Feb 25, 2019
8076321
TASK: Apply migration Neos.Media-20161219094126
dimaip Feb 25, 2019
319628b
TASK: Apply migration Neos.Neos-20161219094403
dimaip Feb 25, 2019
3fe3e8e
TASK: Apply migration Neos.Neos-20161219122512
dimaip Feb 25, 2019
4b30380
TASK: Apply migration Neos.Fusion-20161219130100
dimaip Feb 25, 2019
39eabb0
TASK: Apply migration Neos.Neos-20161220163741
dimaip Feb 25, 2019
9354a33
TASK: Apply migration Neos.Neos-20170115114620
dimaip Feb 25, 2019
77514c6
TASK: Apply migration Neos.Fusion-20170120013047
dimaip Feb 25, 2019
f81bbab
TASK: Apply migration Neos.Flow-20170125103800
dimaip Feb 25, 2019
0382443
TASK: Apply migration Neos.Seo-20170127154600
dimaip Feb 25, 2019
8309f99
TASK: Apply migration Neos.Flow-20170127183102
dimaip Feb 25, 2019
3252df8
TASK: Apply migration Neos.Fusion-20180211175500
dimaip Feb 25, 2019
6abd896
TASK: Apply migration Neos.Fusion-20180211184832
dimaip Feb 25, 2019
625013c
TASK: Apply migration Neos.Flow-20180415105700
dimaip Feb 25, 2019
27982f4
TASK: Apply migration Neos.Neos-20180907103800
dimaip Feb 25, 2019
2fae128
FEATURE: Authorization eel helper
dimaip Feb 26, 2019
a34718c
!!! TASK: Don't persist account
dimaip Feb 26, 2019
50b8e2d
TASK: fix Google auth
dimaip Feb 26, 2019
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
33 changes: 33 additions & 0 deletions Classes/Flowpack/OAuth2/Client/Eel/AuthorizationHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
namespace Flowpack\OAuth2\Client\Eel;

use Neos\Eel\ProtectedContextAwareInterface;
use Neos\ContentRepository\Domain\Model\NodeInterface;
use Neos\Flow\Annotations as Flow;
use Flowpack\OAuth2\Client\UriBuilder;

class AuthorizationHelper implements ProtectedContextAwareInterface {
/**
* @Flow\Inject
* @var UriBuilder
*/
protected $oauthUriBuilder;

/**
* @param string $providerName
* @return string
*/
public function getAuthorizationUri(string $providerName) {
return $this->oauthUriBuilder->getAuthorizationUri($providerName);
}

/**
* All methods are considered safe
*
* @param string $methodName
* @return boolean
*/
public function allowsCallOfMethod($methodName) {
return true;
}
}
Original file line number Diff line number Diff line change
@@ -12,10 +12,10 @@
* */

use Flowpack\OAuth2\Client\Exception as OAuth2Exception;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Http\Request;
use TYPO3\Flow\Http\Uri;
use TYPO3\Flow\Utility\Arrays;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Http\Request;
use Neos\Flow\Http\Uri;
use Neos\Utility\Arrays;

/**
*/
@@ -24,7 +24,7 @@ abstract class AbstractHttpTokenEndpoint implements TokenEndpointInterface

/**
* @Flow\Inject
* @var \TYPO3\Flow\Http\Client\CurlEngine
* @var \Neos\Flow\Http\Client\CurlEngine
*/
protected $requestEngine;

Original file line number Diff line number Diff line change
@@ -12,10 +12,10 @@
* */

use Flowpack\OAuth2\Client\Exception as OAuth2Exception;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Http\Request;
use TYPO3\Flow\Http\Uri;
use TYPO3\Flow\Log\SecurityLoggerInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Http\Request;
use Neos\Flow\Http\Uri;
use Neos\Flow\Log\SecurityLoggerInterface;

/**
* @Flow\Scope("singleton")
Original file line number Diff line number Diff line change
@@ -12,10 +12,10 @@
* */

use Flowpack\OAuth2\Client\Exception as OAuth2Exception;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Http\Request;
use TYPO3\Flow\Http\Uri;
use TYPO3\Flow\Log\SecurityLoggerInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Http\Request;
use Neos\Flow\Http\Uri;
use Neos\Flow\Log\SecurityLoggerInterface;

/**
* @Flow\Scope("singleton")
8 changes: 4 additions & 4 deletions Classes/Flowpack/OAuth2/Client/Endpoint/Resolver.php
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@
* The TYPO3 project - inspiring people to share! *
* */

use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Configuration\ConfigurationManager;
use TYPO3\Flow\Object\ObjectManagerInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Configuration\ConfigurationManager;
use Neos\Flow\ObjectManagement\ObjectManagerInterface;

/**
* @Flow\Scope("singleton")
@@ -40,7 +40,7 @@ class Resolver
*/
public function getTokenEndpointForProvider($providerName)
{
$tokenEndpointClassName = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, sprintf('TYPO3.Flow.security.authentication.providers.%s.providerOptions.tokenEndpointClassName', $providerName));
$tokenEndpointClassName = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, sprintf('Neos.Flow.security.authentication.providers.%s.providerOptions.tokenEndpointClassName', $providerName));
if ($tokenEndpointClassName === null) {
throw new \InvalidArgumentException(sprintf('In Settings.yaml, there was no "tokenEndpointClassName" option given for the provider "%s".', $providerName), 1383743372);
}
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
* The TYPO3 project - inspiring people to share! *
* */

use TYPO3\Flow\Annotations as Flow;
use Neos\Flow\Annotations as Flow;

/**
*/
2 changes: 1 addition & 1 deletion Classes/Flowpack/OAuth2/Client/Exception.php
Original file line number Diff line number Diff line change
@@ -13,6 +13,6 @@

/**
*/
class Exception extends \TYPO3\Flow\Exception
class Exception extends \Neos\Flow\Exception
{
}
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
* */

use Flowpack\OAuth2\Client\Exception;
use TYPO3\Flow\Annotations as Flow;
use Neos\Flow\Annotations as Flow;

/**
*
18 changes: 9 additions & 9 deletions Classes/Flowpack/OAuth2/Client/Flow/AbstractFlow.php
Original file line number Diff line number Diff line change
@@ -12,12 +12,12 @@
* */

use Flowpack\OAuth2\Client\Token\AbstractClientToken;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Security\Authentication\TokenInterface;
use TYPO3\Flow\Security\Account;
use TYPO3\Flow\Security\Policy\PolicyService;
use TYPO3\Flow\Validation\ValidatorResolver;
use TYPO3\Party\Domain\Repository\PartyRepository;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Security\Authentication\TokenInterface;
use Neos\Flow\Security\Account;
use Neos\Flow\Security\Policy\PolicyService;
use Neos\Flow\Validation\ValidatorResolver;
use Neos\Party\Domain\Repository\PartyRepository;

/**
*/
@@ -26,19 +26,19 @@ abstract class AbstractFlow implements FlowInterface

/**
* @Flow\Inject
* @var \TYPO3\Flow\Security\Context
* @var \Neos\Flow\Security\Context
*/
protected $securityContext;

/**
* @Flow\Inject
* @var \TYPO3\Flow\Persistence\PersistenceManagerInterface
* @var \Neos\Flow\Persistence\PersistenceManagerInterface
*/
protected $persistenceManager;

/**
* @Flow\Inject
* @var \TYPO3\Flow\Security\AccountRepository
* @var \Neos\Flow\Security\AccountRepository
*/
protected $accountRepository;

17 changes: 8 additions & 9 deletions Classes/Flowpack/OAuth2/Client/Flow/FacebookFlow.php
Original file line number Diff line number Diff line change
@@ -13,12 +13,12 @@

use Flowpack\OAuth2\Client\Exception\InvalidPartyDataException;
use Flowpack\OAuth2\Client\Token\AbstractClientToken;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Party\Domain\Model\ElectronicAddress;
use TYPO3\Party\Domain\Model\Person;
use TYPO3\Party\Domain\Model\PersonName;
use TYPO3\Party\Domain\Repository\PartyRepository;
use TYPO3\Flow\Configuration\ConfigurationManager;
use Neos\Flow\Annotations as Flow;
use Neos\Party\Domain\Model\ElectronicAddress;
use Neos\Party\Domain\Model\Person;
use Neos\Party\Domain\Model\PersonName;
use Neos\Party\Domain\Repository\PartyRepository;
use Neos\Flow\Configuration\ConfigurationManager;

/**
*/
@@ -59,15 +59,14 @@ public function createPartyAndAttachToAccountFor(AbstractClientToken $token)
$party->addElectronicAddress($electronicAddress);
$party->setPrimaryElectronicAddress($electronicAddress);

$partyValidator = $this->validatorResolver->getBaseValidatorConjunction('TYPO3\Party\Domain\Model\Person');
$partyValidator = $this->validatorResolver->getBaseValidatorConjunction('Neos\Party\Domain\Model\Person');
$validationResult = $partyValidator->validate($party);
if ($validationResult->hasErrors()) {
throw new InvalidPartyDataException('The created party does not satisfy the requirements', 1384266207);
}

$account = $token->getAccount();
$account->setParty($party);
$this->accountRepository->update($account);
$this->partyRepository->add($party);

$this->persistenceManager->persistAll();
@@ -106,7 +105,7 @@ protected function initializeUserData(AbstractClientToken $token)
protected function buildFacebookQuery()
{
$query = '/me';
$this->authenticationServicesFields = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'TYPO3.Flow.security.authentication.providers.FacebookOAuth2Provider.providerOptions.fields');
$this->authenticationServicesFields = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Flow.security.authentication.providers.FacebookOAuth2Provider.providerOptions.fields');
$fields = implode(',', $this->authenticationServicesFields);

$query = $query . '?fields=' . $fields;
8 changes: 4 additions & 4 deletions Classes/Flowpack/OAuth2/Client/Flow/FlowInterface.php
Original file line number Diff line number Diff line change
@@ -12,9 +12,9 @@
* */

use Flowpack\OAuth2\Client\Token\AbstractClientToken;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Security\Account;
use TYPO3\Flow\Security\Authentication\TokenInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Security\Account;
use Neos\Flow\Security\Authentication\TokenInterface;

/**
*/
@@ -27,7 +27,7 @@ interface FlowInterface
public function getChargedAuthenticatedTokenHavingNoPartyAttached();

/**
* @param \TYPO3\Flow\Security\Authentication\TokenInterface|\Flowpack\OAuth2\Client\Token\AbstractClientToken $token
* @param \Neos\Flow\Security\Authentication\TokenInterface|\Flowpack\OAuth2\Client\Token\AbstractClientToken $token
* @return TokenInterface
*/
public function getTokenOfForeignAccountOf(AbstractClientToken $token);
11 changes: 5 additions & 6 deletions Classes/Flowpack/OAuth2/Client/Flow/GoogleFlow.php
Original file line number Diff line number Diff line change
@@ -13,10 +13,10 @@

use Flowpack\OAuth2\Client\Exception\InvalidPartyDataException;
use Flowpack\OAuth2\Client\Token\AbstractClientToken;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Party\Domain\Model\ElectronicAddress;
use TYPO3\Party\Domain\Model\Person;
use TYPO3\Party\Domain\Model\PersonName;
use Neos\Flow\Annotations as Flow;
use Neos\Party\Domain\Model\ElectronicAddress;
use Neos\Party\Domain\Model\Person;
use Neos\Party\Domain\Model\PersonName;

/**
*/
@@ -51,15 +51,14 @@ public function createPartyAndAttachToAccountFor(AbstractClientToken $token)
$party->addElectronicAddress($electronicAddress);
$party->setPrimaryElectronicAddress($electronicAddress);

$partyValidator = $this->validatorResolver->getBaseValidatorConjunction('TYPO3\Party\Domain\Model\Person');
$partyValidator = $this->validatorResolver->getBaseValidatorConjunction('Neos\Party\Domain\Model\Person');
$validationResult = $partyValidator->validate($party);
if ($validationResult->hasErrors()) {
throw new InvalidPartyDataException('The created party does not satisfy the requirements', 1384266207);
}

$account = $token->getAccount();
$account->setParty($party);
$this->accountRepository->update($account);
$this->partyRepository->add($party);

$this->persistenceManager->persistAll();
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@
* The TYPO3 project - inspiring people to share! *
* */

use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Security\Authentication\Provider\AbstractProvider;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Security\Authentication\Provider\AbstractProvider;

/**
*/
34 changes: 10 additions & 24 deletions Classes/Flowpack/OAuth2/Client/Provider/FacebookProvider.php
Original file line number Diff line number Diff line change
@@ -12,12 +12,12 @@
* */

use Flowpack\OAuth2\Client\Token\AbstractClientToken;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Log\SecurityLoggerInterface;
use TYPO3\Flow\Security\Account;
use TYPO3\Flow\Security\Authentication\TokenInterface;
use TYPO3\Flow\Security\Exception\UnsupportedAuthenticationTokenException;
use TYPO3\Flow\Security\Policy\PolicyService;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Log\SecurityLoggerInterface;
use Neos\Flow\Security\Account;
use Neos\Flow\Security\Authentication\TokenInterface;
use Neos\Flow\Security\Exception\UnsupportedAuthenticationTokenException;
use Neos\Flow\Security\Policy\PolicyService;

/**
*/
@@ -38,13 +38,7 @@ class FacebookProvider extends AbstractClientProvider

/**
* @Flow\Inject
* @var \TYPO3\Flow\Security\AccountRepository
*/
protected $accountRepository;

/**
* @Flow\Inject
* @var \TYPO3\Flow\Security\Context
* @var \Neos\Flow\Security\Context
*/
protected $securityContext;

@@ -62,15 +56,15 @@ class FacebookProvider extends AbstractClientProvider

/**
* @Flow\Inject
* @var \TYPO3\Flow\Persistence\PersistenceManagerInterface
* @var \Neos\Flow\Persistence\PersistenceManagerInterface
*/
protected $persistenceManager;

/**
* Tries to authenticate the given token. Sets isAuthenticated to TRUE if authentication succeeded.
*
* @param TokenInterface $authenticationToken The token to be authenticated
* @throws \TYPO3\Flow\Security\Exception\UnsupportedAuthenticationTokenException
* @throws \Neos\Flow\Security\Exception\UnsupportedAuthenticationTokenException
* @return void
*/
public function authenticate(TokenInterface $authenticationToken)
@@ -102,14 +96,10 @@ public function authenticate(TokenInterface $authenticationToken)
// From here, we surely know the user is considered authenticated against the remote service,
// yet to check if there is an immanent account present.
$authenticationToken->setAuthenticationStatus(TokenInterface::AUTHENTICATION_SUCCESSFUL);
/** @var $account \TYPO3\Flow\Security\Account */
/** @var $account \Neos\Flow\Security\Account */
$account = null;
$isNewCreatedAccount = false;
$providerName = $this->name;
$accountRepository = $this->accountRepository;
$this->securityContext->withoutAuthorizationChecks(function () use ($tokenInformation, $providerName, $accountRepository, &$account) {
$account = $accountRepository->findByAccountIdentifierAndAuthenticationProviderName($tokenInformation['user_id'], $providerName);
});

if ($account === null) {
$account = new Account();
@@ -124,7 +114,6 @@ public function authenticate(TokenInterface $authenticationToken)
$roles[] = $this->policyService->getRole($roleIdentifier);
}
$account->setRoles($roles);
$this->accountRepository->add($account);
}
$authenticationToken->setAccount($account);

@@ -133,9 +122,6 @@ public function authenticate(TokenInterface $authenticationToken)
$account->setCredentialsSource($longLivedToken['access_token']);
$account->authenticationAttempted(TokenInterface::AUTHENTICATION_SUCCESSFUL);

$this->accountRepository->update($account);
$this->persistenceManager->persistAll();

// Only if defined a Party for the account is created
if ($this->options['partyCreation'] && $isNewCreatedAccount) {
$this->facebookFlow->createPartyAndAttachToAccountFor($authenticationToken);
Loading
Oops, something went wrong.