Interface ModelAuthProvider
public interface ModelAuthProvider
Model authentication providers can be used to supply credentials such as access tokens, API keys, and other type of
credentials.
Providers which support a specific named model only must be annotated with a ModelName
annotation.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionProvide authorization data which will be set as an HTTP Authorization header value.static Optional
<ModelAuthProvider> Resolve ModelAuthProvider.
-
Method Details
-
getAuthorization
Provide authorization data which will be set as an HTTP Authorization header value.- Parameters:
input
- representation of an HTTP request to the model provider.- Returns:
- authorization data which must include an HTTP Authorization scheme value, for example: "Bearer the_access_token". Returning null will result in no Authorization header being set.
-
resolve
Resolve ModelAuthProvider.- Parameters:
modelName
- the model name. If the model name is not null then a ModelAuthProvider with a matchingModelName
annotation are preferred to a global ModelAuthProvider.- Returns:
- Resolved ModelAuthProvider as an Optional value which will be empty if no ModelAuthProvider is available.
-