Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose static methods to get the default project ID and credentials #1241

Closed
wants to merge 1 commit into from

Conversation

mziccard
Copy link
Contributor

This fixes #1207

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 12, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.009%) to 85.053% when pulling 325d4cd on mziccard:expose-default into 4d5a86c on GoogleCloudPlatform:master.

* be found. This method returns the first available credentials among the following sources:
* <ol>
* <li>App Engine credentials
* <li>JSON credentials pointed to by the {@code GOOGLE_APPLICATION_CREDENTIALS} environment

This comment was marked as spam.

* Returns the default project ID, or {@code null} if no default project ID could be found. This
* method returns the first available project ID among the following sources:
* <ol>
* <li>App Engine project ID

This comment was marked as spam.

@mziccard mziccard added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 26, 2016
@mziccard
Copy link
Contributor Author

@lukecwik thanks for the feedback. I am putting this on hold as we are right now working on a better integration with https://github.com/google/google-auth-library-java/ that will eventually lead to us dropping our AuthCredentials classes.

@lukecwik
Copy link

Does the same apply to the other google cloud languages?
I'm mainly interested in python as well but consistency of features across languages would be convenient.

@mziccard
Copy link
Contributor Author

Not 100% sure what python guys are doing. Also, the availability of libraries and tools across different platforms/languages is far from uniform, this makes the comparison hard if at all useful.

I believe that google-cloud-python is using credentials classes (GoogleCredentials) from https://github.com/google/oauth2client and they possibly provide some more utility functions (see https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/core/google/cloud/credentials.py).

@lukecwik
Copy link

lukecwik commented Oct 7, 2016

Any updates?

@mziccard
Copy link
Contributor Author

mziccard commented Oct 7, 2016

@lukecwik We are working on getting the features we need in google-auth-library-java, see this PR for instance. ETA is end of the month.

@lukecwik
Copy link

lukecwik commented Oct 7, 2016

Thanks for the update.

On Fri, Oct 7, 2016 at 11:12 AM, Marco Ziccardi [email protected]
wrote:

@lukecwik https://github.com/lukecwik We are working on getting the
features we need in google-auth-library-java, see this PR
googleapis/google-auth-library-java#69 for
instance. ETA is end of the month.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1241 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJnK7AjOBQnwXFsKh9sQtPJUNe6W5eu8ks5qxotxgaJpZM4J6qNv
.

@lukecwik
Copy link

lukecwik commented Nov 7, 2016

Update?

@mziccard
Copy link
Contributor Author

mziccard commented Nov 7, 2016

PR to switch to google-auth-library-java is at #1375, review is pending. You can start using GoogleCredentials.getApplicationDefault() by depending on google-auth-library-java 0.6.0. Once that is done I will then expose a static method for project discovery.

@lukecwik
Copy link

lukecwik commented Nov 7, 2016

Swapped to use google-auth-library-java 0.6.0 GoogleCredentials.getApplicationDefault in apache/beam#1294

@mziccard
Copy link
Contributor Author

mziccard commented Nov 9, 2016

This was replaced by #1380

