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

Add missing features to user agent formatting #865

Merged
merged 18 commits into from
Nov 18, 2021
Merged

Conversation

jdisanti
Copy link
Collaborator

@jdisanti jdisanti commented Nov 16, 2021

Description

This PR adds feature, config, framework, and app name formatting to user agents, and also adds the ability to set the app name from service config, shared config, profile config, and environment variables.

Testing

  • Added integration test
  • Ran an example to manually verify it works end to end

Checklist

  • I have updated CHANGELOG.md
  • I have updated aws/SDK_CHANGELOG.md if applicable

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

@jdisanti jdisanti requested a review from a team as a code owner November 16, 2021 17:50
@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-jdisanti-user-agent

@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-jdisanti-user-agent

1 similar comment
@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-jdisanti-user-agent

@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-jdisanti-user-agent

Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

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

Formatting and app name stuff looks good. We should probably switch to a builder for actually constructing the user agent, I'm sure it will have more fields in the future.

We'll also need some way of enabling the current use case for QLDB of setting fields directly, but we could use app name if we formatted it specially in User-Agent (without the lib/ for now.

aws/rust-runtime/aws-http/src/user_agent.rs Outdated Show resolved Hide resolved
@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-jdisanti-user-agent

1 similar comment
@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-jdisanti-user-agent

Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

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

LGTM! thanks for cleaning up the docs

aws/rust-runtime/aws-config/src/default_provider.rs Outdated Show resolved Hide resolved
aws/rust-runtime/aws-config/src/default_provider.rs Outdated Show resolved Hide resolved
aws/rust-runtime/aws-config/src/profile/app_name.rs Outdated Show resolved Hide resolved
/// **Loads "my-app" as the app name**
/// ```ini
/// [default]
/// sdk-ua-app-id = my-app
Copy link
Collaborator

Choose a reason for hiding this comment

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

AFAICT, this isn't implemented in other SDKs yet. I'm not aware of any other kebab case properties, so we may want to try to get this changed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It looks like this has been implemented for the Javascript V3 SDK: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_util_user_agent_node.html

aws/rust-runtime/aws-config/src/profile/app_name.rs Outdated Show resolved Hide resolved
aws/rust-runtime/aws-http/src/user_agent.rs Outdated Show resolved Hide resolved
aws/rust-runtime/aws-types/src/app_name.rs Outdated Show resolved Hide resolved
aws/rust-runtime/aws-types/src/app_name.rs Show resolved Hide resolved
aws/sdk/integration-tests/s3/tests/user-agent-app-name.rs Outdated Show resolved Hide resolved
@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-jdisanti-user-agent

Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

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

LGTM!

@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-jdisanti-user-agent

@jdisanti jdisanti merged commit 735fee0 into main Nov 18, 2021
@jdisanti jdisanti deleted the jdisanti-user-agent branch November 18, 2021 22:00
@jdisanti jdisanti mentioned this pull request Nov 19, 2021
3 tasks
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.

None yet

2 participants