THREESCALE-11928: Support Permissions-Policy header
#4207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR allows the user to set their desired value for the
Permissions-Policyheader as a yaml file. ExampleWith this config, the user can set:
The code here is very similar to what I did in #4185. I told claude to get inspiration from that PR and adapt it for permissions policy, since the rails backend for both headers is shared. My plan is to make a few changes before both PRs are merged to try to remove a bit of duplication.
Like in the CSP PR, the changes here are:
application.rbWhich issue(s) this PR fixes
https://issues.redhat.com/browse/THREESCALE-11928
Verification steps
A fast way to test this is:
When forbidden, you should see the error in the console; when allowed, you should a prompt from the browser asking for permission.
Special notes for your reviewer:
A couple of comments:
Feature-Policybut was recently renamed toPermissions-Policywith a few additional features. Rails only supports the old one, so that's the header we see in the request, future Rails versions should add support for the new header.