Skip to content

Commit

Permalink
FEATURE: Add setting for encryption key
Browse files Browse the repository at this point in the history
With this the encryption key can be defined in a setting.
When defined it is not received from cache anymore.

Resolves: neos#3425
  • Loading branch information
Christoph Lehmann committed Dec 22, 2024
1 parent 70f54fd commit 209032e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Neos.Flow/Classes/Security/Cryptography/HashService.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class HashService
public function injectSettings(array $settings)
{
$this->strategySettings = $settings['security']['cryptography']['hashingStrategies'];
if (!empty($settings['security']['cryptography']['encryptionKey'])) {
$this->encryptionKey = $settings['security']['cryptography']['encryptionKey'];
}
}

/**
Expand Down
4 changes: 4 additions & 0 deletions Neos.Flow/Configuration/Settings.Security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ Neos:

cryptography:

# A private, unique key used for encryption tasks. Normally 40 characters long and received from a persistent
# filesystem cache. If set to a non-empty string, the cache is not involved anymore.
encryptionKey: ''

hashingStrategies:

# The default strategy will be used to hash or validate passwords if no specific strategy is given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ properties:
additionalProperties: false
required: true
properties:
'encryptionKey': { type: string, required: true }

'hashingStrategies':
type: dictionary
additionalProperties: { type: string, format: class-name }
Expand Down

0 comments on commit 209032e

Please sign in to comment.