Record Class GitCredentials

java.lang.Object
java.lang.Record
io.skipcheck.tm1.client.service.git.GitCredentials
Record Components:
username - the user name, for HTTPS
password - the password or access token, for HTTPS
publicKey - the SSH public key
privateKey - the SSH private key
passphrase - the private key's passphrase

public record GitCredentials(@Nullable String username, @Nullable String password, @Nullable String publicKey, @Nullable String privateKey, @Nullable String passphrase) extends Record
How TM1 signs in to the Git remote: nothing (a public or git:// remote), a user name and password or token (HTTPS), or an SSH key pair. TM1 doesn't keep them, so every call that reaches the remote takes them again. toString() leaves the secrets out.
  • Constructor Details

    • GitCredentials

      public GitCredentials(@Nullable String username, @Nullable String password, @Nullable String publicKey, @Nullable String privateKey, @Nullable String passphrase)
      Creates an instance of a GitCredentials record class.
      Parameters:
      username - the value for the username record component
      password - the value for the password record component
      publicKey - the value for the publicKey record component
      privateKey - the value for the privateKey record component
      passphrase - the value for the passphrase record component
  • Method Details

    • none

      public static GitCredentials none()
      No credentials.
      Returns:
      them
    • password

      public static GitCredentials password(String username, String password)
      A user name and password, or access token, for an HTTPS remote.
      Parameters:
      username - the user name
      password - the password or token
      Returns:
      them
    • sshKey

      public static GitCredentials sshKey(String publicKey, String privateKey, @Nullable String passphrase)
      An SSH key pair, for an SSH remote.
      Parameters:
      publicKey - the public key
      privateKey - the private key
      passphrase - its passphrase, or null for none
      Returns:
      them
    • toString

      public String toString()
      Which credentials these are, without the secrets.
      Specified by:
      toString in class Record
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • username

      public @Nullable String username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • password

      public @Nullable String password()
      Returns the value of the password record component.
      Returns:
      the value of the password record component
    • publicKey

      public @Nullable String publicKey()
      Returns the value of the publicKey record component.
      Returns:
      the value of the publicKey record component
    • privateKey

      public @Nullable String privateKey()
      Returns the value of the privateKey record component.
      Returns:
      the value of the privateKey record component
    • passphrase

      public @Nullable String passphrase()
      Returns the value of the passphrase record component.
      Returns:
      the value of the passphrase record component