-
Notifications
You must be signed in to change notification settings - Fork 916
Added support for endpoint variants in endpoint metadata: FIPS and DUALSTACK. #2808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
default String endpointPrefix() { | ||
throw new UnsupportedOperationException(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add Javadoc for this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, meant to delete this.
|
||
@Override | ||
public Set<EndpointTag> tags() { | ||
return Collections.unmodifiableSet(tags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, might consider wrapping it in the ctor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
|
||
@Override | ||
public boolean equals(Object o) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test for hashcode and equals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
@Override | ||
public Set<EndpointTag> tags() { | ||
return Collections.unmodifiableSet(tags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, might be better to wrap it in the ctor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
*/ | ||
@SdkPublicApi | ||
@Immutable | ||
public interface ServiceEndpointKey { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need an interface since this looks like a data class? Same comment for PartitionEndpointKey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -0,0 +1,102 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to exclude this module from mvn release command and add it to the excluded import list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
import software.amazon.awssdk.utils.StringUtils; | ||
import software.amazon.awssdk.utils.internal.CodegenNamingUtils; | ||
|
||
public class EndpointTagGenerator implements PoetClass { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test to generate EndpointTag? It's hard to tell what EndpointTag looks like from codegen code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
7ee3e3b
to
13b47a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a changelog entry?
<exclude>software.amazon.awssdk.regions.ServiceMetadata</exclude> | ||
<exclude>software.amazon.awssdk.regions.servicemetadata.*ServiceMetadata</exclude> | ||
<exclude>software.amazon.awssdk.regions.DefaultServiceMetadata</exclude> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to exclude them after METHOD_ABSTRACT_NOW_DEFAULT
override is added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's being too picky about backwards-compatible. There weren't any actual breaking changes in these classes, since we added the implementation in the parent interface.
|
||
import static org.junit.Assert.*; | ||
|
||
public class EndpointTagGeneratorTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meant to delete this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@@ -78,25 +107,6 @@ static ServiceMetadata of(String serviceEndpointPrefix) { | |||
return metadata == null ? new DefaultServiceMetadata(serviceEndpointPrefix) : metadata; | |||
} | |||
|
|||
default String computeEndpoint(String endpointPrefix, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a breaking change. Should we deprecate it instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nvm, saw it in the description. Can we mention it in the change log entry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am almost certain that no one is using it. I'd much rather just delete it, because anyone using it is almost certainly doing it wrong.
I'll add a changelog entry when this is finalized. It won't be merged to master until the fips and dualstack changes are in place (actually using the tags). |
…ALSTACK. This adds the ability to resolve fips and dualstack endpoints with a "fips enabled" or "dualstack enabled" flag. E.g. ```java URI fipsEndpoint = ServiceMetadata.of(S3Client.SERVICE_METADATA_ID) .endpointFor(ServiceEndpointKey.builder() .region(Region.US_WEST_2) .tags(EndpointTag.FIPS) .build()); ``` The following public API changes were made: 1. Added `ServiceMetadata.endpointFor(ServiceEndpointKey)` 2. Added `ServiceMetadata.signingRegion(ServiceEndpointKey)` 3. Added `PartitionMetadata.hostname(PartitionEndpointKey)` 4. Added `PartitionMetadata.dnsSuffix(PartitionEndpointKey)` 5. Added a generated `EndpointTag` class, which currently contains FIPS and DUALSTACK. 6. Removed `ServiceMetadata.computeEndpoint`, because it shouldn't have ever been public, and no one should be using it. The following module changes were made: 1. Added `regions-testing` for verifying region resolution behavior that doesn't currently exist in the endpoints.json
13b47a6
to
3f28c17
Compare
Kudos, SonarCloud Quality Gate passed! |
Merged to branch |
This option can be used to make calls be invoked against AWS endpoints which return IPv6 records. This can also be enabled via the `AWS_USE_DUALSTACK_ENDPOINT` environment variable, `aws.useDualstackEndpoint` system property, or the `use_dualstack_endpoint` profile file property: 1. This PR builds on top of the 'endpoint variants' #2808, by specifying the DUALSTACK endpoint variant whenever the customer requests dualstack to be enabled. 2. The bulk of the files in this PR are addressing the fact that we already have service configuration for enabling dualstack for S3 and S3 control. These existing options have been deprecated in favor of the new option that works for all services.
This option can be used to make calls be invoked against AWS endpoints which return IPv6 records. This can also be enabled via the `AWS_USE_DUALSTACK_ENDPOINT` environment variable, `aws.useDualstackEndpoint` system property, or the `use_dualstack_endpoint` profile file property: 1. This PR builds on top of the 'endpoint variants' #2808, by specifying the DUALSTACK endpoint variant whenever the customer requests dualstack to be enabled. 2. The bulk of the files in this PR are addressing the fact that we already have service configuration for enabling dualstack for S3 and S3 control. These existing options have been deprecated in favor of the new option that works for all services.
This option can be used to make calls be invoked against AWS endpoints which return IPv6 records. This can also be enabled via the `AWS_USE_DUALSTACK_ENDPOINT` environment variable, `aws.useDualstackEndpoint` system property, or the `use_dualstack_endpoint` profile file property: 1. This PR builds on top of the 'endpoint variants' #2808, by specifying the DUALSTACK endpoint variant whenever the customer requests dualstack to be enabled. 2. The bulk of the files in this PR are addressing the fact that we already have service configuration for enabling dualstack for S3 and S3 control. These existing options have been deprecated in favor of the new option that works for all services.
This option can be used to make calls be invoked against AWS endpoints which return IPv6 records. This can also be enabled via the `AWS_USE_DUALSTACK_ENDPOINT` environment variable, `aws.useDualstackEndpoint` system property, or the `use_dualstack_endpoint` profile file property: 1. This PR builds on top of the 'endpoint variants' #2808, by specifying the DUALSTACK endpoint variant whenever the customer requests dualstack to be enabled. 2. The bulk of the files in this PR are addressing the fact that we already have service configuration for enabling dualstack for S3 and S3 control. These existing options have been deprecated in favor of the new option that works for all services.
* Added support for endpoint variants in endpoint metadata: FIPS and DUALSTACK. This adds the ability to resolve fips and dualstack endpoints with a "fips enabled" or "dualstack enabled" flag. E.g. ```java URI fipsEndpoint = ServiceMetadata.of(S3Client.SERVICE_METADATA_ID) .endpointFor(ServiceEndpointKey.builder() .region(Region.US_WEST_2) .tags(EndpointTag.FIPS) .build()); ``` The following public API changes were made: 1. Added `ServiceMetadata.endpointFor(ServiceEndpointKey)` 2. Added `ServiceMetadata.signingRegion(ServiceEndpointKey)` 3. Added `PartitionMetadata.hostname(PartitionEndpointKey)` 4. Added `PartitionMetadata.dnsSuffix(PartitionEndpointKey)` 5. Added a generated `EndpointTag` class, which currently contains FIPS and DUALSTACK. 6. Removed `ServiceMetadata.computeEndpoint`, because it shouldn't have ever been public, and no one should be using it. The following module changes were made: 1. Added `regions-testing` for verifying region resolution behavior that doesn't currently exist in the endpoints.json * Added a new `dualstackEnabled` property to every client builder. (#2818) This option can be used to make calls be invoked against AWS endpoints which return IPv6 records. This can also be enabled via the `AWS_USE_DUALSTACK_ENDPOINT` environment variable, `aws.useDualstackEndpoint` system property, or the `use_dualstack_endpoint` profile file property: 1. This PR builds on top of the 'endpoint variants' #2808, by specifying the DUALSTACK endpoint variant whenever the customer requests dualstack to be enabled. 2. The bulk of the files in this PR are addressing the fact that we already have service configuration for enabling dualstack for S3 and S3 control. These existing options have been deprecated in favor of the new option that works for all services. * Added support for enabling FIPS endpoints. (#2826) This option can be used to make calls be invoked against FIPS-compliant AWS endpoints. This can also be enabled via the AWS_USE_FIPS_ENDPOINT environment variable, aws.useFipsEndpoint system property, or the use_fips_endpoint profile file property:
…034aaea97 Pull request: release <- staging/b49e4374-53b8-4a8d-8ee6-fbc034aaea97
This adds the ability to resolve fips and dualstack endpoints with a "fips enabled" or "dualstack enabled" flag.
E.g.
The following public API changes were made:
ServiceMetadata.endpointFor(ServiceEndpointKey)
ServiceMetadata.signingRegion(ServiceEndpointKey)
PartitionMetadata.hostname(PartitionEndpointKey)
PartitionMetadata.dnsSuffix(PartitionEndpointKey)
EndpointTag
class, which currently contains FIPS and DUALSTACK.ServiceMetadata.computeEndpoint
, because it shouldn't have ever been public, and no one should be using it.The following module changes were made:
regions-testing
for verifying region resolution behavior that doesn't currently exist in the endpoints.json