Class VaultMethods


  • public final class VaultMethods
    extends Object
    Methods for Hashicorp Vault
    • Constructor Detail

      • VaultMethods

        @Autowired
        public VaultMethods​(io.toro.martini.vault.VaultProvider provider)
    • Method Detail

      • read

        @GloopObjectParameter("output{\n  vaultResponse#io.toro.martini.vault.VaultResponse{\n  }\n}")
        public static final GloopModel read​(@GloopParameter(allowNull=true)
                                            String packageName,
                                            @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                            GloopModel task)
        Reads data from the kv engine version 1
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The secret's path must be specified in pathToKey.
        Since:
        2.0
      • readVersioned

        @GloopObjectParameter("output{\n  versionedResponse#io.toro.martini.vault.Versioned{\n  }\n}")
        public static final GloopModel readVersioned​(@GloopParameter(allowNull=true)
                                                     String packageName,
                                                     @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                                     GloopModel task)
        Reads data from the kv engine version 2
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where kv v2 (versioned) engine is mounted should be specified in mountPath. The secret's path must be specified in pathToKey as well. To access a specific version, specify the version number.
        Since:
        2.0
      • readData

        public static String readData​(@GloopParameter(allowNull=true)
                                      String packageName,
                                      @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                      GloopModel task,
                                      String fieldKey)
        Read a specific field of the data to the kv engine version 1
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where kv v2 (versioned) engine is mounted should be specified in mountPath. The secret's path must be specified in pathToKey as well. To specify key-values, add element/s to values.
        fieldKey - the name of the field to be fetched from the data
        Since:
        2
      • readVersionedData

        public static String readVersionedData​(@GloopParameter(allowNull=true)
                                               String packageName,
                                               @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                               GloopModel task,
                                               String fieldKey)
        Read a specific field of the data to the kv engine version 2
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where kv v2 (versioned) engine is mounted should be specified in mountPath. The secret's path must be specified in pathToKey as well. To specify key-values, add element/s to values.
        fieldKey - the name of the field to be fetched from the data
        Since:
        2.0
      • write

        @GloopObjectParameter("output{\n  vaultResponse#io.toro.martini.vault.VaultResponse{\n  }\n}")
        public static final GloopModel write​(@GloopParameter(allowNull=true)
                                             String packageName,
                                             @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                             GloopModel task)
        Writes data to the kv engine version 1
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The secret's path must be specified in pathToKey. To specify key-values, add element/s to values.
        Since:
        2.0
      • writeVersioned

        @GloopObjectParameter("output{\n  versionedResponse#io.toro.martini.vault.Versioned{\n  }\n}")
        public static final GloopModel writeVersioned​(@GloopParameter(allowNull=true)
                                                      String packageName,
                                                      @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                                      GloopModel task)
        Writes data to the kv engine version 2
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where kv v2 (versioned) engine is mounted should be specified in mountPath. The secret's path must be specified in pathToKey as well. To specify key-values, add element/s to values.
        Since:
        2.0
      • delete

        public static final void delete​(@GloopParameter(allowNull=true)
                                        String packageName,
                                        @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                        GloopModel task)
        Deletes data from the kv engine version 1
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The secret's path must be specified in pathToKey.
        Since:
        2.0
      • deleteVersioned

        public static final void deleteVersioned​(@GloopParameter(allowNull=true)
                                                 String packageName,
                                                 @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                                 GloopModel task)
        Deletes data from the kv engine version 2
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where kv v2 (versioned) engine is mounted should be specified in mountPath. The secret's path must be specified in pathToKey as well. To delete a specific version, specify the version number.
        Since:
        2.0
      • undeleteVersioned

        public static final void undeleteVersioned​(@GloopParameter(allowNull=true)
                                                   String packageName,
                                                   @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                                   GloopModel task)
        Restores a version of the data in the kv engine version 2
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where kv v2 (versioned) engine is mounted should be specified in mountPath. The secret's path must be specified in pathToKey and the version number should be appropriately set as well.
        Since:
        2.0
      • destroyVersioned

        public static final void destroyVersioned​(@GloopParameter(allowNull=true)
                                                  String packageName,
                                                  @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                                  GloopModel task)
        Permanently removes a version of the data in the kv engine version 2
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where kv v2 (versioned) engine is mounted should be specified in mountPath. The secret's path must be specified in pathToKey and the version number should be appropriately set as well.
        Since:
        2.0
      • encryptString

        @GloopObjectParameter("output{\n  ciphertext#io.toro.martini.vault.Ciphertext{\n  }\n}")
        public static final GloopModel encryptString​(@GloopParameter(allowNull=true)
                                                     String packageName,
                                                     @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                                     GloopModel task)
        Encrypt a string plaintext using transit secret engine
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where transit secrets engine is mounted should be specified in mountPath. The encryption key must be existing in Vault and should be specified in transitOpts.encryptionKey. The plaintext to encrypt should be specified in transitOpts.plaintextAsString.
        Returns:
      • encryptByteArray

        @GloopObjectParameter("output{\n  ciphertext#io.toro.martini.vault.Ciphertext{\n  }\n}")
        public static final GloopModel encryptByteArray​(@GloopParameter(allowNull=true)
                                                        String packageName,
                                                        @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                                        GloopModel task)
        Encrypt a byte array plaintext using transit secret engine
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where transit secrets engine is mounted should be specified in mountPath. The encryption key must be existing in Vault and should be specified in transitOpts.encryptionKey. The plaintext to encrypt should be specified in transitOpts.plaintextAsByteArray.
        Returns:
      • decrypt

        @GloopObjectParameter("output{\n  plaintext#io.toro.martini.vault.Plaintext{\n  }\n}")
        public static final GloopModel decrypt​(@GloopParameter(allowNull=true)
                                               String packageName,
                                               @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                               GloopModel task)
        Decrypt a ciphertext using transit secret engine
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where transit secrets engine is mounted should be specified in mountPath. The encryption key must be existing in Vault and should be specified in transitOpts.encryptionKey. The ciphertext to decrypt should be specified in transitOpts.ciphertext.
        Returns:
      • rewrap

        public static final String rewrap​(@GloopParameter(allowNull=true)
                                          String packageName,
                                          @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                          GloopModel task)
        Update the ciphertext to the latest version of the encryption key
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where transit secrets engine is mounted should be specified in mountPath. The encryption key must be existing in Vault and should be specified in transitOpts.encryptionKey. The ciphertext to rewrap should be specified in transitOpts.ciphertext.
        Returns:
      • rotate

        public static final void rotate​(@GloopParameter(allowNull=true)
                                        String packageName,
                                        @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                        GloopModel task)
        Rotates the version of the named key.
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where kv v2 (versioned) engine is mounted should be specified in mountPath. The secret's path must be specified in pathToKey and the version number should be appropriately set as well.
        Since:
        2.0
      • signString

        @GloopObjectParameter("output{\n  signature#io.toro.martini.vault.Signature{\n  }\n}")
        public static final GloopModel signString​(@GloopParameter(allowNull=true)
                                                  String packageName,
                                                  @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                                  GloopModel task)
        Sign a string plaintext. The key used must support signing.
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where transit secrets engine is mounted should be specified in mountPath. The encryption key must be existing in Vault and should be specified in transitOpts.encryptionKey. The string plaintext to sign should be specified in transitOpts.plaintextAsString.
        Returns:
      • signByteArray

        @GloopObjectParameter("output{\n  signature#io.toro.martini.vault.Signature{\n  }\n}")
        public static final GloopModel signByteArray​(@GloopParameter(allowNull=true)
                                                     String packageName,
                                                     @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                                     GloopModel task)
        Sign a byte array plaintext. The key used must support signing.
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where transit secrets engine is mounted should be specified in mountPath. The encryption key must be existing in Vault and should be specified in transitOpts.encryptionKey. The byte array plaintext to sign should be specified in transitOpts.plaintextAsByteArray.
        Returns:
      • verifyString

        public static final boolean verifyString​(@GloopParameter(allowNull=true)
                                                 String packageName,
                                                 @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                                 GloopModel task)
        Verify the signature of a string plaintext.
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where transit secrets engine is mounted should be specified in mountPath. The encryption key must be existing in Vault and should be specified in transitOpts.encryptionKey. The signature to verify should be specified in transitOpts.signature and the string plaintext in transitOpts.plaintextAsString.
        Returns:
      • verifyByteArray

        public static final boolean verifyByteArray​(@GloopParameter(allowNull=true)
                                                    String packageName,
                                                    @GloopObjectParameter("task#io.toro.martini.vault.Task{\n }\n")
                                                    GloopModel task)
        Parameters:
        packageName - the name of the package where Vault instance resides
        task - the gloop model containing data to be sent to Vault. The path where transit secrets engine is mounted should be specified in mountPath. The encryption key must be existing in Vault and should be specified in transitOpts.encryptionKey. The signature to verify should be specified in transitOpts.signature and the byte array plaintext in transitOpts.plaintextAsByteArray.
        Returns: