This repository was archived by the owner on Nov 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 406
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
Deprecation warnings when using Application Default Credentials #2151
Copy link
Copy link
Closed
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.
Description
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
A screenshot that you have tested with "Try this API".
I've setup a clean install of PubSub that listens for messages using the exact pattern in the listenForMessages sample. My credentials were downloaded as json for service account. It all works but I see these warnings:
The `fromStream` method is deprecated. Please use the `JWT` constructor with a parsed stream instead. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.
The `fromJSON` method is deprecated. Please use the `JWT` constructor instead. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.
The `fromStream` method is deprecated. Please use the `JWT` constructor with a parsed stream instead. For more details, see https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.
The `fromJSON` method is deprecated. Please use the `JWT` constructor instead. For more details, see https://cl
I'm not configuring the authentication manually at all -- seems like the default behaviour under the hood should be updated to use the JWT constructor.
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenForMessages.js
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
- Run
node listenForMessages.js SUBSCRIPTION_NAME_OR_IDwith application default credentials pointing to json credential file.
A clear and concise description of what the bug is, and what you expected to happen.
The library should not use deprecated methods by default.
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
Seems reasonable.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.