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

feat(codegen): add user agent for non AWS clients #2415

Merged
merged 1 commit into from
Jun 3, 2021

Conversation

gosar
Copy link
Contributor

@gosar gosar commented May 21, 2021

Description

I had disabled user agent plugin for non AWS clients earlier as it depended on serviceId which is not present for non AWS services. This enables it back. serviceId is optional, so omitting it for non AWS services.

Testing

Added unit tests.

Generated client for non AWS service in demo package and looked at headers sent to the service by this client and compared with AWS service's client.

Demo service client:

user-agent: aws-sdk-js/1.0.0-rc.1 os/darwin/19.6.0 lang/js md/nodejs/15.10.0
x-amz-user-agent: aws-sdk-js/1.0.0-rc.1

where 1.0.0-rc.1 is the version of generated client in its package.json.

AWS service client (used AccessAnalyzerClient):

user-agent: aws-sdk-js/3.16.0 os/darwin/19.6.0 lang/js md/nodejs/15.10.0 api/accessanalyzer/3.16.0
x-amz-user-agent: aws-sdk-js/3.16.0

I assume for browser client, the user-agent header would not be there but the x-amz-user-agent would be.


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

@codecov-commenter
Copy link

codecov-commenter commented May 21, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@10db5ac). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2415   +/-   ##
=======================================
  Coverage        ?   59.08%           
=======================================
  Files           ?      490           
  Lines           ?    26204           
  Branches        ?     6224           
=======================================
  Hits            ?    15482           
  Misses          ?    10722           
  Partials        ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10db5ac...81f2805. Read the comment docs.

@AllanZhengYP AllanZhengYP merged commit 6d1a555 into aws:main Jun 3, 2021
@gosar gosar deleted the useragent branch June 3, 2021 21:39
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants