Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lauzadis committed Feb 8, 2024
1 parent 8748f53 commit 50ee25d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 66 deletions.
96 changes: 48 additions & 48 deletions aws-runtime/aws-http/api/aws-http.api
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ public final class aws/sdk/kotlin/runtime/http/OsMetadata {
public fun toString ()Ljava/lang/String;
}

public final class aws/sdk/kotlin/runtime/http/S3ExpressHttpSigner : aws/smithy/kotlin/runtime/http/auth/HttpSigner {
public fun <init> (Laws/smithy/kotlin/runtime/http/auth/AwsHttpSigner;)V
public final fun getAwsHttpSigner ()Laws/smithy/kotlin/runtime/http/auth/AwsHttpSigner;
public fun sign (Laws/smithy/kotlin/runtime/http/auth/SignHttpRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class aws/sdk/kotlin/runtime/http/SdkMetadata {
public fun <init> (Ljava/lang/String;Ljava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
Expand Down Expand Up @@ -162,8 +168,11 @@ public final class aws/sdk/kotlin/runtime/http/interceptors/AwsSpanInterceptor :
public fun readBeforeTransmit (Laws/smithy/kotlin/runtime/client/ProtocolRequestInterceptorContext;)V
}

public final class aws/sdk/kotlin/runtime/http/interceptors/UnsupportedSigningAlgorithmInterceptor : aws/smithy/kotlin/runtime/client/Interceptor {
public final class aws/sdk/kotlin/runtime/http/interceptors/S3ExpressCrc32ChecksumInterceptor : aws/smithy/kotlin/runtime/client/Interceptor {
public fun <init> ()V
public fun <init> (Ljava/lang/String;)V
public synthetic fun <init> (Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getChecksumAlgorithmHeaderName ()Ljava/lang/String;
public fun modifyBeforeAttemptCompletion-gIAlu-s (Laws/smithy/kotlin/runtime/client/ResponseInterceptorContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun modifyBeforeCompletion-gIAlu-s (Laws/smithy/kotlin/runtime/client/ResponseInterceptorContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun modifyBeforeDeserialization (Laws/smithy/kotlin/runtime/client/ProtocolResponseInterceptorContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand All @@ -185,53 +194,8 @@ public final class aws/sdk/kotlin/runtime/http/interceptors/UnsupportedSigningAl
public fun readBeforeTransmit (Laws/smithy/kotlin/runtime/client/ProtocolRequestInterceptorContext;)V
}

public final class aws/sdk/kotlin/runtime/http/middleware/AwsRetryHeaderMiddleware : aws/smithy/kotlin/runtime/http/operation/MutateMiddleware {
public fun <init> ()V
public fun handle (Laws/smithy/kotlin/runtime/http/operation/OperationRequest;Laws/smithy/kotlin/runtime/io/Handler;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public synthetic fun handle (Ljava/lang/Object;Laws/smithy/kotlin/runtime/io/Handler;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun install (Laws/smithy/kotlin/runtime/http/operation/SdkHttpOperation;)V
}

public final class aws/sdk/kotlin/runtime/http/middleware/RecursionDetection : aws/smithy/kotlin/runtime/http/operation/ModifyRequestMiddleware {
public fun <init> ()V
public fun <init> (Laws/smithy/kotlin/runtime/util/EnvironmentProvider;)V
public synthetic fun <init> (Laws/smithy/kotlin/runtime/util/EnvironmentProvider;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun install (Laws/smithy/kotlin/runtime/http/operation/SdkHttpOperation;)V
public fun modifyRequest (Laws/smithy/kotlin/runtime/http/operation/OperationRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public synthetic fun modifyRequest (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class aws/sdk/kotlin/runtime/http/middleware/UserAgent : aws/smithy/kotlin/runtime/http/operation/ModifyRequestMiddleware {
public fun <init> (Laws/sdk/kotlin/runtime/http/AwsUserAgentMetadata;)V
public fun install (Laws/smithy/kotlin/runtime/http/operation/SdkHttpOperation;)V
public fun modifyRequest (Laws/smithy/kotlin/runtime/http/operation/OperationRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public synthetic fun modifyRequest (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class aws/sdk/kotlin/runtime/http/operation/ConfigMetadata : aws/sdk/kotlin/runtime/http/operation/TypedUserAgentMetadata {
public fun <init> (Ljava/lang/String;Ljava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Ljava/lang/String;
public final fun copy (Ljava/lang/String;Ljava/lang/String;)Laws/sdk/kotlin/runtime/http/operation/ConfigMetadata;
public static synthetic fun copy$default (Laws/sdk/kotlin/runtime/http/operation/ConfigMetadata;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Laws/sdk/kotlin/runtime/http/operation/ConfigMetadata;
public fun equals (Ljava/lang/Object;)Z
public final fun getName ()Ljava/lang/String;
public final fun getValue ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class aws/sdk/kotlin/runtime/http/S3ExpressHttpSigner : aws/smithy/kotlin/runtime/http/auth/HttpSigner {
public fun <init> (Laws/smithy/kotlin/runtime/http/auth/AwsHttpSigner;)V
public final fun getAwsHttpSigner ()Laws/smithy/kotlin/runtime/http/auth/AwsHttpSigner;
public fun sign (Laws/smithy/kotlin/runtime/http/auth/SignHttpRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class aws/sdk/kotlin/runtime/http/interceptors/S3ExpressCrc32ChecksumInterceptor : aws/smithy/kotlin/runtime/client/Interceptor {
public final class aws/sdk/kotlin/runtime/http/interceptors/S3ExpressDisableChecksumInterceptor : aws/smithy/kotlin/runtime/client/Interceptor {
public fun <init> ()V
public fun <init> (Ljava/lang/String;)V
public synthetic fun <init> (Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getChecksumAlgorithmHeaderName ()Ljava/lang/String;
public fun modifyBeforeAttemptCompletion-gIAlu-s (Laws/smithy/kotlin/runtime/client/ResponseInterceptorContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun modifyBeforeCompletion-gIAlu-s (Laws/smithy/kotlin/runtime/client/ResponseInterceptorContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun modifyBeforeDeserialization (Laws/smithy/kotlin/runtime/client/ProtocolResponseInterceptorContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand All @@ -253,7 +217,7 @@ public final class aws/sdk/kotlin/runtime/http/interceptors/S3ExpressCrc32Checks
public fun readBeforeTransmit (Laws/smithy/kotlin/runtime/client/ProtocolRequestInterceptorContext;)V
}

public final class aws/sdk/kotlin/runtime/http/interceptors/S3ExpressDisableChecksumInterceptor : aws/smithy/kotlin/runtime/client/Interceptor {
public final class aws/sdk/kotlin/runtime/http/interceptors/UnsupportedSigningAlgorithmInterceptor : aws/smithy/kotlin/runtime/client/Interceptor {
public fun <init> ()V
public fun modifyBeforeAttemptCompletion-gIAlu-s (Laws/smithy/kotlin/runtime/client/ResponseInterceptorContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun modifyBeforeCompletion-gIAlu-s (Laws/smithy/kotlin/runtime/client/ResponseInterceptorContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand All @@ -276,6 +240,42 @@ public final class aws/sdk/kotlin/runtime/http/interceptors/S3ExpressDisableChec
public fun readBeforeTransmit (Laws/smithy/kotlin/runtime/client/ProtocolRequestInterceptorContext;)V
}

public final class aws/sdk/kotlin/runtime/http/middleware/AwsRetryHeaderMiddleware : aws/smithy/kotlin/runtime/http/operation/MutateMiddleware {
public fun <init> ()V
public fun handle (Laws/smithy/kotlin/runtime/http/operation/OperationRequest;Laws/smithy/kotlin/runtime/io/Handler;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public synthetic fun handle (Ljava/lang/Object;Laws/smithy/kotlin/runtime/io/Handler;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun install (Laws/smithy/kotlin/runtime/http/operation/SdkHttpOperation;)V
}

public final class aws/sdk/kotlin/runtime/http/middleware/RecursionDetection : aws/smithy/kotlin/runtime/http/operation/ModifyRequestMiddleware {
public fun <init> ()V
public fun <init> (Laws/smithy/kotlin/runtime/util/EnvironmentProvider;)V
public synthetic fun <init> (Laws/smithy/kotlin/runtime/util/EnvironmentProvider;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun install (Laws/smithy/kotlin/runtime/http/operation/SdkHttpOperation;)V
public fun modifyRequest (Laws/smithy/kotlin/runtime/http/operation/OperationRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public synthetic fun modifyRequest (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class aws/sdk/kotlin/runtime/http/middleware/UserAgent : aws/smithy/kotlin/runtime/http/operation/ModifyRequestMiddleware {
public fun <init> (Laws/sdk/kotlin/runtime/http/AwsUserAgentMetadata;)V
public fun install (Laws/smithy/kotlin/runtime/http/operation/SdkHttpOperation;)V
public fun modifyRequest (Laws/smithy/kotlin/runtime/http/operation/OperationRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public synthetic fun modifyRequest (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class aws/sdk/kotlin/runtime/http/operation/ConfigMetadata : aws/sdk/kotlin/runtime/http/operation/TypedUserAgentMetadata {
public fun <init> (Ljava/lang/String;Ljava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Ljava/lang/String;
public final fun copy (Ljava/lang/String;Ljava/lang/String;)Laws/sdk/kotlin/runtime/http/operation/ConfigMetadata;
public static synthetic fun copy$default (Laws/sdk/kotlin/runtime/http/operation/ConfigMetadata;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Laws/sdk/kotlin/runtime/http/operation/ConfigMetadata;
public fun equals (Ljava/lang/Object;)Z
public final fun getName ()Ljava/lang/String;
public final fun getValue ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class aws/sdk/kotlin/runtime/http/operation/CustomUserAgentMetadata {
public fun <init> ()V
public fun <init> (Ljava/util/Map;Ljava/util/List;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ class ClientConfigIntegration : KotlinIntegration {
},
)

// FIXME Figure out why the default value is not being used properly.
// propertyType = ConfigPropertyType.RequiredWithDefault("S3ExpressCredentialsProvider(this.credentialsProvider)")
propertyType = ConfigPropertyType.Custom(
render = { _, writer ->
writer.write("public val $name: S3ExpressCredentialsProvider = builder.$name ?: SdkS3ExpressCredentialsProvider(this.credentialsProvider)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import software.amazon.smithy.kotlin.codegen.rendering.protocol.*
import software.amazon.smithy.kotlin.codegen.utils.getOrNull
import software.amazon.smithy.model.Model
import software.amazon.smithy.model.node.Node
import software.amazon.smithy.model.node.ObjectNode
import software.amazon.smithy.model.shapes.OperationShape
import software.amazon.smithy.model.shapes.ServiceShape
import software.amazon.smithy.model.shapes.ShapeId
Expand Down Expand Up @@ -93,19 +92,13 @@ open class SigV4S3ExpressAuthSchemeHandler : AuthSchemeHandler {
}
}

private fun String.toAuthOptionFactoryFn(): Symbol? =
when (this) {
"sigv4-s3express" -> AwsRuntimeTypes.Config.Auth.sigV4S3Express
else -> null
}

private fun renderAuthSchemes(writer: KotlinWriter, authSchemes: Expression, expressionRenderer: ExpressionRenderer) {
writer.writeInline("#T to ", RuntimeTypes.SmithyClient.Endpoints.SigningContextAttributeKey)
writer.withBlock("listOf(", ")") {
authSchemes.toNode().expectArrayNode().forEach {
val scheme = it.expectObjectNode()
val schemeName = scheme.expectStringMember("name").value
val authFactoryFn = schemeName.toAuthOptionFactoryFn() ?: return@forEach
val authFactoryFn = if (schemeName == "sigv4-s3express") AwsRuntimeTypes.Config.Auth.sigV4S3Express else return@forEach

withBlock("#T(", "),", authFactoryFn) {
// we delegate back to the expression visitor for each of these fields because it's possible to
Expand All @@ -117,9 +110,8 @@ private fun renderAuthSchemes(writer: KotlinWriter, authSchemes: Expression, exp
writeInline("disableDoubleUriEncode = ")
renderOrElse(expressionRenderer, scheme.getBooleanMember("disableDoubleEncoding"), "false")

when (schemeName) {
"sigv4-s3express" -> renderSigV4ExpressFields(writer, scheme, expressionRenderer)
}
writer.writeInline("signingRegion = ")
writer.renderOrElse(expressionRenderer, scheme.getStringMember("signingRegion"), "null")
}
}
}
Expand All @@ -137,8 +129,3 @@ private fun KotlinWriter.renderOrElse(
}
write(",")
}

private fun renderSigV4ExpressFields(writer: KotlinWriter, scheme: ObjectNode, expressionRenderer: ExpressionRenderer) {
writer.writeInline("signingRegion = ")
writer.renderOrElse(expressionRenderer, scheme.getStringMember("signingRegion"), "null")
}

0 comments on commit 50ee25d

Please sign in to comment.