Class NetworkConfig

java.lang.Object
swiss.trustbroker.config.dto.NetworkConfig

public class NetworkConfig extends Object
Network configuration.
See Also:
  • Constructor Details

    • NetworkConfig

      public NetworkConfig()
    • NetworkConfig

      public NetworkConfig(String mobileGatewayIpRegex, String intranetNetworkName, String internetNetworkName, String networkHeader, String testNetworkHeader, String canaryMarkerName, String canaryEnabledValue, boolean tracingEnabled, String proxyUrl, int backendConnectTimeoutSec)
      Creates a new NetworkConfig instance.
      Parameters:
      mobileGatewayIpRegex -
      intranetNetworkName - Name for the Intranet network used in configurations (e.g. INTRANET).
      Set only if your network infrastructure always sets the networkHeader. This ensures that a request from the Internet cannot control the network.
      Default: null
      internetNetworkName - Name for the Internet network used in configurations (e.g. INTERNET).
      Default: null
      networkHeader - HTTP header delivering the client network. Usually sent by load balancer.
      Default: Client_Network (should be X-Client-Network)
      testNetworkHeader - HTTP header for simulating the client network.
      Sent by test agents to test HRD rules. This is only evaluated for requests from the Intranet according to networkHeader.
      Default: "X-Simulated-Client-Network
      canaryMarkerName - Running on K8S supporting canary routing using cookies, a test instance.
      canaryEnabledValue - Value for canaryMarkerName.
      tracingEnabled - Allow disabling OpenTelemetry traceparent propagation to backends that might block use otherwise.
      proxyUrl - Default proxy URL.
      backendConnectTimeoutSec - Backend service connect timeout in seconds.
      Default: 30
      Since:
      1.7.0, 1.7.0, 1.7.0, 1.9.0, 1.10.0
  • Method Details

    • isIntranet

      public boolean isIntranet(String name)
    • isInternet

      public boolean isInternet(String name)
    • builder

      public static NetworkConfig.NetworkConfigBuilder builder()
    • getMobileGatewayIpRegex

      public String getMobileGatewayIpRegex()
    • getIntranetNetworkName

      public String getIntranetNetworkName()
      Name for the Intranet network used in configurations (e.g. INTRANET).
      Set only if your network infrastructure always sets the networkHeader. This ensures that a request from the Internet cannot control the network.
      Default: null
    • getInternetNetworkName

      public String getInternetNetworkName()
      Name for the Internet network used in configurations (e.g. INTERNET).
      Default: null
    • getNetworkHeader

      public String getNetworkHeader()
      HTTP header delivering the client network. Usually sent by load balancer.
      Default: Client_Network (should be X-Client-Network)
    • getTestNetworkHeader

      public String getTestNetworkHeader()
      HTTP header for simulating the client network.
      Sent by test agents to test HRD rules. This is only evaluated for requests from the Intranet according to networkHeader.
      Default: "X-Simulated-Client-Network
    • getCanaryMarkerName

      public String getCanaryMarkerName()
      Running on K8S supporting canary routing using cookies, a test instance.
      Since:
      1.7.0
    • getCanaryEnabledValue

      public String getCanaryEnabledValue()
      Value for canaryMarkerName.
      Since:
      1.7.0
    • isTracingEnabled

      public boolean isTracingEnabled()
      Allow disabling OpenTelemetry traceparent propagation to backends that might block use otherwise.
      Since:
      1.7.0
    • getProxyUrl

      public String getProxyUrl()
      Default proxy URL.
      Since:
      1.9.0
    • getBackendConnectTimeoutSec

      public int getBackendConnectTimeoutSec()
      Backend service connect timeout in seconds.
      Default: 30
      Since:
      1.10.0
    • setMobileGatewayIpRegex

      public void setMobileGatewayIpRegex(String mobileGatewayIpRegex)
    • setIntranetNetworkName

      public void setIntranetNetworkName(String intranetNetworkName)
      Name for the Intranet network used in configurations (e.g. INTRANET).
      Set only if your network infrastructure always sets the networkHeader. This ensures that a request from the Internet cannot control the network.
      Default: null
    • setInternetNetworkName

      public void setInternetNetworkName(String internetNetworkName)
      Name for the Internet network used in configurations (e.g. INTERNET).
      Default: null
    • setNetworkHeader

      public void setNetworkHeader(String networkHeader)
      HTTP header delivering the client network. Usually sent by load balancer.
      Default: Client_Network (should be X-Client-Network)
    • setTestNetworkHeader

      public void setTestNetworkHeader(String testNetworkHeader)
      HTTP header for simulating the client network.
      Sent by test agents to test HRD rules. This is only evaluated for requests from the Intranet according to networkHeader.
      Default: "X-Simulated-Client-Network
    • setCanaryMarkerName

      public void setCanaryMarkerName(String canaryMarkerName)
      Running on K8S supporting canary routing using cookies, a test instance.
      Since:
      1.7.0
    • setCanaryEnabledValue

      public void setCanaryEnabledValue(String canaryEnabledValue)
      Value for canaryMarkerName.
      Since:
      1.7.0
    • setTracingEnabled

      public void setTracingEnabled(boolean tracingEnabled)
      Allow disabling OpenTelemetry traceparent propagation to backends that might block use otherwise.
      Since:
      1.7.0
    • setProxyUrl

      public void setProxyUrl(String proxyUrl)
      Default proxy URL.
      Since:
      1.9.0
    • setBackendConnectTimeoutSec

      public void setBackendConnectTimeoutSec(int backendConnectTimeoutSec)
      Backend service connect timeout in seconds.
      Default: 30
      Since:
      1.10.0
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object