Skip to content

Commit

Permalink
consolidate test rulesets into single file
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlm committed Nov 16, 2023
1 parent 3e75ac1 commit 6961570
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 86 deletions.
83 changes: 0 additions & 83 deletions tests/unit/data/endpoints/valid-rules/aws-account-id.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"builtIn": "AWS::Region",
"documentation": "The region to dispatch this request, eg. `us-east-1`."
},
"AccountId": {
"type": "string",
"builtIn": "AWS::Auth::AccountId",
"documentation": "The account ID to dispatch this request, eg. `123456789012`."
},
"CredentialScope": {
"type": "string",
"builtIn": "AWS::Auth::CredentialScope",
Expand All @@ -13,7 +18,7 @@
},
"rules": [
{
"documentation": "Template the credential scope into the URI when it is set",
"documentation": "Template the credential scope into the URI when it is set",
"conditions": [
{
"fn": "isSet",
Expand Down Expand Up @@ -58,7 +63,41 @@
"type": "endpoint"
},
{
"documentation": "Fallback when credential scope isn't set",
"documentation": "Template the account ID into the URI when account ID is set",
"conditions": [
{
"fn": "isSet",
"argv": [
{
"ref": "AccountId"
}
]
},
{
"fn": "isSet",
"argv": [
{
"ref": "Region"
}
]
}
],
"endpoint": {
"url": "https://{AccountId}.amazonaws.com",
"properties": {
"authSchemes": [
{
"name": "sigv4",
"signingName": "serviceName",
"signingRegion": "{Region}"
}
]
}
},
"type": "endpoint"
},
{
"documentation": "Fallback when account ID and credential scope aren't set",
"conditions": [
{
"fn": "isSet",
Expand All @@ -83,7 +122,6 @@
},
"type": "endpoint"
},

{
"documentation": "fallback when region is unset",
"conditions": [],
Expand Down

0 comments on commit 6961570

Please sign in to comment.