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

Fix use of withFallback introduced when dropping Play 2.7 #451

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

rtyley
Copy link
Member

@rtyley rtyley commented Apr 9, 2024

This fixes #449, the problem with server startup that was introduced by dropping Play 2.7 support in PR #446 and released with play-secret-rotation v8.1.0.

Dropping Play 2.7 support meant that we could use the Configuration.withFallback() method introduced with Play 2.8 and playframework/playframework#9674, rather than the deprecated ++ method. However (as the documentation does say), the ++ and withFallback() methods override in opposite directions - withFallback() means that the first Configuration is tried first, and the second config is tried second - which is opposite to how ++ works.

I missed this, and so, in PR #446, failed to reverse the order of the arguments. This meant that when play-secret-rotation was actually in a Play server running in Production mode, the code would attempt to evaluate the play.http.secret.key key in super.configuration (and blow up with an integrity test error), rather than get the trash value back that Configuration("play.http.secret.key" -> nonRotatingSecretOnlyUsedToSatisfyConfigChecks) supplied - only To Satisfy Config Checks.

Reversing the order of the arguments makes the hack work as intended, and the server can start up again 👍 ✨

It would be lovely to avoid such hackage, but that will require a resolution for playframework/playframework#12520!

Testing

This has been tried out with https://github.com/guardian/ophan/pull/6005, which demonstrated that the change fixes the problem.

This fixes #449,
the problem with server startup that was released with
play-secret-rotation v8.1.0.
@rtyley rtyley changed the title Fix use of withFallback made when dropping Play 2.7 Fix use of withFallback introduced when dropping Play 2.7 Apr 9, 2024
@gu-scala-library-release
Copy link
Contributor

@rtyley has published a preview version of this PR with release workflow run #35, based on commit d1a385e:

8.2.1-PREVIEW.fix-dropping-play-27.2024-04-09T1528.d1a385ed

Want to make another preview release?

Click 'Run workflow' in the GitHub UI, specifying the fix-dropping-play-2.7 branch, or use the GitHub CLI command:

gh workflow run release.yml --ref fix-dropping-play-2.7

Want to make a full release after this PR is merged?

Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command:

gh workflow run release.yml

@rtyley rtyley marked this pull request as ready for review April 9, 2024 17:11
@rtyley rtyley requested a review from a team as a code owner April 9, 2024 17:11
@rtyley rtyley merged commit 7b51df2 into main Apr 9, 2024
10 checks passed
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.

Release 8.1.0 breaks server startup
1 participant