local typedefs = require "kong.db.schema.typedefs"

return {
  name = "auth-server",
  fields = {
    { consumer = typedefs.no_consumer },
    { protocols = typedefs.protocols_http },
    { config = {
        type = "record",
        fields = {
          {
            authorization_endpoint = {
              type = "string",
              default = "https://kubernetes.default/apis/core.pingcap.com/v1alpha1/namespaces/default/clusters",
              description = "dataplane EKS API server endpoint."
            }
          },
          {
            token_header = typedefs.header_name {
              default = "Authorization", required = true
            }
          },
          {
            connect_timeout = {
              type = "number",
              default = 2000,
              description = "the timeout (in milliseconds) for connecting to the authorization service.",
            }
          },
          {
            read_timeout = {
              type = "number",
              default = 5000,
              description = "the timeout (in milliseconds) for reading responses from the authorization service.",
            }
          },
        }
      }
    }
  },
}
