-
Notifications
You must be signed in to change notification settings - Fork 233
[Encryption] Improve diagnostic command #898
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
[Encryption] Improve diagnostic command #898
Conversation
f75dee1 to
30a90d3
Compare
| } catch (Throwable $exception) { | ||
| $io->error('Could not retrieve auto encryption info: ' . $exception->getMessage()); | ||
| } | ||
| $configOk = $this->printAndCheckConnectionDiagnostic($name, $diagnostic, $io) && $configOk; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When multiple connections are configured, but they don't have all auto encryption enabled, then the conclusion says there is an issue. We should return "OK" when auto encryption is not configured on a connection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's a good point. Indeed, if encryption wasn't configured on a connection, we should print an info line and mark it as "ok".
9f8a963 to
b4d1412
Compare
| if (isset($driverOptions['autoEncryption']['extraOptions']['cryptSharedLibPath'])) { | ||
| $fs = new Filesystem(); | ||
| $cryptSharedLibPath = $driverOptions['autoEncryption']['extraOptions']['cryptSharedLibPath']; | ||
|
|
||
| // If it's not an absolute path, resolve it relative to the project root | ||
| if (! $fs->isAbsolutePath($cryptSharedLibPath)) { | ||
| $driverOptions['autoEncryption']['extraOptions']['cryptSharedLibPath'] = realpath($cryptSharedLibPath); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alcaeus I'm reverting this part. In Symfony we never convert relative paths to absolute.
I'll add documentation using %kernel.project_dir% instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good - I wasn't quite sure if the kernel parameter was resolved properly. If that works, I prefer that over changing the path in the extension.
| { | ||
| public function __construct( | ||
| private readonly ServiceProviderInterface $diagnostics, | ||
| private readonly EncryptionDiagnostic $encryptionDiagnostic = new EncryptionDiagnostic(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't declare a service for EncryptionDiagnostic. Only leverage the default value from the constructor.
b4d1412 to
e192526
Compare
6b300d7 to
cd2a184
Compare
|
There's a lot of commits in this. Does it need to be rebased? |
It will be squashed on merge. All the commits represent the iterations on this PR. |
paulinevos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some small comments, otherwise seems fine
a9805b3 to
fd27ff0
Compare
920f736
into
doctrine:feature/queryable-encryption
Co-authored-by: Andreas Braun <git@alcaeus.org>
From GromNaN#1
Output:
In case of incorrect setup: