-
Notifications
You must be signed in to change notification settings - Fork 7
User Agent #310
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
base: decaf
Are you sure you want to change the base?
User Agent #310
Conversation
module Client | ||
module Plugins | ||
class UserAgent < Plugin | ||
option(:user_agent_suffix) |
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.
In v3 this was secret. I think we should fully document this as a public option in the generic client. In v4 we can keep it secret or remove it. Or, we can use app id concept instead. Let's discuss
gems/smithy-client/spec/smithy-client/plugins/user_agent_spec.rb
Outdated
Show resolved
Hide resolved
gems/smithy-client/spec/smithy-client/plugins/user_agent_spec.rb
Outdated
Show resolved
Hide resolved
gems/smithy-client/spec/smithy-client/plugins/user_agent_spec.rb
Outdated
Show resolved
Hide resolved
|
||
require_relative '../../spec_helper' | ||
|
||
require 'smithy-client/plugins/user_agent' |
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.
Require is not necessary anymore
option( | ||
:user_agent_suffix, | ||
doc_type: String, | ||
docstring: 'The suffix appended to the user agent string.' |
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.
String -> header
def with_metric(&block) | ||
Thread.current[:aws_sdk_core_user_agent_metric] ||= [] | ||
Thread.current[:aws_sdk_core_user_agent_metric] << 'C' | ||
block.call | ||
ensure | ||
Thread.current[:aws_sdk_core_user_agent_metric].pop | ||
end |
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.
Should we put a TODO to revisit this approach? Just want to make sure that this does not go amiss
Add user agent plugin and test.