uny / quarkiverse-google-cloud-services

Google Cloud Services Quarkus Extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quarkiverse - Google Cloud Services

All Contributors version

This repository hosts extensions for different Google Cloud Services.

You can find documentation for each of these extensions in their sub-directory:

They all share an optional common configuration property to set the project ID:

quarkus.google.cloud.projectId=<your-project-id>

All these extensions works with applications built as native image executables.

These extension works well within the various Google Cloud Functions extensions available inside Quarkus as they directly authenticate via the built-in credentials.

Authenticating to Google Cloud

There are several ways to authenticate to Google Cloud, it depends from where your application runs (inside our outside Google Cloud Platform) and for which service.

The current authentication flow is as follows:

  • Check the quarkus.google.cloud.service-account-location property, if it exists, use the service account file from this location.
  • Check the access token returned as part of OpenId Connect Authorization Code Grant response after a user has authenticated with Google OpenId Connect provider (see Quarkus OpenId Connect for Web Applications). This access token can be used to access Google Services on behalf of the currently authenticated user but will be ignored if the quarkus.google.cloud.accessTokenEnabled property is set to false.
  • Use GoogleCredentials.getApplicationDefault() that will search for credentials in multiple places:
    • Credentials file pointed to by the GOOGLE_APPLICATION_CREDENTIALS environment variable.
    • Credentials provided by the Google Cloud SDK gcloud auth application-default login command.
    • Google Cloud managed environment (Google App Engine, Google Cloud Functions, GCE, ...) built-in credentials.

**Google PubSub and Google Bigtable must be authenticated using the GOOGLE_APPLICATION_CREDENTIALS environment variable only.

Example applications

Example applications can be found inside the integration-test folder:

  • main: RESTEasy endpoints using all the Google Cloud Services extensions, to be deployed as a standalone JAR.
  • google-cloud-functions: A Google Cloud HTTP function using Google Cloud Storage.
  • app-engine: A RESTEasy endpoint using Google Cloud Storage, to be deployed inside Google App Engine.

WARNING

This project is still in its early stage.

Contributions are always welcome, but this repository is not really ready for external contributions yet, better create an issue to discuss them prior to any contributions.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Loïc Mathieu

💻 🚧

sberyozkin

💻

Daniel Zou

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

About

Google Cloud Services Quarkus Extensions

License:Apache License 2.0


Languages

Language:Java 100.0%