Interface AuthConfig
- All Known Implementing Classes:
ApiKeyAuthConfig,BasicAuthConfig,BearerAuthConfig,NoAuthConfig,OAuth2ClientConfig,OAuth2PasswordConfig
public sealed interface AuthConfig
permits NoAuthConfig, BasicAuthConfig, BearerAuthConfig, ApiKeyAuthConfig, OAuth2ClientConfig, OAuth2PasswordConfig
Sealed interface for REST API authentication configuration.
This interface defines the contract for all authentication types supported by the REST API template system. Each implementation handles a specific authentication mechanism.
- Since:
- 2025-02-06
- Author:
- Process Builder Team
-
Method Summary
Modifier and TypeMethodDescriptionstatic AuthConfigfromJson(com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.ObjectMapper mapper) Creates an AuthConfig from a JSON node.Gets the authentication type identifier.static booleangetBoolean(com.fasterxml.jackson.databind.JsonNode node, String field, boolean defaultValue) Helper method to get a boolean value from a JSON node with a default.static StringHelper method to get a text value from a JSON node with a default.com.fasterxml.jackson.databind.JsonNodetoJson(com.fasterxml.jackson.databind.ObjectMapper mapper) Converts this configuration to a JSON node for storage.com.fasterxml.jackson.databind.JsonNodetoJsonEncrypted(com.fasterxml.jackson.databind.ObjectMapper mapper) Converts this configuration to a JSON node with sensitive fields encrypted.
-
Method Details
-
getAuthType
String getAuthType()Gets the authentication type identifier.- Returns:
- The authentication type string (lowercase)
-
toJson
com.fasterxml.jackson.databind.JsonNode toJson(com.fasterxml.jackson.databind.ObjectMapper mapper) Converts this configuration to a JSON node for storage.- Parameters:
mapper- The ObjectMapper to use for JSON creation- Returns:
- JSON representation of this configuration
-
toJsonEncrypted
com.fasterxml.jackson.databind.JsonNode toJsonEncrypted(com.fasterxml.jackson.databind.ObjectMapper mapper) Converts this configuration to a JSON node with sensitive fields encrypted.- Parameters:
mapper- The ObjectMapper to use for JSON creation- Returns:
- JSON representation with encrypted sensitive fields
-
fromJson
static AuthConfig fromJson(com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.ObjectMapper mapper) Creates an AuthConfig from a JSON node.- Parameters:
node- The JSON node to parsemapper- The ObjectMapper to use- Returns:
- The appropriate AuthConfig implementation
-
getText
static String getText(com.fasterxml.jackson.databind.JsonNode node, String field, String defaultValue) Helper method to get a text value from a JSON node with a default. -
getBoolean
static boolean getBoolean(com.fasterxml.jackson.databind.JsonNode node, String field, boolean defaultValue) Helper method to get a boolean value from a JSON node with a default.
-