Package org.apache.pulsar.functions.auth
Interface FunctionAuthProvider
- All Known Subinterfaces:
KubernetesFunctionAuthProvider
- All Known Implementing Classes:
ClearTextFunctionTokenAuthProvider,KubernetesSecretsTokenAuthProvider,KubernetesServiceAccountTokenAuthProvider
public interface FunctionAuthProvider
This is a generic interface that functions can use to cache and distribute appropriate authentication
data that is needed to configure the runtime of functions to support appropriate authentication
of function instances.
-
Method Summary
Modifier and TypeMethodDescriptioncacheAuthData(org.apache.pulsar.functions.proto.Function.FunctionDetails funcDetails, AuthenticationDataSource authenticationDataSource) Cache auth data in as part of function metadata for function that runtime may need to configure authentication.voidcleanUpAuthData(org.apache.pulsar.functions.proto.Function.FunctionDetails funcDetails, Optional<FunctionAuthData> functionAuthData) Clean up operation for auth when function is terminated.voidconfigureAuthenticationConfig(AuthenticationConfig authConfig, Optional<FunctionAuthData> functionAuthData) Set authentication configs for function instance based on the data in FunctionAuthenticationSpec.static FunctionAuthProvidergetAuthProvider(String className) updateAuthData(org.apache.pulsar.functions.proto.Function.FunctionDetails funcDetails, Optional<FunctionAuthData> existingFunctionAuthData, AuthenticationDataSource authenticationDataSource)
-
Method Details
-
configureAuthenticationConfig
void configureAuthenticationConfig(AuthenticationConfig authConfig, Optional<FunctionAuthData> functionAuthData) Set authentication configs for function instance based on the data in FunctionAuthenticationSpec.- Parameters:
authConfig- authentication configs passed to the function instancefunctionAuthData- function authentication data that is provider specific
-
cacheAuthData
Optional<FunctionAuthData> cacheAuthData(org.apache.pulsar.functions.proto.Function.FunctionDetails funcDetails, AuthenticationDataSource authenticationDataSource) throws Exception Cache auth data in as part of function metadata for function that runtime may need to configure authentication.- Parameters:
funcDetails- the function detailsauthenticationDataSource- auth data- Returns:
- Throws:
Exception
-
updateAuthData
Optional<FunctionAuthData> updateAuthData(org.apache.pulsar.functions.proto.Function.FunctionDetails funcDetails, Optional<FunctionAuthData> existingFunctionAuthData, AuthenticationDataSource authenticationDataSource) throws Exception - Throws:
Exception
-
cleanUpAuthData
void cleanUpAuthData(org.apache.pulsar.functions.proto.Function.FunctionDetails funcDetails, Optional<FunctionAuthData> functionAuthData) throws Exception Clean up operation for auth when function is terminated.- Parameters:
funcDetails- the function detailsfunctionAuthData- function auth data- Throws:
Exception
-
getAuthProvider
-