@mziccard mziccard closed this Nov 9, 2016
github-actions bot pushed a commit that referenced this pull request Jun 23, 2022
…cies to v2.13.0 (#1241)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.12.0` -> `2.13.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.13.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.13.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.13.0/compatibility-slim/2.12.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.13.0/confidence-slim/2.12.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-shared-dependencies</summary>

### [`v2.13.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#&#8203;2130-httpsgithubcomgoogleapisjava-shared-dependenciescomparev2120v2130-2022-06-22)

[Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v2.12.0...v2.13.0)

##### Dependencies

-   update dependency com.google.api-client:google-api-client-bom to v1.35.0 ([#&#8203;709](https://togithub.com/googleapis/java-shared-dependencies/issues/709)) ([239f8c3](https://togithub.com/googleapis/java-shared-dependencies/commit/239f8c33a11e233e6af79aee8c7e68cd156a0554))
-   update dependency com.google.api-client:google-api-client-bom to v1.35.1 ([#&#8203;713](https://togithub.com/googleapis/java-shared-dependencies/issues/713)) ([6559b45](https://togithub.com/googleapis/java-shared-dependencies/commit/6559b45b027dba783a9525d35e32183d78773cbe))
-   update dependency com.google.api:api-common to v2.2.1 ([#&#8203;710](https://togithub.com/googleapis/java-shared-dependencies/issues/710)) ([650d4c5](https://togithub.com/googleapis/java-shared-dependencies/commit/650d4c5f8c3cfce711257d47280ad773cd2e2414))
-   update dependency com.google.errorprone:error_prone_annotations to v2.14.0 ([#&#8203;701](https://togithub.com/googleapis/java-shared-dependencies/issues/701)) ([d24730f](https://togithub.com/googleapis/java-shared-dependencies/commit/d24730f78669f80b109e590b903446e5552e3e36))
-   update dependency com.google.http-client:google-http-client-bom to v1.42.0 ([#&#8203;711](https://togithub.com/googleapis/java-shared-dependencies/issues/711)) ([5168a18](https://togithub.com/googleapis/java-shared-dependencies/commit/5168a181722128d434a0d0d2ab5cc485686bbc78))
-   update dependency com.google.oauth-client:google-oauth-client-bom to v1.34.0 ([#&#8203;708](https://togithub.com/googleapis/java-shared-dependencies/issues/708)) ([620336e](https://togithub.com/googleapis/java-shared-dependencies/commit/620336e6733e2017116e5e8a7b403b183a728bc1))
-   update dependency com.google.oauth-client:google-oauth-client-bom to v1.34.1 ([#&#8203;712](https://togithub.com/googleapis/java-shared-dependencies/issues/712)) ([a2c18a5](https://togithub.com/googleapis/java-shared-dependencies/commit/a2c18a5bc4152cc9034cec691a29f54a35c38a51))
-   update dependency com.google.protobuf:protobuf-bom to v3.21.0 ([#&#8203;703](https://togithub.com/googleapis/java-shared-dependencies/issues/703)) ([5f9fe12](https://togithub.com/googleapis/java-shared-dependencies/commit/5f9fe1200b4bdf4c54bf947c21bd3ed02f26f990))
-   update dependency com.google.protobuf:protobuf-bom to v3.21.1 ([#&#8203;705](https://togithub.com/googleapis/java-shared-dependencies/issues/705)) ([c68edfb](https://togithub.com/googleapis/java-shared-dependencies/commit/c68edfbe7e1993e1112640b867b29aa2fbcf7579))
-   update dependency io.grpc:grpc-bom to v1.47.0 ([#&#8203;707](https://togithub.com/googleapis/java-shared-dependencies/issues/707)) ([d02918a](https://togithub.com/googleapis/java-shared-dependencies/commit/d02918a0418cd65d1d247f27afb0637f1f8f5666))
-   update dependency org.checkerframework:checker-qual to v3.22.1 ([#&#8203;706](https://togithub.com/googleapis/java-shared-dependencies/issues/706)) ([545843b](https://togithub.com/googleapis/java-shared-dependencies/commit/545843b492cead230b8cc72a1dae7d4922f33b39))
-   update dependency org.checkerframework:checker-qual to v3.22.2 ([#&#8203;717](https://togithub.com/googleapis/java-shared-dependencies/issues/717)) ([142852a](https://togithub.com/googleapis/java-shared-dependencies/commit/142852a37140f221197f5c71aed451def353b1e0))
-   update gax.version to v2.18.2 ([#&#8203;718](https://togithub.com/googleapis/java-shared-dependencies/issues/718)) ([5f8156e](https://togithub.com/googleapis/java-shared-dependencies/commit/5f8156e55c6a07b018a8c5efafa68be781b4288b))
-   update google.common-protos.version to v2.9.0 ([#&#8203;714](https://togithub.com/googleapis/java-shared-dependencies/issues/714)) ([9e5591e](https://togithub.com/googleapis/java-shared-dependencies/commit/9e5591ec3035350450ecbfebd00e08216433b06c))
-   update google.core.version to v2.8.0 ([#&#8203;719](https://togithub.com/googleapis/java-shared-dependencies/issues/719)) ([4023c60](https://togithub.com/googleapis/java-shared-dependencies/commit/4023c6063a2c5b5308da531df1a08c90c491965d))
-   update iam.version to v1.4.0 ([#&#8203;700](https://togithub.com/googleapis/java-shared-dependencies/issues/700)) ([c1097a4](https://togithub.com/googleapis/java-shared-dependencies/commit/c1097a46ab0739b0b7234bc510e4c3d9ce2c2861))
-   update iam.version to v1.4.1 ([#&#8203;716](https://togithub.com/googleapis/java-shared-dependencies/issues/716)) ([e2dc7c2](https://togithub.com/googleapis/java-shared-dependencies/commit/e2dc7c21c39e007878841e2664d548ec44a72d54))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset).
github-actions bot pushed a commit to suztomo/google-cloud-java that referenced this pull request Jul 1, 2022
🤖 I have created a release *beep* *boop*
---


## [3.4.0](googleapis/java-asset@v3.3.1...v3.4.0) (2022-06-30)


### Features

* Enable REST transport for most of Java and Go clients ([googleapis#1242](googleapis/java-asset#1242)) ([86eb248](googleapis/java-asset@86eb248))


### Bug Fixes

* update gapic-generator-java with mock service generation fixes ([googleapis#1249](googleapis/java-asset#1249)) ([7d124ad](googleapis/java-asset@7d124ad))


### Dependencies

* update dependency com.google.api.grpc:proto-google-cloud-orgpolicy-v1 to v2.2.1 ([googleapis#1245](googleapis/java-asset#1245)) ([9b0d4e9](googleapis/java-asset@9b0d4e9))
* update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.101.0 ([googleapis#1228](googleapis/java-asset#1228)) ([c5f1712](googleapis/java-asset@c5f1712))
* update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.101.1 ([googleapis#1233](googleapis/java-asset#1233)) ([42031ef](googleapis/java-asset@42031ef))
* update dependency com.google.api.grpc:proto-google-identity-accesscontextmanager-v1 to v1.3.1 ([googleapis#1246](googleapis/java-asset#1246)) ([d868803](googleapis/java-asset@d868803))
* update dependency com.google.cloud:google-cloud-bigquery to v2.13.1 ([googleapis#1227](googleapis/java-asset#1227)) ([113c52f](googleapis/java-asset@113c52f))
* update dependency com.google.cloud:google-cloud-bigquery to v2.13.3 ([googleapis#1234](googleapis/java-asset#1234)) ([7006c44](googleapis/java-asset@7006c44))
* update dependency com.google.cloud:google-cloud-bigquery to v2.13.4 ([googleapis#1239](googleapis/java-asset#1239)) ([9c59632](googleapis/java-asset@9c59632))
* update dependency com.google.cloud:google-cloud-bigquery to v2.13.6 ([googleapis#1244](googleapis/java-asset#1244)) ([a305745](googleapis/java-asset@a305745))
* update dependency com.google.cloud:google-cloud-core to v2.8.0 ([googleapis#1238](googleapis/java-asset#1238)) ([8224b02](googleapis/java-asset@8224b02))
* update dependency com.google.cloud:google-cloud-resourcemanager to v1.4.0 ([googleapis#1230](googleapis/java-asset#1230)) ([5655582](googleapis/java-asset@5655582))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([googleapis#1241](googleapis/java-asset#1241)) ([2ebe221](googleapis/java-asset@2ebe221))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
github-actions bot pushed a commit that referenced this pull request Sep 15, 2022
🤖 I have created a release *beep* *boop*
---


## [2.3.9](googleapis/java-automl@v2.3.8...v2.3.9) (2022-09-13)


### Dependencies

* Update dependency com.google.cloud:google-cloud-bigquery to v2.16.0 ([#1240](googleapis/java-automl#1240)) ([1dc7d55](googleapis/java-automl@1dc7d55))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: core cla: yes This human has signed the Contributor License Agreement. do not merge Indicates a pull request not ready for merge, due to either quality or timing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Cloud Dataflow/Apache Beam and gcloud-java-core
4 participants