Class CommonExtensionsValidatorCallback
java.lang.Object
org.apache.kafka.common.security.oauthbearer.CommonExtensionsValidatorCallback
- All Implemented Interfaces:
Callback,Contextable
- Direct Known Subclasses:
OAuthBearerExtensionsValidatorCallback,PreTokenValidationExtensionsValidatorCallback
public abstract class CommonExtensionsValidatorCallback
extends Object
implements Callback, Contextable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCommonExtensionsValidatorCallback(SaslExtensions extensions) CommonExtensionsValidatorCallback(SaslExtensions extensions, io.confluent.kafka.util.ClientContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValidated(String extensionName, String extensionValue) Adds a specific extension to the validated extensionsvalidatedExtensionsmap.voidaddValidated(String extensionName, Map<String, Object> identityPoolClaims) Adds a specific extension to the validated extensionsvalidatedExtensionsmap.io.confluent.kafka.util.ClientContextcontext()data()voidAdd any extra information apart from extensions.voidSet the error value for a specific extension key-value pair if validation has failedvoiderrorMessage(String errorMessage) voidSet the error value for a specific extension key-value pair if validation has failedvoidValidates a specific extension in the originalinputExtensionsmapvoidValidates a specific extension in the originalinputExtensionsmap.voidValidates a specific extension in the originalinputExtensionsmap.
-
Field Details
-
SEPARATOR
- See Also:
-
-
Constructor Details
-
CommonExtensionsValidatorCallback
public CommonExtensionsValidatorCallback(SaslExtensions extensions, io.confluent.kafka.util.ClientContext context) -
CommonExtensionsValidatorCallback
-
-
Method Details
-
context
public io.confluent.kafka.util.ClientContext context()- Specified by:
contextin interfaceContextable
-
inputExtensions
- Returns:
SaslExtensionsconsisting of the unvalidated extension names and values that were sent by the client
-
validatedExtensions
-
invalidExtensions
-
ignoredExtensions
-
error
Set the error value for a specific extension key-value pair if validation has failed- Parameters:
invalidExtensionName- the mandatory extension name which caused the validation failureerrorMessage- error message describing why the validation failed
-
errors
-
errorMessage
-
errorMessage
-
valid
Validates a specific extension in the originalinputExtensionsmap- Parameters:
extensionName- - the name of the extension which was validated
-
valid
Validates a specific extension in the originalinputExtensionsmap. Adds entries invalidatedExtensionsfor valid extension.- Parameters:
extensionName- - the name of the extension which was validatedextensionValue- - the value of the extension which was validated, or some message
-
valid
Validates a specific extension in the originalinputExtensionsmap. For each item in identity pool claims adds entry extentionname:map.key = map.value invalidatedExtensions- Parameters:
extensionName- - the name of the extension which was validatedidentityPoolClaims- -OAuthBearerExtensionsValidatorCallback pool claims corresponding to identity pool id
-
addValidated
-
addValidated
Adds a specific extension to the validated extensionsvalidatedExtensionsmap. For each item in identity pool claims, adds entry extentionname-map.key = map.value invalidatedExtensions- Parameters:
extensionName- - the name of the extensionidentityPoolClaims- - OAuthBearerExtensionsValidatorCallback pool claims corresponding to union of pools auth
-
data
Add any extra information apart from extensions. For example, we can add providerId for a poolId so that it can be available for audit logging even if there is an error. ProviderId is not passed as an extension and neither is it invalid. Hence, it makes sense to have separate hashmap for this kind of information.- Parameters:
key- String name of the key entryvalue- String value for the data entry
-
data
-