java.lang.Object
io.aiven.commons.system.SystemCheck
Checks URLs against the URLs allowed as per the
org.apache.kafka.sasl.oauthbearer.allowed.urls environment variable.
If the variable is not set all URLs are allowed.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanallowed(SystemCheck.Type type, String value) Checks if the URL is allowed as per theorg.apache.kafka.sasl.oauthbearer.allowed.urlsenvironment variable.static StringformatError(SystemCheck.Type type, String value) Format the error message for the specified URL.static voidthrowIfNotAllowed(SystemCheck.Type type, String value) Throw an exception if the specified URL is not listed in the system property.
-
Method Details
-
formatError
Format the error message for the specified URL.- Parameters:
type- the type check that failedvalue- the value to create an error message for.- Returns:
- the error message.
-
allowed
Checks if the URL is allowed as per theorg.apache.kafka.sasl.oauthbearer.allowed.urlsenvironment variable.- Parameters:
type- the type to check.value- the value to check.- Returns:
trueif the value is listed in the environment variable for the type,falseif the environment variable is not set or the value is not listed.
-
throwIfNotAllowed
public static void throwIfNotAllowed(SystemCheck.Type type, String value) throws IllegalArgumentException Throw an exception if the specified URL is not listed in the system property.- Parameters:
type- the type to check.value- the value to check- Throws:
IllegalArgumentException- if theallowed(Type, String)returns false.
-