All Downloads are FREE. Search and download functionalities are using the official Maven repository.

play.filters.components.CSPComponents Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) from 2022 The Play Framework Contributors , 2011-2021 Lightbend Inc. 
 */

package play.filters.components;

import play.components.ConfigurationComponents;
import play.filters.csp.*;

/** The Java CSP components. */
public interface CSPComponents extends ConfigurationComponents {

  default CSPConfig cspConfig() {
    return CSPConfig$.MODULE$.fromConfiguration(configuration());
  }

  default CSPProcessor cspProcessor() {
    return new DefaultCSPProcessor(cspConfig());
  }

  default CSPResultProcessor cspResultProcessor() {
    return new DefaultCSPResultProcessor(cspProcessor());
  }

  default CSPFilter cspFilter() {
    return new CSPFilter(cspResultProcessor());
  }

  default CSPAction cspAction() {
    return new CSPAction(cspProcessor());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy