googleapis / googleapis/google-cloud-python

async AuthorizedSession refresh should support async credential refresh method

Abierto
#15,211 4 comentarios 2 reacciones 1 asignado Reclamado por @arithmetic1728 Ver en GitHub
priority: p3 type: bug
Lenguaje dominante
Python
Estrellas
5.4k
Forks
1.8k
Merge medio
3 d 4 h
PR fusionados (30 d)
122

Descripción

Recently I migrated from my custom async implementation to the beta implementation however I noticed two issues:

1) _CombinedResponse is missing the reason property and occasionally errors out, my fix:
```python
class _CombinedResponse(_GoogleCombinedResponse):
@property
def reason(self):
return self._response.reason
```
2) the credentials refresh does not support an async call (which should be the default if you're using the credentials_async class

fix is making this call async: https://github.com/googleapis/google-auth-library-python/blob/main/google/auth/transport/_aiohttp_requests.py#L371

if sync needs to be supported it should do a check if the method is awaitable/a coroutine or not.

#### Environment details

- OS: OSX
- Python version: 3.8
- pip version:
- `google-auth` version: 2.2.1

#### Steps to reproduce

1. auth error during googleapiclient call

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.