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

[v2] Add configuration to disable host prefix injection #9268

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

kdaily
Copy link
Member

@kdaily kdaily commented Jan 31, 2025

Issue #, if available:

Description of changes:

This change deviates from the upstream botocore to add the ability to disable jost prefix injection. It changes the default for inject_host_prefix in the Config object to be None (from True) so that the value can be determined using the configuration precedence. The fallback if the value remains True if it is set to None to preserve the CLI default behavior.

Testing

Tested with the following commands which uses an operation-specific host prefix:

  1. Default case (no disable host prefix configuration set) results in the host prefix being added:
$ aws omics create-sequence-store --name "test-sequence-store1" --description "Test store" --endpoint-url https://localhost:1234/ --tags "Environment=Test"

Could not connect to the endpoint URL: "https://control-storage-localhost:1234/sequencestore"
  1. Set config environment variable to False, which is the same as the default behavior:
AWS_DISABLE_HOST_PREFIX_INJECTION=False aws omics create-sequence-store --name "test-sequence-store1" --description "Test store" --endpoint-url https://localhost:1234/ --tags "Environment=Test"

Could not connect to the endpoint URL: "https://control-storage-localhost:1234/sequencestore"
  1. Set config environment variable to True, which prevents the host prefix from being prepended to the endpoint URL:
$ AWS_DISABLE_HOST_PREFIX_INJECTION=True aws omics create-sequence-store --name "test-sequence-store1" --description "Test store" --endpoint-url https://localhost:1234/ --tags "Environment=Test"

Could not connect to the endpoint URL: "https://localhost:1234/sequencestore"

I also confirmed the behavior applies when using the configuration file setting disable_host_prefix_injection, and even when not using a custom endpoint URL.

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

This change deviates from the upstream `botocore` to add the ability
to disable jost prefix injection. It changes the default for
`inject_host_prefix` in the Config object to be `None` (from `True`) so
that the value can be determined using the configuration precedence. The
fallback if the value remains `True` if it is set to `None` to preserve
the CLI default behavior.
@kdaily kdaily requested review from hssyoo and a team January 31, 2025 22:07
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.

1 participant