Skip to content

Commit

Permalink
add user agent internal metadata (#4967)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahvita authored Aug 29, 2023
1 parent 63b601b commit 2bb8fb1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
### SDK Features
* `aws/corehandlers`: Add internal flag in user agent functionality
* Added handler which will add aws internal metadata to the user agent string

### SDK Enhancements

Expand Down
4 changes: 4 additions & 0 deletions aws/corehandlers/awsinternal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// DO NOT EDIT
package corehandlers

const isAwsInternal = ""
10 changes: 10 additions & 0 deletions aws/corehandlers/user_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@ var AddHostExecEnvUserAgentHander = request.NamedHandler{
request.AddToUserAgent(r, execEnvUAKey+"/"+v)
},
}

var AddAwsInternal = request.NamedHandler{
Name: "core.AddAwsInternal",
Fn: func(r *request.Request) {
if len(isAwsInternal) == 0 {
return
}
request.AddToUserAgent(r, isAwsInternal)
},
}
1 change: 1 addition & 0 deletions aws/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func Handlers() request.Handlers {
handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
handlers.Validate.AfterEachFn = request.HandlerListStopOnError
handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler)
handlers.Build.PushBackNamed(corehandlers.AddAwsInternal)
handlers.Build.PushBackNamed(corehandlers.AddHostExecEnvUserAgentHander)
handlers.Build.AfterEachFn = request.HandlerListStopOnError
handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)
Expand Down

0 comments on commit 2bb8fb1

Please sign in to comment.