Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
262 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
use Doctum\Doctum; | ||
use Doctum\RemoteRepository\GitHubRemoteRepository; | ||
use Symfony\Component\Finder\Finder; | ||
|
||
$iterator = Finder::create() | ||
->files() | ||
->name('*.php') | ||
->path('/Classes/') | ||
->in(__DIR__); | ||
|
||
return new Doctum($iterator, [ | ||
'title' => 'Flow Framework', | ||
'base_url' => 'https://neos.github.io/', | ||
'favicon' => 'https://www.neos.io/favicon-32x32.png', | ||
'language' => 'en', | ||
'remote_repository' => new GitHubRemoteRepository('neos/flow-development-collection', __DIR__), | ||
'footer_link' => [ | ||
'href' => 'https://flow.neos.io', | ||
'rel' => 'noreferrer noopener', | ||
'target' => '_blank', | ||
'before_text' => 'Learn more about the', | ||
'link_text' => 'Flow Framework', | ||
'after_text' => 'if you like!', | ||
] | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build API documentation | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ '[0-9]+.[0-9]' ] | ||
|
||
jobs: | ||
build-api-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build API documentation | ||
uses: sudo-bot/action-doctum@v5 | ||
with: | ||
config-file: .doctum.php | ||
method: "update" | ||
# use of --only-version fixes branch name in "View source" links to GitHub | ||
cli-args: "--output-format=github --no-ansi --no-progress --ignore-parse-errors --only-version=${{ github.ref_name }}" | ||
|
||
- name: Check out documentation site | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: neos/neos.github.io | ||
path: docs-site | ||
|
||
- name: Move rendered docs to site | ||
run: | | ||
rm -rf docs-site/flow/${{ github.ref_name }} | ||
mkdir -p docs-site/flow/${{ github.ref_name }} | ||
mv build/* docs-site/flow/${{ github.ref_name }}/ | ||
- name: Commit update | ||
run: | | ||
cd docs-site | ||
git config --local --unset-all "http.https://github.com/.extraheader" | ||
git config --global user.email "ops@neos.io" | ||
git config --global user.name "Neos Bot" | ||
git add . | ||
git commit -m "TASK: Update API docs from ${{ github.ref_name }}" | ||
- name: Push to git | ||
uses: ad-m/github-push-action@v0.6.0 | ||
with: | ||
github_token: ${{ secrets.NEOS_BOT_TOKEN }} | ||
repository: neos/neos.github.io | ||
directory: docs-site | ||
branch: main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
Neos.Flow/Classes/Security/Cryptography/PrecomposedHashProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neos\Flow\Security\Cryptography; | ||
|
||
/* | ||
* This file is part of the Neos.Flow package. | ||
* | ||
* (c) Contributors of the Neos Project - www.neos.io | ||
* | ||
* This package is Open Source Software. For the full copyright and license | ||
* information, please view the LICENSE file which was distributed with this | ||
* source code. | ||
*/ | ||
|
||
use Neos\Cache\Frontend\StringFrontend; | ||
use Neos\Flow\Annotations as Flow; | ||
use Neos\Flow\Utility\Algorithms as UtilityAlgorithms; | ||
|
||
/** | ||
* Precomposes a hash to be used to prevent timing attacks | ||
* | ||
* @Flow\Scope("singleton") | ||
*/ | ||
class PrecomposedHashProvider | ||
{ | ||
/** | ||
* @var HashService | ||
* @Flow\Inject | ||
*/ | ||
protected $hashService; | ||
|
||
/** | ||
* The Cache have to be injected non-lazy to prevent timing differences | ||
* | ||
* @var StringFrontend | ||
* @Flow\Inject(lazy=false) | ||
*/ | ||
protected $cache; | ||
|
||
public function getPrecomposedHash(): string | ||
{ | ||
$hash = $this->cache->get('precomposed_hash'); | ||
if (!$hash) { | ||
$hash = $this->precomposeHash(); | ||
} | ||
|
||
return $hash; | ||
} | ||
|
||
public function precomposeHash(): string | ||
{ | ||
$randomPassword = UtilityAlgorithms::generateRandomString(16, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./'); | ||
$hash = $this->hashService->hashPassword($randomPassword); | ||
$this->cache->set('precomposed_hash', $hash); | ||
return $hash; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.