Skip to content

Commit

Permalink
Update to latest Smithy and remove workaround (#514)
Browse files Browse the repository at this point in the history
Since newer versions of Smithy reject the invalid @smithy.rules#endpointRuleSet trait on the SQS model, also removed that (attempted to update the SQS model but it having V2 enum shapes in it is still a blocker)
  • Loading branch information
robin-aws authored Aug 15, 2024
1 parent 89cbe7f commit 51c93d9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 688 deletions.
340 changes: 0 additions & 340 deletions TestModels/aws-sdks/sqs-via-cli/Model/sqs.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,346 +180,6 @@
"smithy.api#xmlNamespace": {
"uri": "http://queue.amazonaws.com/doc/2012-11-05/"
},
"smithy.rules#endpointRuleSet": {
"version": "1.0",
"parameters": {
"Region": {
"builtIn": "AWS::Region",
"required": false,
"documentation": "The AWS region used to dispatch the request.",
"type": "String"
},
"UseDualStack": {
"builtIn": "AWS::UseDualStack",
"required": true,
"default": false,
"documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
"type": "Boolean"
},
"UseFIPS": {
"builtIn": "AWS::UseFIPS",
"required": true,
"default": false,
"documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
"type": "Boolean"
},
"Endpoint": {
"builtIn": "SDK::Endpoint",
"required": false,
"documentation": "Override the endpoint used to send this request",
"type": "String"
}
},
"rules": [
{
"conditions": [
{
"fn": "aws.partition",
"argv": [
{
"ref": "Region"
}
],
"assign": "PartitionResult"
}
],
"type": "tree",
"rules": [
{
"conditions": [
{
"fn": "isSet",
"argv": [
{
"ref": "Endpoint"
}
]
},
{
"fn": "parseURL",
"argv": [
{
"ref": "Endpoint"
}
],
"assign": "url"
}
],
"type": "tree",
"rules": [
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
{
"ref": "UseFIPS"
},
true
]
}
],
"error": "Invalid Configuration: FIPS and custom endpoint are not supported",
"type": "error"
},
{
"conditions": [],
"type": "tree",
"rules": [
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
{
"ref": "UseDualStack"
},
true
]
}
],
"error": "Invalid Configuration: Dualstack and custom endpoint are not supported",
"type": "error"
},
{
"conditions": [],
"endpoint": {
"url": {
"ref": "Endpoint"
},
"properties": {},
"headers": {}
},
"type": "endpoint"
}
]
}
]
},
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
{
"ref": "UseFIPS"
},
true
]
},
{
"fn": "booleanEquals",
"argv": [
{
"ref": "UseDualStack"
},
true
]
}
],
"type": "tree",
"rules": [
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
true,
{
"fn": "getAttr",
"argv": [
{
"ref": "PartitionResult"
},
"supportsFIPS"
]
}
]
},
{
"fn": "booleanEquals",
"argv": [
true,
{
"fn": "getAttr",
"argv": [
{
"ref": "PartitionResult"
},
"supportsDualStack"
]
}
]
}
],
"type": "tree",
"rules": [
{
"conditions": [],
"endpoint": {
"url": "https://sqs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
"properties": {},
"headers": {}
},
"type": "endpoint"
}
]
},
{
"conditions": [],
"error": "FIPS and DualStack are enabled, but this partition does not support one or both",
"type": "error"
}
]
},
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
{
"ref": "UseFIPS"
},
true
]
}
],
"type": "tree",
"rules": [
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
true,
{
"fn": "getAttr",
"argv": [
{
"ref": "PartitionResult"
},
"supportsFIPS"
]
}
]
}
],
"type": "tree",
"rules": [
{
"conditions": [],
"type": "tree",
"rules": [
{
"conditions": [
{
"fn": "stringEquals",
"argv": [
"aws-us-gov",
{
"fn": "getAttr",
"argv": [
{
"ref": "PartitionResult"
},
"name"
]
}
]
}
],
"endpoint": {
"url": "https://sqs.{Region}.{PartitionResult#dnsSuffix}",
"properties": {},
"headers": {}
},
"type": "endpoint"
},
{
"conditions": [],
"endpoint": {
"url": "https://sqs-fips.{Region}.{PartitionResult#dnsSuffix}",
"properties": {},
"headers": {}
},
"type": "endpoint"
}
]
}
]
},
{
"conditions": [],
"error": "FIPS is enabled but this partition does not support FIPS",
"type": "error"
}
]
},
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
{
"ref": "UseDualStack"
},
true
]
}
],
"type": "tree",
"rules": [
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
true,
{
"fn": "getAttr",
"argv": [
{
"ref": "PartitionResult"
},
"supportsDualStack"
]
}
]
}
],
"type": "tree",
"rules": [
{
"conditions": [],
"endpoint": {
"url": "https://sqs.{Region}.{PartitionResult#dualStackDnsSuffix}",
"properties": {},
"headers": {}
},
"type": "endpoint"
}
]
},
{
"conditions": [],
"error": "DualStack is enabled but this partition does not support DualStack",
"type": "error"
}
]
},
{
"conditions": [],
"endpoint": {
"url": "https://sqs.{Region}.{PartitionResult#dnsSuffix}",
"properties": {},
"headers": {}
},
"type": "endpoint"
}
]
}
]
},
"smithy.rules#endpointTests": {
"testCases": [
{
Expand Down
6 changes: 6 additions & 0 deletions TestModels/aws-sdks/sqs-via-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ but it generates code using the older CLI instead of the newer Smithy build plug
This project will eventually be removed entirely as the CLI is deprecated.
For more details, please see `TestModels/aws-sdks/sqs/README.md`.

NOTE: The `sqs.json` in this project was copied almost unmodified from https://github.com/aws/aws-sdk-js-v3/blob/main/codegen/sdk-codegen/aws-models/sqs.json on March 6, 2023.
The only edit is to remove the @smithy.rules#endpointRuleSet from the service,
because it happens to be invalid and newer versions of Smithy catch this and crash.
We can't yet update the SQS model because newer versions use Smithy 2.0 enum shapes,
which we don't yet support for .NET.

## Build

### .NET
Expand Down
Loading

0 comments on commit 51c93d9

Please sign in to comment.