Custom Code Implementation for Vault

Following are the custom code implementation steps for external vault:

  1. Create a folder and initialize typescript project using command tsc –init from CMD.

    NOTE:  

    • The folder name should be same as the vault name specified while adding the vault through API.
    • Ensure created folder name is entered in small case.
  2. Create a type definition file named type.d.ts with the following content. This is also available at build location BUILD_ROOT/AddOns/AECredentialVaultCustomization/.

  1. Create a file <<vaultname>>-util.ts inside folder created in step1. See step1 for vault name and ensure the created file name is entered in small case.
  2. Create a class that implements interface IExternalVault. This interface will provide a method named fetchCredentialsImpl. This method is hooked to fetch credentials from any external vault and all the fetch logic should be inside this. This class should be exported (export: typescript keyword) from the file.
  3. etchCredentialsImpl method expects ExternalVaultInput as an input, this is a json object and will contain all the keys defined while adding the new vault through API.
  4. fetchCredentialsImpl returns ExternalVaultResponse object which contains username and password corresponding to input provided.
  5. Interface contract should be strictly followed. All the input and output object should be as per the type definition file.

    Sample implementation for vault name ‘MyVault’ file name ‘myvault-util.ts’:

  6. Set target value as ‘ES2015’ in tsconfig.json file.
  7. Run command tsc from CMD. This should generate a JS file for the TS file created above.
  8. Copy the created folder (created in step 1) to location: ‘\AssistEdgeAutomation\app\Admin\util\externalVault\vaultimpl`.Remove .ts files from the folder.