Package com.stackrox.invoker.auth
Class HttpBearerAuth
- java.lang.Object
-
- com.stackrox.invoker.auth.HttpBearerAuth
-
- All Implemented Interfaces:
Authentication
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2024-01-17T12:38:53.222196Z[Etc/UTC]") public class HttpBearerAuth extends Object implements Authentication
-
-
Constructor Summary
Constructors Constructor Description HttpBearerAuth(String scheme)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyToParams(List<com.stackrox.invoker.Pair> queryParams, Map<String,String> headerParams, Map<String,String> cookieParams, String payload, String method, URI uri)
Apply authentication settings to header and query params.String
getBearerToken()
Gets the token, which together with the scheme, will be sent as the value of the Authorization header.void
setBearerToken(String bearerToken)
Sets the token, which together with the scheme, will be sent as the value of the Authorization header.void
setBearerToken(Supplier<String> tokenSupplier)
Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header.
-
-
-
Constructor Detail
-
HttpBearerAuth
public HttpBearerAuth(String scheme)
-
-
Method Detail
-
getBearerToken
public String getBearerToken()
Gets the token, which together with the scheme, will be sent as the value of the Authorization header.- Returns:
- The bearer token
-
setBearerToken
public void setBearerToken(String bearerToken)
Sets the token, which together with the scheme, will be sent as the value of the Authorization header.- Parameters:
bearerToken
- The bearer token to send in the Authorization header
-
setBearerToken
public void setBearerToken(Supplier<String> tokenSupplier)
Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header.- Parameters:
tokenSupplier
- The supplier of bearer tokens to send in the Authorization header
-
applyToParams
public void applyToParams(List<com.stackrox.invoker.Pair> queryParams, Map<String,String> headerParams, Map<String,String> cookieParams, String payload, String method, URI uri) throws com.stackrox.invoker.ApiException
Description copied from interface:Authentication
Apply authentication settings to header and query params.- Specified by:
applyToParams
in interfaceAuthentication
- Parameters:
queryParams
- List of query parametersheaderParams
- Map of header parameterscookieParams
- Map of cookie parameterspayload
- HTTP request bodymethod
- HTTP methoduri
- URI- Throws:
com.stackrox.invoker.ApiException
- if failed to update the parameters
-
-