Interface AuthHandler

All Known Implementing Classes:
AuthorizationCodeAuthHandler, BasicAuthHandler, BearerAuthHandler, ClientCredentialsAuthHandler

public interface AuthHandler
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
     
    default String
    Returns the curl command argument for this auth handler, or null to use the default behavior (including the Authorization header).
    default String
    Returns the curl preview for this auth handler (without triggering side effects).
  • Method Details

    • apply

      void apply(HttpRequestBuilder builder)
    • getType

      String getType()
    • toCurlArgument

      default String toCurlArgument(String platform)
      Returns the curl command argument for this auth handler, or null to use the default behavior (including the Authorization header). For example, BasicAuthHandler can return "-u username:password"
      Parameters:
      platform - "sh" for Unix/Linux/macOS, "cmd" for Windows CMD, "ps" for PowerShell
    • toCurlPreview

      default String toCurlPreview(String platform)
      Returns the curl preview for this auth handler (without triggering side effects). This is used for UI/preview purposes where we don't want to make network calls. If null, falls back to toCurlArgument() behavior. For OAuth handlers that need network access, this should return a placeholder.
      Parameters:
      platform - "sh" for Unix/Linux/macOS, "cmd" for Windows CMD, "ps" for PowerShell