Class CORSAuthenticator.Builder

java.lang.Object
org.attribyte.snook.auth.CORSAuthenticator.Builder
Enclosing class:
CORSAuthenticator

public static class CORSAuthenticator.Builder extends Object
Builds immutable instances of the authenticator.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setDenyDomains

      public CORSAuthenticator.Builder setDenyDomains(Collection<String> denyDomains)
      Sets the set of denied domains.
      Parameters:
      denyDomains - The collection of domains.
      Returns:
      A self-reference.
    • addDenyDomain

      public CORSAuthenticator.Builder addDenyDomain(String domain)
      Adds a denied domain.
      Parameters:
      domain - The domain.
      Returns:
      A self-reference
    • setDenyHosts

      public CORSAuthenticator.Builder setDenyHosts(Collection<String> denyHosts)
      Sets the set of denied hosts.
      Parameters:
      denyHosts - The denied hosts.
      Returns:
      A self-reference.
    • addDenyHost

      public CORSAuthenticator.Builder addDenyHost(String host)
      Adds a denied host.
      Parameters:
      host - The host.
      Returns:
      A self-reference.
    • setAllowDomains

      public CORSAuthenticator.Builder setAllowDomains(Collection<String> allowDomains)
      Sets the allowed domains.
      Parameters:
      allowDomains - The allowed domains.
      Returns:
      A self-reference.
    • addAllowDomain

      public CORSAuthenticator.Builder addAllowDomain(String domain)
      Adds an allowed domain.
      Parameters:
      domain - The domain.
      Returns:
      A self-reference.
    • setAllowHost

      public CORSAuthenticator.Builder setAllowHost(Collection<String> allowHosts)
      Sets the allowed hosts.
      Parameters:
      allowHosts - The allowed hosts.
      Returns:
      A self-reference.
    • addAllowHost

      public CORSAuthenticator.Builder addAllowHost(String host)
      Adds an allowed host.
      Parameters:
      host - The allowed host.
      Returns:
      A self-reference.
    • setAllowAll

      public CORSAuthenticator.Builder setAllowAll(boolean allowAll)
      Sets to allow all hosts.
      Parameters:
      allowAll - Are all hosts allowed?
      Returns:
      A self-reference.
    • allowAll

      public CORSAuthenticator.Builder allowAll()
      Sets to allow all hosts.
      Returns:
      A self-reference.
    • setSecureOriginRequired

      public CORSAuthenticator.Builder setSecureOriginRequired(boolean secureOriginRequired)
      Sets if a secure origin is required.
      Parameters:
      secureOriginRequired - Is a secure origin required.
      Returns:
      A self-reference.
    • secureOriginRequired

      public CORSAuthenticator.Builder secureOriginRequired()
      Require a secure origin.
      Returns:
      A self-reference.
    • setAllowHeaders

      public CORSAuthenticator.Builder setAllowHeaders(String allowHeaders)
      Sets a comma-separated list of allowed headers.
      Parameters:
      allowHeaders - The list of allowed headers.
      Returns:
      A self-reference.
    • setExposeHeaders

      public CORSAuthenticator.Builder setExposeHeaders(String exposeHeaders)
      Sets a comma-separated list of exposed headers.
      Parameters:
      exposeHeaders - The list of exposed headers.
      Returns:
      A self-reference.
    • setAllowMethods

      public CORSAuthenticator.Builder setAllowMethods(String allowMethods)
      Sets a comma-separated list of allowed methods.
      Parameters:
      allowMethods - The allowed methods.
      Returns:
      A self-reference.
    • setMaxAgeSeconds

      public CORSAuthenticator.Builder setMaxAgeSeconds(int maxAgeSeconds)
      Sets the maximum age in seconds.
      Parameters:
      maxAgeSeconds - The maximum age in seconds.
      Returns:
      A self-reference.
    • build

      public CORSAuthenticator build()
      Builds an immutable authenticator.
      Returns:
      The authenticator.