Skip to content

Add support for endpoint_url, user_agent_extra, and sdk_ua_app_id.#653

Open
ubaskota wants to merge 2 commits intosmithy-lang:config_resolution_mainfrom
ubaskota:new_config_vars
Open

Add support for endpoint_url, user_agent_extra, and sdk_ua_app_id.#653
ubaskota wants to merge 2 commits intosmithy-lang:config_resolution_mainfrom
ubaskota:new_config_vars

Conversation

@ubaskota
Copy link

Issue #, if available:

Description of changes:
Add codegen support for three new config properties: endpoint_url, user_agent_extra, and sdk_ua_app_id. For AWS SDKs, these are generated as descriptor-based properties with config resolver and default values (empty string for the user agent properties, None for endpoint_url). For generic SDKs, they are generated as plain properties without descriptors or resolution logic, consistent with how retry_strategy is handled.

Testing

  • Added two unit tests to verify default value behavior: empty string for user_agent_extra/sdk_ua_app_id and None for endpoint_url.
  • All existing tests pass.
  • Manually tested the generated config from the client side and verified that all tests pass.

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

@ubaskota ubaskota requested a review from a team as a code owner March 11, 2026 02:18
Copy link
Contributor

@jonathan343 jonathan343 left a comment

Choose a reason for hiding this comment

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

Had a few comments. I also noticed there are no validators for any of these options. I know at least the user agent app ID will need it:

Valid values: String with maximum length of 50. Letters, numbers and the following special characters are allowed: !,#,$,%,&,',*,+,-,.,^,_,`,|,~.

.build();

public static final ConfigProperty USER_AGENT_EXTRA = ConfigProperty.builder()
.name("user_agent_extra")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this config option added? This config option isn't standardized across all SDKs (source). By adding it here we're now reading AWS_USER_AGENT_EXTRA from the environment which we shouldn't be doing.

.documentation("A unique and opaque application ID that is appended to the User-Agent header.")
.nullable(false)
.useDescriptor(true)
.defaultValue("''")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any limitation with keeping the default to None? This feels weird to me.

Copy link
Author

Choose a reason for hiding this comment

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

I thought users would be able to add it without first checking if the value is None if the default is an empty string. But I see why returning None would be a better choice. I will update it.

.defaultValue("''")
.build();

public static final ConfigProperty ENDPOINT_URL = ConfigProperty.builder()
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't tested but it looks like we now have endpoint_uri and endpoint_url. Since there are not other changes, if someone sets export AWS_ENDPOINT_URL="...", then config.endpoint_url will resolve correctly, but it won't actually be used by the SDK since we're using endpoint_uri still.

This one is a bit more complicated since smithy python stuff uses endpoint_uri. Can we leave the existing endpoint_uri but map to endpoint_url config options?

.build())
.documentation("The retry strategy or options for configuring retry behavior. Can be either a configured RetryStrategy or RetryStrategyOptions to create one.")
.build(),
ConfigProperty.builder()
Copy link
Contributor

Choose a reason for hiding this comment

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

This will add all of these to generic clients; can we keep them as AWS specific for now?

.type(Symbol.builder().name("str").build())
.documentation("A unique and opaque application ID that is appended to the User-Agent header.")
.build(),
ConfigProperty.builder()
Copy link
Contributor

Choose a reason for hiding this comment

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

endpoint_url and endpoint_uri are effectively the same. We should address this in the long run since the SDKs have standardized on endpoint_url, but we currently only accept endpoint_uri.

For now, let's just remove the duplicate endpoint_url.

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