(self, request, role_name)
return credentials_response
Retrieves the AWS security credentials required for signing AWS
        requests from the AWS metadata server.

        Args:
            request (google.auth.transport.Request): A callable used to make
                HTTP requests.
            role_name (str): The AWS role name required by the AWS metadata
                server security_credentials endpoint in order to return the
                credentials.

        Returns:
            Mapping[str, str]: The AWS metadata server security credentials
                response.

        Raises:
            google.auth.exceptions.RefreshError: If an error occurs while
                retrieving the AWS security credentials.
Retrieves the AWS security credentials required for signing AWS
        requests from the AWS metadata server.
Retrieves the AWS security credentials required for signing AWS requests from the AWS metadata server .
def _get_metadata_security_credentials(self, request, role_name):
        """Retrieves the AWS security credentials required for signing AWS
        requests from the AWS metadata server.

        Args:
            request (google.auth.transport.Request): A callable used to make
                HTTP requests.
            role_name (str): The AWS role name required by the AWS metadata
                server security_credentials endpoint in order to return the
                credentials.

        Returns:
            Mapping[str, str]: The AWS metadata server security credentials
                response.

        Raises:
            google.auth.exceptions.RefreshError: If an error occurs while
                retrieving the AWS security credentials.
        """
        headers = {"Content-Type": "application/json"}
        response = request(
            url="{}/{}".format(self._security_credentials_url, role_name),
            method="GET",
            headers=headers,
        )

        # support both string and bytes type response.data
        response_body = (
            response.data.decode("utf-8")
            if hasattr(response.data, "decode")
            else response.data
        )

        if response.status != http_client.OK:
            raise exceptions.RefreshError(
                "Unable to retrieve AWS security credentials", response_body
            )

        credentials_response = json.loads(response_body)

        return credentials_response
def _get_metadata_security_credentials ( self , request , role_name ) : headers = { "Content-Type" : "application/json" } response = request ( url = "{}/{}" . format ( self . _security_credentials_url , role_name ) , method = "GET" , headers = headers , ) # support both string and bytes type response.data response_body = ( response . data . decode ( "utf-8" ) if hasattr ( response . data , "decode" ) else response . data ) if response . status != http_client . OK : raise exceptions . RefreshError ( "Unable to retrieve AWS security credentials" , response_body ) credentials_response = json . loads ( response_body ) return credentials_response