googleapis / googleapis/google-api-nodejs-client
Unexpected Unauthorized response for google drive client.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 12.2k
- Forks
- 2k
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 24
Beschreibung
### Environment details
---
- Node.js version: 20.5.0
- npm version: 9.8.0
- `googleapis` version: 126.0.0
### Unexpected behaviour description
---
I'm getting a **401 response** when calling `service.files.create()` for a multipart upload using expired credentials. Same code works for other methods as `drive.files.list()`, also executing `drive.files.list()` before `service.files.create()` makes the second call work as expected (See attached code snippet for details).

### Steps to reproduce
---
1. Setup expired credentials for the example code provided.
2. Run the app without params to see get the 401 response. `node .\index.js`
3. Run the app with --all arguments to get the 200 expected response. `node .\index.js --all`
### Question
---
Shouldn't drive client have the same behavior for all methods?
Setting up `expiry_date` property fix the issue. I'm raising this question because I will expect the same behavior for the other methods, but they work just fine without the mentioned property including `service.files.create()` when used just to create a folder.
Thanks!
Beitragsleitfaden
Rechercherichtung
Beginnen Sie mit der bereitgestellten index.js-Reproduktion und vergleichen Sie service.files.create() mit drive.files.list(), jeweils mit und ohne die Argumente --all, unter Verwendung der angegebenen abgelaufenen Zugangsdaten. Verfolgen Sie, wie die Authentifizierung für Multipart-Uploads im Vergleich zu den anderen Aufrufen gehandhabt wird; abgeschlossen ist die Aufgabe, wenn das Verhalten erklärt ist und der Client diese gleichwertigen Zugangsdatenzustände konsistent behandelt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- nodejs, typescript
- Bereich
- api, authentication
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100