Class PubSubCredentials

java.lang.Object
io.github.flink.gcp.connector.pubsub.PubSubCredentials

@Internal public final class PubSubCredentials extends Object
Loads the credentials shared by the Pub/Sub source and sink client families.
  • Method Details

    • load

      @Nullable public static com.google.api.gax.core.CredentialsProvider 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:
      a fixed provider for the service account, or null for ADC
      Throws:
      IOException - if the configured file cannot be read as a service-account key