Class WebSupport

java.lang.Object
swiss.trustbroker.util.WebSupport

public class WebSupport extends Object
Log-able web input (where we do not expected any StringUtil. clean modified data) and other helpers.
  • Field Details

  • Method Details

    • getDeviceId

      public static String getDeviceId(jakarta.servlet.http.HttpServletRequest request)
    • getWebRequest

      public static jakarta.servlet.http.HttpServletRequest getWebRequest()
    • getRealClientNetwork

      public static String getRealClientNetwork(jakarta.servlet.http.HttpServletRequest request, NetworkConfig networkConfig)
    • getClientNetwork

      public static String getClientNetwork(jakarta.servlet.http.HttpServletRequest request, NetworkConfig networkConfig)
    • getUserAgent

      public static String getUserAgent(jakarta.servlet.http.HttpServletRequest request)
    • isClientOnIntranet

      public static boolean isClientOnIntranet(jakarta.servlet.http.HttpServletRequest request, NetworkConfig networkConfig)
    • isAdminLogin

      public static boolean isAdminLogin(jakarta.servlet.http.HttpServletRequest request)
    • isLbHealthCheck

      public static boolean isLbHealthCheck(jakarta.servlet.http.HttpServletRequest request, NetworkConfig networkConfig)
    • isClientOnInternet

      public static boolean isClientOnInternet(jakarta.servlet.http.HttpServletRequest request, NetworkConfig networkConfig)
    • getClientHint

      public static String getClientHint(jakarta.servlet.http.HttpServletRequest request, NetworkConfig networkConfig)
    • getServiceContext

      public static String getServiceContext(jakarta.servlet.http.HttpServletRequest request)
    • getUniqueQueryParameter

      public static String getUniqueQueryParameter(net.shibboleth.shared.net.URLBuilder urlBuilder, String name)
    • getViewRedirectResponse

      public static String getViewRedirectResponse(String url)
    • getHttpContext

      public static Map<String,String> getHttpContext(jakarta.servlet.http.HttpServletRequest request, NetworkConfig networkConfig)
    • getServletRequestAttributes

      public static org.springframework.web.context.request.ServletRequestAttributes getServletRequestAttributes(boolean tryOnly)
    • setRequestAttribute

      public static <T> void setRequestAttribute(String key, T value, boolean tryOnly)
    • getRequestAttribute

      public static <T> T getRequestAttribute(String key, boolean tryOnly)
    • canaryModeEnabled

      public static boolean canaryModeEnabled(jakarta.servlet.http.HttpServletRequest httpRequest, NetworkConfig networkConfig)
    • penTestingScenario

      public static String penTestingScenario(jakarta.servlet.http.HttpServletRequest httpRequest, TrustBrokerProperties properties)
    • penTestingModeEnabled

      public static boolean penTestingModeEnabled(jakarta.servlet.http.HttpServletRequest httpRequest, TrustBrokerProperties properties)
    • anyHeaderMatches

      public static boolean anyHeaderMatches(jakarta.servlet.http.HttpServletRequest httpRequest, List<swiss.trustbroker.common.config.RegexNameValue> headerConditions)
      Returns:
      true if any of the request headers matches any of the headerConditions by header name and value/regex
    • getOwnOrigins

      public static Set<String> getOwnOrigins(TrustBrokerProperties properties)
    • isOwnOrigin

      public static boolean isOwnOrigin(TrustBrokerProperties properties, URI checkUri)
    • getOwnPerimeterPaths

      public static Set<String> getOwnPerimeterPaths(TrustBrokerProperties properties)
    • isInternalOidcRequest

      public static boolean isInternalOidcRequest(TrustBrokerProperties properties, String referer)