Class ServiceAccountKeyFiles

java.lang.Object
io.github.flink.gcp.connector.testutils.ServiceAccountKeyFiles

@Internal public final class ServiceAccountKeyFiles extends Object
Creates synthetic service-account keys for credential wiring tests: structurally valid enough for the Google auth libraries to parse — a real RSA key in a real PEM envelope — while naming an example.invalid account no service would ever accept, so a test that leaks one at a real endpoint fails loudly rather than authenticating.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Path
    create(Path directory)
    Writes a valid synthetic service-account key below directory, always as service-account.json — a second call with the same directory overwrites the first key.
    static String
    Returns the key as the JSON document itself, for a test that feeds the material somewhere other than a file of this class's choosing.
    static String
    json(String privateKeyId)
    Returns the key with the given private_key_id, for a test that plants a sentinel there and asserts it never surfaces elsewhere — a serialized form, a log line.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • create

      public static Path create(Path directory) throws IOException
      Writes a valid synthetic service-account key below directory, always as service-account.json — a second call with the same directory overwrites the first key.
      Throws:
      IOException
    • json

      public static String json()
      Returns the key as the JSON document itself, for a test that feeds the material somewhere other than a file of this class's choosing.
    • json

      public static String json(String privateKeyId)
      Returns the key with the given private_key_id, for a test that plants a sentinel there and asserts it never surfaces elsewhere — a serialized form, a log line.