def _get_signed_query_params(credentials, expiration, string_to_sign):
 if (not isinstance(credentials, google.auth.credentials.Signing)):
  auth_uri = 'http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html#setting-up-a-service-account'
  raise AttributeError(('you need a private key to sign credentials.the credentials you are currently using %s just contains a token. see %s for more details.' % (type(credentials), auth_uri)))
 signature_bytes = credentials.sign_bytes(string_to_sign)
 signature = base64.b64encode(signature_bytes)
 service_account_name = credentials.signer_email
 return {'GoogleAccessId': service_account_name, 'Expires': str(expiration), 'Signature': signature}

def _get_signed_query_params ( credentials , expiration , string_to_sign ) : if ( not isinstance ( credentials , google . auth . credentials . Signing ) ) : auth_uri = 'http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html#setting-up-a-service-account' raise AttributeError ( ( 'you need a private key to sign credentials.the credentials you are currently using %s just contains a token. see %s for more details.' % ( type ( credentials ) , auth_uri ) ) ) signature_bytes = credentials . sign_bytes ( string_to_sign ) signature = base64 . b64encode ( signature_bytes ) service_account_name = credentials . signer_email return { 'GoogleAccessId' : service_account_name , 'Expires' : str ( expiration ) , 'Signature' : signature }
gets query parameters for creating a signed url .