Package org.apache.wicket.coep
Class CrossOriginEmbedderPolicyRequestCycleListener
- java.lang.Object
-
- org.apache.wicket.coep.CrossOriginEmbedderPolicyRequestCycleListener
-
- All Implemented Interfaces:
IRequestCycleListener
public class CrossOriginEmbedderPolicyRequestCycleListener extends Object implements IRequestCycleListener
Sets Cross-Origin Embedder Policy (COEP) headers on the responses based on the mode specified byCrossOriginEmbedderPolicyConfiguration
. COEP can be enabled inREPORTING
mode which will set the headers asCross-Origin-Embedder-Policy-Report-Only
orENFORCING
mode which will set the header asCross-Origin-Embedder-Policy
. The header is not set for the paths that are exempted from COEP. The only valid value of COEP isrequire-corp
, so if the listener is enabled the policy value will be specified as so.COEP prevents a document from loading any non-same-origin resources which don't explicitly grant the document permission to be loaded. Using COEP and COOP together allows developers to safely use powerful features such as
SharedArrayBuffer
,performance.measureMemory()
, and the JS Self-Profiling API.SeeCrossOriginOpenerPolicyRequestCycleListener
for instructions on how to enable COOP. Read more about cross-origin isolation on https://web.dev/why-coop-coep/- Author:
- Santiago Diaz - saldiaz@google.com, Ecenaz Jen Ozmen - ecenazo@google.com
- See Also:
CrossOriginEmbedderPolicyConfiguration
,SecuritySettings
-
-
Constructor Summary
Constructors Constructor Description CrossOriginEmbedderPolicyRequestCycleListener(CrossOriginEmbedderPolicyConfiguration coepConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onRequestHandlerExecuted(RequestCycle cycle, IRequestHandler handler)
Called after anIRequestHandler
has been executed.void
onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler)
Called when anIRequestHandler
is resolved and will be executed.protected void
protect(RequestCycle cycle, IRequestHandler handler)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.request.cycle.IRequestCycleListener
onBeginRequest, onDetach, onEndRequest, onException, onExceptionRequestHandlerResolved, onRequestHandlerScheduled, onUrlMapped
-
-
-
-
Constructor Detail
-
CrossOriginEmbedderPolicyRequestCycleListener
public CrossOriginEmbedderPolicyRequestCycleListener(CrossOriginEmbedderPolicyConfiguration coepConfig)
-
-
Method Detail
-
onRequestHandlerResolved
public void onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler)
Description copied from interface:IRequestCycleListener
Called when anIRequestHandler
is resolved and will be executed.- Specified by:
onRequestHandlerResolved
in interfaceIRequestCycleListener
-
onRequestHandlerExecuted
public void onRequestHandlerExecuted(RequestCycle cycle, IRequestHandler handler)
Description copied from interface:IRequestCycleListener
Called after anIRequestHandler
has been executed. If the execution resulted in an exception this method will not be called for that particularIRequestHandler
.- Specified by:
onRequestHandlerExecuted
in interfaceIRequestCycleListener
-
protect
protected void protect(RequestCycle cycle, IRequestHandler handler)
-
-