vault-credentialstore-lib/src/main/java/com/streamsets/datacollector/credential/vault/VaultCredentialStore.java
@Override
  public CredentialValue get(String group, String name, String credentialStoreOptions) throws StageException {
    Utils.checkNotNull(group, "group cannot be NULL");
    Utils.checkNotNull(name, "name cannot be NULL");
    try {
      Map<String, String> optionsMap =
          Splitter.on(",").omitEmptyStrings().trimResults().withKeyValueSeparator("=").split(credentialStoreOptions);
      String separator = optionsMap.get(SEPARATOR_OPTION);
      if (separator == null) {
        separator = pathKeySeparator;
      }
      String[] splits = name.split(separator, 2);
      if (splits.length != 2) {
        throw new IllegalArgumentException(Utils.format("Vault CredentialStore name '{}' should be <path>{}<key>",
            name, separator
        ));
      }
      String delayStr = optionsMap.get(DELAY_OPTION);
      long delay = (delayStr == null) ? 0 : Long.parseLong(delayStr);

      CredentialValue credential = new VaultCredentialValue(splits[0], splits[1], delay);
      credential.get();
      return credential;
    } catch (Exception ex) {
      throw new StageException(Errors.VAULT_001, name, ex);
    }
  }
@Override
  public CredentialValue get(String group, String name, String credentialStoreOptions) throws StageException {
    Utils.checkNotNull(group, "group cannot be NULL");
    Utils.checkNotNull(name, "name cannot be NULL");
    try {
      Map<String, String> optionsMap =
          Splitter.on(",").omitEmptyStrings().trimResults().withKeyValueSeparator("=").split(credentialStoreOptions);
      String separator = optionsMap.get(SEPARATOR_OPTION);
      if (separator == null) {
        separator = pathKeySeparator;
      }
      String[] splits = name.split(separator, 2);
      if (splits.length != 2) {
        throw new IllegalArgumentException(Utils.format("Vault CredentialStore name '{}' should be <path>{}<key>",
            name, separator
        ));
      }
      String delayStr = optionsMap.get(DELAY_OPTION);
      long delay = (delayStr == null) ? 0 : Long.parseLong(delayStr);

      CredentialValue credential = new VaultCredentialValue(splits[0], splits[1], delay);
      credential.get();
      return credential;
    } catch (Exception ex) {
      throw new StageException(Errors.VAULT_001, name, ex);
    }
  }
@ Override public CredentialValue get ( String group , String name , String credentialStoreOptions ) throws StageException { Utils . checkNotNull ( group , "group cannot be NULL" ) ; Utils . checkNotNull ( name , "name cannot be NULL" ) ; try { Map < String , String > optionsMap = Splitter . on ( "," ) . omitEmptyStrings ( ) . trimResults ( ) . withKeyValueSeparator ( "=" ) . split ( credentialStoreOptions ) ; String separator = optionsMap . get ( SEPARATOR_OPTION ) ; if ( separator == null ) { separator = pathKeySeparator ; } String [ ] splits = name . split ( separator , 2 ) ; if ( splits . length != 2 ) { throw new IllegalArgumentException ( Utils . format ( "Vault CredentialStore name '{}' should be <path>{}<key>" , name , separator ) ) ; } String delayStr = optionsMap . get ( DELAY_OPTION ) ; long delay = ( delayStr == null ) ? 0 : Long . parseLong ( delayStr ) ; CredentialValue credential = new VaultCredentialValue ( splits [ 0 ] , splits [ 1 ] , delay ) ; credential . get ( ) ; return credential ; } catch ( Exception ex ) { throw new StageException ( Errors . VAULT_001 , name , ex ) ; } }
/*
Name format is Vault's [path]@[key]
/ * Name format is Vault s [ path ]