Roda 3.78.0 Released #354
jeremyevans
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Roda 3.78.0 has been released!
New Features
A permissions_policy plugin has been added that allows you to easily set a
Permissions-Policy header for the application, which browsers can use to
determine whether to allow specific functionality on the returned page
(mainly related to which JavaScript APIs the page is allowed to use).
You would generally call the plugin with a block to set the default policy:
Then, anywhere in the routing tree, you can customize the policy for just that
branch or action using the same block syntax:
In addition to using a block, you can also call methods on the object returned
by the method:
You can use the :default plugin option to set the default for all settings.
For example, to disallow all access for each setting by default:
The following methods are available for configuring the permissions policy,
which specify the setting (substituting _ with -):
All of these methods support any number of arguments, and each argument should
be one of the following values:
:all :: Grants permission to all domains (must be only argument)
:none :: Does not allow permission at all (must be only argument)
:self :: Allows feature in current document and any nested browsing contexts
that use the same domain as the current document.
:src :: Allows feature in current document and any nested browsing contexts
that use the same domain as the src of the iframe.
String :: Specifies origin domain where access is allowed
When calling a method with no arguments, the setting is removed from the policy instead
of being left empty, since all of these setting require at least one value. Likewise,
if the policy does not have any settings, the header will not be added.
Calling the method overrides any previous setting. Each of the methods has add_* and
get_* methods defined. The add_* method appends to any existing setting, and the get_* method
returns the current value for the setting (this will be :all if all domains are allowed, or
any array of strings/:self/:src).
The clear method can be used to remove all settings from the policy.
Thanks,
Jeremy
Beta Was this translation helpful? Give feedback.
All reactions