-
Notifications
You must be signed in to change notification settings - Fork 619
Add user agent #179
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 user agent #179
Conversation
@@ -0,0 +1 @@ | |||
# @aws-sdk/util-user-agent-node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a more flushed out Readme
@@ -0,0 +1 @@ | |||
# @aws-sdk/util-user-agent-browser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a more flushed out Readme
"@aws-sdk/config-resolver": "^0.1.0-preview.1", | ||
"@aws-sdk/core-handler": "^0.1.0-preview.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert this? Going from Alpha to some unordered list does not seem to add value and makes it hard to see what changed
@@ -23,32 +23,34 @@ | |||
}, | |||
"license": "Apache-2.0", | |||
"dependencies": { | |||
"tslib": "^1.8.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, what is the value in the shuffle?
packages/client-xray-node/LICENSE
Outdated
@@ -186,7 +186,7 @@ | |||
same "printed page" as the copyright notice for easier | |||
identification within third-party archives. | |||
|
|||
Copyright {yyyy} {name of copyright owner} | |||
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2019
@@ -24,7 +24,7 @@ export class ClientGenerator { | |||
constructor( | |||
model: TreeModel, | |||
target: RuntimeTarget, | |||
customizations: Array<CustomizationDefinition> = [] | |||
customizations: Array<CustomizationDefinition> = [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove ,
Either we are moving to aways trailing or we should stick to never...
@@ -10,7 +10,7 @@ export class Configuration { | |||
constructor( | |||
private readonly prefix: string, | |||
private readonly target: RuntimeTarget, | |||
private readonly config: ConfigurationDefinition | |||
private readonly config: ConfigurationDefinition, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove ,
Either we are moving to aways trailing or we should stick to never...
@@ -62,6 +62,7 @@ export class Client { | |||
${configurationImports.toString()} | |||
import {InputTypesUnion} from './types/InputTypesUnion'; | |||
import {OutputTypesUnion} from './types/OutputTypesUnion'; | |||
import {clientVersion, ServiceMetadata} from './model/ServiceMetadata'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we importing something we don't use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will be used in the client for adding user-agent header. If you see the generated service clients you will see these imports are always referred.
@@ -63,6 +64,7 @@ export function customizationsFromModel( | |||
], | |||
commands: {}, | |||
}, | |||
signatureCustomizations(model, target) | |||
signatureCustomizations(model, target), | |||
userAgentCustomization(target), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing ,
step: 'build', | ||
priority: 0, | ||
imports, | ||
expression: `${packageNameToVariable('@aws-sdk/middleware-header-default')}.headerDefault({'${runtime === 'node' ? 'User-Agent' : 'X-Amz-User-Agent'}': ${packageNameToVariable(defaultValuePackageName)}.defaultUserAgent(ServiceMetadata.serviceId || ServiceMetadata.endpointPrefix, clientVersion)})`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems overly complicated and long for a single line.
1e610df
to
916a1e3
Compare
The additional changes on this look good! |
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. |
I added 2 packages: util-user-agent-node and util-user-agent-browser, which will be imported accordingly when generating node and browser service clients. The 2 packages will provide default user-agent value by a middleware in the service client.
The last commit is regenerating service clients. When reviewing you can ignore the changes from the laster commit. But the genrated service clients give you the idea of how user-agent is preserved.