Package io.karatelabs.http
Interface AuthHandler
- All Known Implementing Classes:
AuthorizationCodeAuthHandler,BasicAuthHandler,BearerAuthHandler,ClientCredentialsAuthHandler
public interface AuthHandler
-
Method Summary
Modifier and TypeMethodDescriptionvoidapply(HttpRequestBuilder builder) getType()default StringtoCurlArgument(String platform) Returns the curl command argument for this auth handler, or null to use the default behavior (including the Authorization header).default StringtoCurlPreview(String platform) Returns the curl preview for this auth handler (without triggering side effects).
-
Method Details
-
apply
-
getType
String getType() -
toCurlArgument
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
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
-