Class: Aws::BedrockRuntime::Plugins::BearerAuthorization Private

Inherits:
Seahorse::Client::Plugin
  • Object
show all
Defined in:
lib/aws-sdk-bedrockruntime/plugins/bearer_authorization.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: Handler

Instance Method Summary collapse

Instance Method Details

#after_initialize(client) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
10
11
12
13
# File 'lib/aws-sdk-bedrockruntime/plugins/bearer_authorization.rb', line 7

def after_initialize(client)
  return unless (token = ENV['AWS_BEARER_TOKEN_BEDROCK'])

  token_provider = Aws::StaticTokenProvider.new(token)
  token_provider.metrics = ['BEARER_SERVICE_ENV_VARS']
  client.config.token_provider ||= token_provider
end