
package de.ivu.elect.business.system.control;

import java.util.Collection;

import de.ivu.elect.business.konfiguration.control.AbstractKonfigurationInit;
import de.ivu.elect.business.konfiguration.entity.ElectKonfigurationWerte;
import de.ivu.elect.business.konfiguration.entity.Konfiguration;
import de.ivu.elect.business.konfiguration.entity.KonfigurationInitContext;


import static java.util.Arrays.asList;

public class HttpHeaderKonfigurationInit extends AbstractKonfigurationInit {

  public static final int DEFAULT_SESSION_TIMEOUT_IN_MINUTES = 30;

  public HttpHeaderKonfigurationInit() {
    super();
  }

  @Override
  protected Collection<Konfiguration> createDefaultParameters(KonfigurationInitContext konfigurationInitContext) {
    return asList( //
        create(ElectKonfigurationWerte.HTTP_HEADER_X_UA_COMPATIBLE_OVERRIDE, getXUaCompatibleDefault()),
        create(ElectKonfigurationWerte.HTTP_HEADER_X_CONTENT_TYPE_OPTIONS_OVERRIDE, getXContentTypeOptionsDefault()),
        //        create(ElectKonfigurationWerte.HTTP_HEADER_X_FRAME_OPTIONS_OVERRIDE, getXFrameOptionsDefault()), // WASDE-2279 veraltete Header entfernen
        //        create(ElectKonfigurationWerte.HTTP_HEADER_X_XSS_PROTECTION_OVERRIDE, getCXssProtectionDefault()), // WASDE-2279 veraltete Header entfernen
        create(ElectKonfigurationWerte.HTTP_HEADER_X_POWERED_BY_OVERRIDE, getXPoweredByDefault()),
        create(ElectKonfigurationWerte.HTTP_HEADER_SERVER_OVERRIDE, getServerDefault()),
        create(ElectKonfigurationWerte.HTTP_HEADER_STRICT_TRANSPORT_SECURITY_OVERRIDE, getStrictTransportSecurityDefault()),
        create(ElectKonfigurationWerte.HTTP_HEADER_CONTENT_SECURITY_POLICY_OVERRIDE, getContentSecurityPolicyDefault()),
        create(ElectKonfigurationWerte.HTTP_HEADER_ADDITIONAL, getHeaderAdditionalDefault())
    );
  }

  protected String getHeaderAdditionalDefault() {
    return "";
  }

  protected String getContentSecurityPolicyDefault() {
    return "";
  }

  protected String getStrictTransportSecurityDefault() {
    return "";
  }

  protected String getServerDefault() {
    return "";
  }

  protected String getXPoweredByDefault() {
    return "";
  }

  protected String getCXssProtectionDefault() {
    return "";
  }

  protected String getXFrameOptionsDefault() {
    return "";
  }

  protected String getXContentTypeOptionsDefault() {
    return "";
  }

  protected String getXUaCompatibleDefault() {
    return "";
  }

}
