MCPcopy Create free account
hub / github.com/aws/aws-cli / _build_app_id

Method _build_app_id

awscli/botocore/useragent.py:581–598  ·  view source on GitHub ↗

Build app component of the User-Agent header string. Returns a single component with prefix "app" and value sourced from the ``user_agent_appid`` field in :py:class:`botocore.config.Config` or the ``sdk_ua_app_id`` setting in the shared configuration file, or the

(self)

Source from the content-addressed store, hash-verified

579 return cfg_md
580
581 def _build_app_id(self):
582 """
583 Build app component of the User-Agent header string.
584
585 Returns a single component with prefix "app" and value sourced from the
586 ``user_agent_appid`` field in :py:class:`botocore.config.Config` or
587 the ``sdk_ua_app_id`` setting in the shared configuration file, or the
588 ``AWS_SDK_UA_APP_ID`` environment variable. These are the recommended
589 ways for apps built with Botocore to insert their identifer into the
590 User-Agent header.
591 """
592 if self._client_config and self._client_config.user_agent_appid:
593 appid = sanitize_user_agent_string_component(
594 raw_str=self._client_config.user_agent_appid, allow_hash=True
595 )
596 return [RawStringUserAgentComponent(f'app/{appid}')]
597 else:
598 return []
599
600 def _build_extra(self):
601 """User agent string components based on legacy "extra" settings.

Callers 1

to_stringMethod · 0.95

Tested by

no test coverage detected