Class CorsConfiguration

java.lang.Object
io.jans.configapi.model.configuration.CorsConfiguration
All Implemented Interfaces:
Serializable

public class CorsConfiguration extends Object implements Serializable
See Also:
  • Constructor Details

    • CorsConfiguration

      public CorsConfiguration()
  • Method Details

    • getAllowedOrigins

      public Collection<String> getAllowedOrigins()
    • setAllowedOrigins

      public void setAllowedOrigins(Collection<String> allowedOrigins)
    • isSupportsCredentials

      public boolean isSupportsCredentials()
    • setSupportsCredentials

      public void setSupportsCredentials(boolean supportsCredentials)
    • getPreflightMaxAge

      public long getPreflightMaxAge()
    • setPreflightMaxAge

      public void setPreflightMaxAge(long preflightMaxAge)
    • isDecorateRequest

      public boolean isDecorateRequest()
    • setDecorateRequest

      public void setDecorateRequest(boolean decorateRequest)
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled(boolean enabled)
    • getAllowedHttpMethods

      public Collection<String> getAllowedHttpMethods()
    • getAllowedHttpHeaders

      public Collection<String> getAllowedHttpHeaders()
    • getExposedHeaders

      public Collection<String> getExposedHeaders()
    • parseAndStore

      public void parseAndStore(String corsEnabled, String allowedOrigins, String allowedHttpMethods, String allowedHttpHeaders, String exposedHeaders, String supportsCredentials, String preflightMaxAge, String decorateRequest) throws jakarta.servlet.ServletException
      Parses each param-value and populates configuration variables. If a param is provided, it overrides the default.
      Parameters:
      corsEnabled - "true" if CORS needs to be enabled.
      allowedOrigins - A String of comma separated origins.
      allowedHttpMethods - A String of comma separated HTTP methods.
      allowedHttpHeaders - A String of comma separated HTTP headers.
      exposedHeaders - A String of comma separated headers that needs to be exposed.
      supportsCredentials - "true" if support credentials needs to be enabled.
      preflightMaxAge - The amount of seconds the user agent is allowed to cache the result of the pre-flight request.
      decorateRequest - "true" if request needs to enhanced
      Throws:
      jakarta.servlet.ServletException
    • isOriginAllowed

      public boolean isOriginAllowed(String origin)
    • isAnyOriginAllowed

      public boolean isAnyOriginAllowed()
    • toString

      public String toString()
      Overrides:
      toString in class Object