com.amazonaws.http.ExecutionContext.setSigner()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中com.amazonaws.http.ExecutionContext.setSigner()方法的一些代码示例,展示了ExecutionContext.setSigner()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExecutionContext.setSigner()方法的具体详情如下:
包路径:com.amazonaws.http.ExecutionContext
类名称:ExecutionContext
方法名:setSigner

ExecutionContext.setSigner介绍

[英]There is in general no need to set the signer in the execution context, since the signer for each request may differ depending on the URI of the request. The exception is S3 where the signer is currently determined only when the S3 client is constructed. Hence the need for this method. We may consider supporting a per request level signer determination for S3 later on.
[中]通常不需要在执行上下文中设置签名者,因为根据请求的URI,每个请求的签名者可能不同。S3是个例外,当前只有在构造S3客户端时才确定签名者。因此需要这种方法。我们可以考虑稍后支持S3的每个请求级签名者确定。

代码示例

代码示例来源:origin: apache/nifi

private ExecutionContext buildExecutionContext() {
  final ExecutionContext executionContext = ExecutionContext.builder().withSignerProvider(
      new DefaultSignerProvider(this, signer)).build();
  executionContext.setCredentialsProvider(credentials);
  executionContext.setSigner(signer);
  return executionContext;
}

代码示例来源:origin: aws-amplify/aws-sdk-android

credentials = originalRequest.getRequestCredentials();
executionContext.setSigner(createSigner(request, bucket, key));
executionContext.setCredentials(credentials);
response = client.execute(request, responseHandler,

代码示例来源:origin: org.apache.nifi/nifi-aws-abstract-processors

private ExecutionContext buildExecutionContext() {
  final ExecutionContext executionContext = ExecutionContext.builder().withSignerProvider(
      new DefaultSignerProvider(this, signer)).build();
  executionContext.setCredentialsProvider(credentials);
  executionContext.setSigner(signer);
  return executionContext;
}

代码示例来源:origin: IvonaSoftware/ivona-speechcloud-sdk-java

private <Y> Request<Y> prepareRequest(Request<Y> request, ExecutionContext executionContext, boolean signRequest) {
    request.setEndpoint(endpoint);
    request.setTimeOffset(timeOffset);

    AWSCredentials credentials = awsCredentialsProvider.getCredentials();

    AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
    if (originalRequest != null && originalRequest.getRequestCredentials() != null) {
      credentials = originalRequest.getRequestCredentials();
    }
    if (signRequest) {
      // expiration date is not currently supported on service side, but presignRequest method requires
      // this argument so one with default value is provided.
      Date expirationDate = DateTime.now(DateTimeZone.UTC)
          .plusMinutes(DEFAULT_GET_REQUEST_EXPIRATION_MINUTES).toDate();
      signer.presignRequest(request, credentials, expirationDate);
    } else {
      executionContext.setSigner(signer);
      executionContext.setCredentials(credentials);
    }
    return request;
  }
}

代码示例来源:origin: com.amazonaws/aws-android-sdk-s3

credentials = originalRequest.getRequestCredentials();
executionContext.setSigner(createSigner(request, bucket, key));
executionContext.setCredentials(credentials);
response = client.execute(request, responseHandler,

相关文章