- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
121 lines
6.9 KiB
Java
121 lines
6.9 KiB
Java
package com.amazonaws.services.securitytoken;
|
|
|
|
import com.amazonaws.AmazonWebServiceClient;
|
|
import com.amazonaws.AmazonWebServiceRequest;
|
|
import com.amazonaws.ClientConfiguration;
|
|
import com.amazonaws.Request;
|
|
import com.amazonaws.Response;
|
|
import com.amazonaws.auth.AWSCredentials;
|
|
import com.amazonaws.auth.AWSCredentialsProvider;
|
|
import com.amazonaws.handlers.HandlerChainFactory;
|
|
import com.amazonaws.http.DefaultErrorResponseHandler;
|
|
import com.amazonaws.http.ExecutionContext;
|
|
import com.amazonaws.http.HttpClient;
|
|
import com.amazonaws.http.StaxResponseHandler;
|
|
import com.amazonaws.http.UrlHttpClient;
|
|
import com.amazonaws.internal.StaticCredentialsProvider;
|
|
import com.amazonaws.services.securitytoken.model.AssumeRoleWithWebIdentityRequest;
|
|
import com.amazonaws.services.securitytoken.model.AssumeRoleWithWebIdentityResult;
|
|
import com.amazonaws.services.securitytoken.model.transform.AssumeRoleWithWebIdentityRequestMarshaller;
|
|
import com.amazonaws.services.securitytoken.model.transform.AssumeRoleWithWebIdentityResultStaxUnmarshaller;
|
|
import com.amazonaws.services.securitytoken.model.transform.ExpiredTokenExceptionUnmarshaller;
|
|
import com.amazonaws.services.securitytoken.model.transform.IDPCommunicationErrorExceptionUnmarshaller;
|
|
import com.amazonaws.services.securitytoken.model.transform.IDPRejectedClaimExceptionUnmarshaller;
|
|
import com.amazonaws.services.securitytoken.model.transform.InvalidAuthorizationMessageExceptionUnmarshaller;
|
|
import com.amazonaws.services.securitytoken.model.transform.InvalidIdentityTokenExceptionUnmarshaller;
|
|
import com.amazonaws.services.securitytoken.model.transform.MalformedPolicyDocumentExceptionUnmarshaller;
|
|
import com.amazonaws.services.securitytoken.model.transform.PackedPolicyTooLargeExceptionUnmarshaller;
|
|
import com.amazonaws.services.securitytoken.model.transform.RegionDisabledExceptionUnmarshaller;
|
|
import com.amazonaws.transform.StandardErrorUnmarshaller;
|
|
import com.amazonaws.transform.Unmarshaller;
|
|
import com.amazonaws.util.AWSRequestMetrics;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class AWSSecurityTokenServiceClient extends AmazonWebServiceClient implements AWSSecurityTokenService {
|
|
public AWSCredentialsProvider awsCredentialsProvider;
|
|
public final List exceptionUnmarshallers;
|
|
|
|
public static ClientConfiguration adjustClientConfiguration(ClientConfiguration clientConfiguration) {
|
|
return clientConfiguration;
|
|
}
|
|
|
|
public AWSSecurityTokenServiceClient(AWSCredentials aWSCredentials, ClientConfiguration clientConfiguration) {
|
|
this(new StaticCredentialsProvider(aWSCredentials), clientConfiguration);
|
|
}
|
|
|
|
public AWSSecurityTokenServiceClient(AWSCredentialsProvider aWSCredentialsProvider, ClientConfiguration clientConfiguration) {
|
|
this(aWSCredentialsProvider, clientConfiguration, new UrlHttpClient(clientConfiguration));
|
|
}
|
|
|
|
public AWSSecurityTokenServiceClient(AWSCredentialsProvider aWSCredentialsProvider, ClientConfiguration clientConfiguration, HttpClient httpClient) {
|
|
super(adjustClientConfiguration(clientConfiguration), httpClient);
|
|
this.exceptionUnmarshallers = new ArrayList();
|
|
this.awsCredentialsProvider = aWSCredentialsProvider;
|
|
init();
|
|
}
|
|
|
|
public final void init() {
|
|
this.exceptionUnmarshallers.add(new ExpiredTokenExceptionUnmarshaller());
|
|
this.exceptionUnmarshallers.add(new IDPCommunicationErrorExceptionUnmarshaller());
|
|
this.exceptionUnmarshallers.add(new IDPRejectedClaimExceptionUnmarshaller());
|
|
this.exceptionUnmarshallers.add(new InvalidAuthorizationMessageExceptionUnmarshaller());
|
|
this.exceptionUnmarshallers.add(new InvalidIdentityTokenExceptionUnmarshaller());
|
|
this.exceptionUnmarshallers.add(new MalformedPolicyDocumentExceptionUnmarshaller());
|
|
this.exceptionUnmarshallers.add(new PackedPolicyTooLargeExceptionUnmarshaller());
|
|
this.exceptionUnmarshallers.add(new RegionDisabledExceptionUnmarshaller());
|
|
this.exceptionUnmarshallers.add(new StandardErrorUnmarshaller());
|
|
setEndpoint("sts.amazonaws.com");
|
|
this.endpointPrefix = "sts";
|
|
HandlerChainFactory handlerChainFactory = new HandlerChainFactory();
|
|
this.requestHandler2s.addAll(handlerChainFactory.newRequestHandlerChain("/com/amazonaws/services/securitytoken/request.handlers"));
|
|
this.requestHandler2s.addAll(handlerChainFactory.newRequestHandler2Chain("/com/amazonaws/services/securitytoken/request.handler2s"));
|
|
}
|
|
|
|
@Override // com.amazonaws.services.securitytoken.AWSSecurityTokenService
|
|
public AssumeRoleWithWebIdentityResult assumeRoleWithWebIdentity(AssumeRoleWithWebIdentityRequest assumeRoleWithWebIdentityRequest) {
|
|
Response response;
|
|
ExecutionContext createExecutionContext = createExecutionContext(assumeRoleWithWebIdentityRequest);
|
|
AWSRequestMetrics awsRequestMetrics = createExecutionContext.getAwsRequestMetrics();
|
|
AWSRequestMetrics.Field field = AWSRequestMetrics.Field.ClientExecuteTime;
|
|
awsRequestMetrics.startEvent(field);
|
|
Request request = null;
|
|
Response response2 = null;
|
|
try {
|
|
Request marshall = new AssumeRoleWithWebIdentityRequestMarshaller().marshall(assumeRoleWithWebIdentityRequest);
|
|
try {
|
|
marshall.setAWSRequestMetrics(awsRequestMetrics);
|
|
response2 = invoke(marshall, new AssumeRoleWithWebIdentityResultStaxUnmarshaller(), createExecutionContext);
|
|
AssumeRoleWithWebIdentityResult assumeRoleWithWebIdentityResult = (AssumeRoleWithWebIdentityResult) response2.getAwsResponse();
|
|
awsRequestMetrics.endEvent(field);
|
|
endClientExecution(awsRequestMetrics, marshall, response2);
|
|
return assumeRoleWithWebIdentityResult;
|
|
} catch (Throwable th) {
|
|
th = th;
|
|
Response response3 = response2;
|
|
request = marshall;
|
|
response = response3;
|
|
awsRequestMetrics.endEvent(AWSRequestMetrics.Field.ClientExecuteTime);
|
|
endClientExecution(awsRequestMetrics, request, response);
|
|
throw th;
|
|
}
|
|
} catch (Throwable th2) {
|
|
th = th2;
|
|
response = null;
|
|
}
|
|
}
|
|
|
|
public final Response invoke(Request request, Unmarshaller unmarshaller, ExecutionContext executionContext) {
|
|
request.setEndpoint(this.endpoint);
|
|
request.setTimeOffset(this.timeOffset);
|
|
AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
|
|
AWSCredentials credentials = this.awsCredentialsProvider.getCredentials();
|
|
if (originalRequest.getRequestCredentials() != null) {
|
|
credentials = originalRequest.getRequestCredentials();
|
|
}
|
|
executionContext.setCredentials(credentials);
|
|
return this.client.execute(request, new StaxResponseHandler(unmarshaller), new DefaultErrorResponseHandler(this.exceptionUnmarshallers), executionContext);
|
|
}
|
|
}
|