Skip to content

Commit 1412e59

Browse files
authored
Revert "Adds support for S3 Multi-Region Access Point ARNs (#1400)" (#1401)
This reverts commit be17411.
1 parent be17411 commit 1412e59

File tree

132 files changed

+791
-4904
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+791
-4904
lines changed

.changelog/5be66d77e8e74ebcabbe5c6801a14a85.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsHttpPresignURLClientGenerator.java

Lines changed: 4 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ public class AwsHttpPresignURLClientGenerator implements GoIntegration {
7272
private static final Symbol presignerInterfaceSymbol = SymbolUtils.createPointableSymbolBuilder(
7373
"HTTPPresignerV4"
7474
).build();
75-
76-
private static final Symbol presignerV4aInterfaceSymbol = SymbolUtils.createPointableSymbolBuilder(
77-
"httpPresignerV4a"
78-
).build();
79-
80-
8175
private static final Symbol v4NewPresignerSymbol = SymbolUtils.createPointableSymbolBuilder(
8276
"NewSigner", AwsGoDependency.AWS_SIGNER_V4
8377
).build();
@@ -182,9 +176,6 @@ public void writeAdditionalFiles(
182176
// generate presigner interface
183177
writePresignInterface(writer, model, symbolProvider, serviceShape);
184178

185-
// generate s3 sigv4a presigner interface
186-
writePresignV4aInterface(writer, model, symbolProvider, serviceShape);
187-
188179
// generate presign options and helpers per service
189180
writePresignOptionType(writer, model, symbolProvider, serviceShape);
190181

@@ -380,37 +371,6 @@ private void writeConvertToPresignMiddleware(
380371

381372
// s3 service needs expires and sets unsignedPayload if input is stream
382373
if (isS3ServiceShape(model, serviceShape)) {
383-
384-
writer.write("");
385-
writer.write("// add multi-region access point presigner");
386-
387-
// ==== multi-region access point support
388-
Symbol PresignConstructor = SymbolUtils.createValueSymbolBuilder(
389-
"NewPresignHTTPRequestMiddleware", AwsCustomGoDependency.S3_CUSTOMIZATION
390-
).build();
391-
392-
Symbol PresignOptions = SymbolUtils.createValueSymbolBuilder(
393-
"PresignHTTPRequestMiddlewareOptions", AwsCustomGoDependency.S3_CUSTOMIZATION
394-
).build();
395-
396-
Symbol RegisterPresigningMiddleware = SymbolUtils.createValueSymbolBuilder(
397-
"RegisterPreSigningMiddleware", AwsCustomGoDependency.S3_CUSTOMIZATION
398-
).build();
399-
400-
writer.openBlock("signermv := $T($T{", "})",
401-
PresignConstructor,PresignOptions, () -> {
402-
writer.write("CredentialsProvider : options.Credentials,");
403-
writer.write("V4Presigner : c.Presigner,");
404-
writer.write("V4aPresigner : c.presignerV4a,");
405-
writer.write("LogSigning : options.ClientLogMode.IsSigning(),");
406-
});
407-
408-
writer.write("err = $T(stack, signermv)", RegisterPresigningMiddleware);
409-
writer.write("if err != nil { return err }");
410-
writer.write("");
411-
412-
// =======
413-
414374
writer.openBlock("if c.Expires < 0 {", "}", () -> {
415375
writer.addUseImports(SmithyGoDependency.FMT);
416376
writer.write(
@@ -477,13 +437,6 @@ private void writePresignClientType(
477437
});
478438
writer.write("");
479439

480-
if (isS3ServiceShape(model, serviceShape)) {
481-
writer.openBlock("if options.presignerV4a == nil {", "}", () -> {
482-
writer.write("options.presignerV4a = $L(c.options)", AwsSignatureVersion4.NEW_SIGNER_V4A_FUNC_NAME);
483-
});
484-
writer.write("");
485-
}
486-
487440
writer.openBlock("return &$L{", "}", presignClientSymbol, () -> {
488441
writer.write("client: c,");
489442
writer.write("options: options,");
@@ -541,38 +494,6 @@ public void writePresignInterface(
541494
writer.write("");
542495
}
543496

544-
545-
/**
546-
* Writes the presigner sigv4a interface used by the presign url client
547-
*/
548-
public void writePresignV4aInterface(
549-
GoWriter writer,
550-
Model model,
551-
SymbolProvider symbolProvider,
552-
ServiceShape serviceShape
553-
) {
554-
if (!isS3ServiceShape(model, serviceShape)) {
555-
return;
556-
}
557-
558-
Symbol signerOptionsSymbol = SymbolUtils.createPointableSymbolBuilder(
559-
"SignerOptions", AwsCustomGoDependency.S3_SIGV4A_CUSTOMIZATION).build();
560-
561-
writer.writeDocs(
562-
String.format("%s represents sigv4a presigner interface used by presign url client",
563-
presignerV4aInterfaceSymbol.getName())
564-
);
565-
writer.openBlock("type $T interface {", "}", presignerV4aInterfaceSymbol, () -> {
566-
writer.write("PresignHTTP(");
567-
writer.write("ctx context.Context, credentials v4a.Credentials, r *http.Request,");
568-
writer.write("payloadHash string, service string, regionSet []string, signingTime time.Time,");
569-
writer.write("optFns ...func($P),", signerOptionsSymbol);
570-
writer.write(") (url string, signedHeader http.Header, err error)");
571-
});
572-
573-
writer.write("");
574-
}
575-
576497
/**
577498
* Writes the Presign client's type and methods.
578499
*
@@ -609,13 +530,8 @@ public void writePresignOptionType(
609530
)
610531
);
611532
writer.write("Expires time.Duration");
612-
writer.write("");
613-
614-
writer.writeDocs("presignerV4a is the presigner used by the presign url client");
615-
writer.write("presignerV4a $T", presignerV4aInterfaceSymbol);
616533
}
617534
});
618-
619535
writer.openBlock("func (o $T) copy() $T {", "}", presignOptionsSymbol, presignOptionsSymbol, () -> {
620536
writer.write("clientOptions := make([]func(*Options), len(o.ClientOptions))");
621537
writer.write("copy(clientOptions, o.ClientOptions)");
@@ -632,15 +548,15 @@ public void writePresignOptionType(
632548
writer.openBlock("func $L(optFns ...func(*Options)) func($P) {", "}",
633549
PRESIGN_OPTIONS_FROM_CLIENT_OPTIONS, presignOptionsSymbol, () -> {
634550
writer.write("return $L(optFns).options", presignOptionsFromClientOptionsInternal.getName());
635-
});
551+
});
636552

637553
writer.insertTrailingNewline();
638554

639555
writer.write("type $L []func(*Options)", presignOptionsFromClientOptionsInternal.getName());
640556
writer.openBlock("func (w $L) options (o $P) {", "}",
641557
presignOptionsFromClientOptionsInternal.getName(), presignOptionsSymbol, () -> {
642558
writer.write("o.ClientOptions = append(o.ClientOptions, w...)");
643-
}).insertTrailingNewline();
559+
}).insertTrailingNewline();
644560

645561

646562
// s3 specific helpers
@@ -653,15 +569,15 @@ public void writePresignOptionType(
653569
writer.openBlock("func $L(dur time.Duration) func($P) {", "}",
654570
PRESIGN_OPTIONS_FROM_EXPIRES, presignOptionsSymbol, () -> {
655571
writer.write("return $L(dur).options", presignOptionsFromExpiresInternal.getName());
656-
});
572+
});
657573

658574
writer.insertTrailingNewline();
659575

660576
writer.write("type $L time.Duration", presignOptionsFromExpiresInternal.getName());
661577
writer.openBlock("func (w $L) options (o $P) {", "}",
662578
presignOptionsFromExpiresInternal.getName(), presignOptionsSymbol, () -> {
663579
writer.write("o.Expires = time.Duration(w)");
664-
}).insertTrailingNewline();
580+
}).insertTrailingNewline();
665581
}
666582
}
667583

codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsSignatureVersion4.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public final class AwsSignatureVersion4 implements GoIntegration {
4646
public static final String SIGNER_INTERFACE_NAME = "HTTPSignerV4";
4747
public static final String SIGNER_CONFIG_FIELD_NAME = SIGNER_INTERFACE_NAME;
4848
public static final String NEW_SIGNER_FUNC_NAME = "newDefaultV4Signer";
49-
public static final String NEW_SIGNER_V4A_FUNC_NAME = "newDefaultV4aSigner";
5049
public static final String SIGNER_RESOLVER = "resolve" + SIGNER_CONFIG_FIELD_NAME;
5150

5251
private static final List<String> DISABLE_URI_PATH_ESCAPE = ListUtils.of("com.amazonaws.s3#AmazonS3");

codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/AwsCustomGoDependency.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public final class AwsCustomGoDependency extends AwsGoDependency {
2626
"service/dynamodb/internal/customizations", "ddbcust");
2727
public static final GoDependency S3_CUSTOMIZATION = aws("service/s3/internal/customizations", "s3cust");
2828
public static final GoDependency S3CONTROL_CUSTOMIZATION = aws("service/s3control/internal/customizations", "s3controlcust");
29-
public static final GoDependency S3_SIGV4A_CUSTOMIZATION = aws("service/s3/internal/v4a");
3029
public static final GoDependency APIGATEWAY_CUSTOMIZATION = aws(
3130
"service/apigateway/internal/customizations", "agcust");
3231
public static final GoDependency GLACIER_CUSTOMIZATION = aws(

0 commit comments

Comments
 (0)