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

feat: try to invalidate realpath cache if keypair loading failed #1046

Merged
merged 1 commit into from
Jul 26, 2022
Merged

feat: try to invalidate realpath cache if keypair loading failed #1046

merged 1 commit into from
Jul 26, 2022

Conversation

lobodol
Copy link
Contributor

@lobodol lobodol commented Jul 11, 2022

Closes #1045

@lobodol
Copy link
Contributor Author

lobodol commented Jul 26, 2022

Thanks for your approval @chalasr. Do you plan to merge it soon?

@@ -51,7 +51,17 @@ public function getAdditionalPublicKeys(): array
throw new \RuntimeException(sprintf('Additional public key "%s" does not exist or is not readable. Did you correctly set the "lexik_jwt_authentication.additional_public_keys" configuration key?', $key));
}

$contents[] = is_file($key) ? file_get_contents($key) : $key;
if (is_file($key)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The right part of the ternary expression is missing in this refactoring. Add an else statement:

if (is_file($key)) {
  //...
} else {
  $contents[] = $key;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, can you please update the patch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done.

Copy link
Contributor Author

@lobodol lobodol Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh crap, some tests seem broken. This is weird, tests pass on my local.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, it's not related to this change :)

@chalasr
Copy link
Collaborator

chalasr commented Jul 26, 2022

Thank you @lobodol.

@chalasr chalasr merged commit 3e8c013 into lexik:2.x Jul 26, 2022
@lobodol lobodol deleted the feature/clear-stat-cache branch July 26, 2022 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP realpath cache and Kubernetes secrets / configmap updates
2 participants