Skip to main content

parse_required_scope

Function parse_required_scope 

Source
pub fn parse_required_scope(
    option: &str,
) -> Result<Vec<String>, InvalidScopeItem>
Expand description

Parse Kafka’s unsecuredValidatorRequiredScope option the way Kafka 4.3.1’s OAuthBearerUnsecuredValidatorCallbackHandler does.

The option is trimmed, then split on single spaces, and empty items are skipped. A blank option requires no scope. The result is the value of UnsecuredJwsValidator::required_scope.

§Errors

InvalidScopeItem for the first item that has a character outside the scope-token grammar, such as ", \, a tab, or a non-ASCII character. Kafka fails the validator’s configuration on it.