Class ApiKeyGuard.Builder

java.lang.Object
org.apache.juneau.rest.server.auth.ApiKeyGuard.Builder
Enclosing class:
ApiKeyGuard

public static class ApiKeyGuard.Builder extends Object
Builder class.
  • Constructor Details

    • Builder

      protected Builder()
      Constructor.
  • Method Details

    • store

      Sets the API-key store the guard delegates to.
      Parameters:
      value - The store. Must not be null.
      Returns:
      This object.
    • fromHeader

      Reads the key from the supplied request header.

      Calls equivalent to source(Source.HEADER) plus name(value). Defaults to "X-API-Key" when not set.

      Parameters:
      value - The header name. Must not be null or blank.
      Returns:
      This object.
    • fromQuery

      Reads the key from the supplied query parameter.
      Parameters:
      value - The query parameter name. Must not be null or blank.
      Returns:
      This object.
    • fromCookie

      Reads the key from the supplied cookie.
      Parameters:
      value - The cookie name. Must not be null or blank.
      Returns:
      This object.
    • realm

      Sets the WWW-Authenticate: ApiKey realm="<value>" challenge realm.
      Parameters:
      value - The realm. Must not be null or blank.
      Returns:
      This object.
    • build

      public ApiKeyGuard build()
      Builds the guard.
      Returns:
      A new ApiKeyGuard.