Skip to content
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

Do not take protocol and port from custom Endpoint #1374

Merged
merged 1 commit into from
Aug 27, 2024
Merged

Conversation

trivikr
Copy link
Contributor

@trivikr trivikr commented Aug 27, 2024

Issue #, if available:
Refs: aws/aws-sdk-js-v3#6410 (comment)

Description of changes:
Skips taking protocol and port from custom Endpoint.

The old tests added in aws/aws-sdk-js-v3#4031 were likely incorrect.
Noticed while incorporating the endpoint tests at top-level in aws/aws-sdk-js-v3#6410 (comment)


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr requested review from a team as code owners August 27, 2024 03:55
@trivikr trivikr requested a review from kstich August 27, 2024 03:55
// ignored
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, this is not the removal of the user's ability to set a custom protocol and port.

If a service's ruleset follows the base template, one of the initial conditions is to check for a "built-in" user-supplied Endpoint parameter, or endpoint typically in TypeScript SDKs generated from Smithy.

It looks like this:

"conditions": [
  {
    "fn": "isSet",
    "argv": [
      {
        "ref": "Endpoint"
      }
    ]
  },
  {
    "fn": "parseURL",
    "argv": [
      {
        "ref": "Endpoint"
      }
    ],
    "assign": "url"
  }
],

And will resolve an endpoint template such as

"endpoint": {
  "url": "{url#scheme}://{url#authority}{url#path}",
  "...": "..."
}

This preserves the user's input scheme/protocol and port as part of authority.


In rare cases where the service ruleset ignores the user input endpoint's scheme/port, the fix would be either to patch the ruleset or override the endpointProvider configuration field.

@trivikr trivikr merged commit 77db9e7 into main Aug 27, 2024
11 checks passed
@trivikr trivikr deleted the fix-util-endpoints branch August 27, 2024 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants