Class BigQueryCredentials

java.lang.Object
io.github.flink.gcp.connector.bigquery.BigQueryCredentials

@Internal public final class BigQueryCredentials extends Object
Loads credentials shared by the BigQuery and Cloud Storage client families.
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.google.cloud.bigquery.BigQueryOptions
    bigQueryOptions(String serviceAccountKeyFile)
    Builds BigQuery REST client options carrying the configured service-account credentials.
    static com.google.auth.oauth2.GoogleCredentials
    load(String serviceAccountKeyFile)
    Loads a service-account key file, or returns null to leave application-default credentials in effect.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • load

      @Nullable public static com.google.auth.oauth2.GoogleCredentials load(@Nullable String serviceAccountKeyFile) throws IOException
      Loads a service-account key file, or returns null to leave application-default credentials in effect.

      The path and parser failure are deliberately absent from the exception. A path can expose a mounted secret's name, and parser exceptions can echo credential material. The actionable distinction is whether the configured file could be loaded at all.

      Parameters:
      serviceAccountKeyFile - the configured key-file path, or null for ADC
      Returns:
      the scoped service-account credentials, or null for ADC
      Throws:
      IOException - if the configured file cannot be read as a service-account key
    • bigQueryOptions

      public static com.google.cloud.bigquery.BigQueryOptions bigQueryOptions(String serviceAccountKeyFile) throws IOException
      Builds BigQuery REST client options carrying the configured service-account credentials.
      Throws:
      IOException