googleapis / googleapis/google-cloud-node

Remove `access_token` from logs

Aperta
#7,690 3 commenti 0 reazioni 1 assegnatario Rivendicata da @feywind Vedi su GitHub
library: google-cloud-node-core size: s type: feature request
Lingua principale
TypeScript
Stelle
3.2k
Fork
712
Merge medio
2g 9h
PR unite (30g)
104

Descrizione

Currently, if you enable `GOOGLE_SDK_NODE_LOGGING` to get extra logging, both [the instance request](https://github.com/googleapis/gcp-metadata/blob/d8a868e5f487dcc3dd4bfd2d59d8c331fcf2895b/src/index.ts#L172) and [the instance metadata](https://github.com/googleapis/gcp-metadata/blob/d8a868e5f487dcc3dd4bfd2d59d8c331fcf2895b/src/index.ts#L175) are logged.

Unfortunately, the latter includes an access_token in it, which is rather dangerous to log.

I can imagine two solutions:
* Remove the access_token from the log, and maybe introduce another env var like `INCLUDE_ACCESS_TOKEN_IN_LOG` if someone really wants it
* Split the logger into two subloggers (request/response?) which would allow the user to configure which one they want with `GOOGLE_SDK_NODE_LOGGING` https://github.com/googleapis/gax-nodejs/tree/main/logging-utils#logging

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.