diff --git a/Model/lib/rng/wdkModel-config.rng b/Model/lib/rng/wdkModel-config.rng index c452081aa..15b3e8313 100644 --- a/Model/lib/rng/wdkModel-config.rng +++ b/Model/lib/rng/wdkModel-config.rng @@ -16,6 +16,9 @@ + + + diff --git a/Model/src/main/java/org/gusdb/wdk/model/config/ModelConfig.java b/Model/src/main/java/org/gusdb/wdk/model/config/ModelConfig.java index 0f03d8488..ef90706ba 100644 --- a/Model/src/main/java/org/gusdb/wdk/model/config/ModelConfig.java +++ b/Model/src/main/java/org/gusdb/wdk/model/config/ModelConfig.java @@ -143,7 +143,7 @@ public String getName() { private final Path _wdkTempDir; public ModelConfig(String modelName, String projectId, Path gusHome, boolean caching, boolean useWeights, - String paramRegex, Optional secretKeyFile, Path wdkTempDir, String webServiceUrl, String assetsUrl, + String paramRegex, Optional secretKeyFile, String secretKey, Path wdkTempDir, String webServiceUrl, String assetsUrl, String smtpServer, String supportEmail, List adminEmails, String emailSubject, String emailContent, ModelConfigUserDB userDB, ModelConfigAppDB appDB, ModelConfigUserDatasetStore userDatasetStoreConfig, QueryMonitor queryMonitor, @@ -164,6 +164,7 @@ public ModelConfig(String modelName, String projectId, Path gusHome, boolean cac // file locations _wdkTempDir = wdkTempDir; _secretKeyFile = secretKeyFile; + _secretKey = secretKey; // network locations _webServiceUrl = webServiceUrl; @@ -297,6 +298,8 @@ public ModelConfigAppDB getAppDB() { * configured secret key file. If the configured filename is null or the contents * of the file cannot be read for any reason, null is returned. * + * Note: as of 8/12/24, you can alternatively directly set the secretKey in model-config.xml + * * @return secret key */ public String getSecretKey() { diff --git a/Model/src/main/java/org/gusdb/wdk/model/config/ModelConfigBuilder.java b/Model/src/main/java/org/gusdb/wdk/model/config/ModelConfigBuilder.java index 5e11ce676..501c81bc7 100644 --- a/Model/src/main/java/org/gusdb/wdk/model/config/ModelConfigBuilder.java +++ b/Model/src/main/java/org/gusdb/wdk/model/config/ModelConfigBuilder.java @@ -29,6 +29,7 @@ public class ModelConfigBuilder { // file locations private String _secretKeyFile; + private String _secretKey; private String _wdkTempDir = "/tmp"; // network locations @@ -108,6 +109,7 @@ public ModelConfig build() throws WdkModelException { // file locations secretKeyFile, + _secretKey, wdkTempDir, // network locations @@ -255,6 +257,14 @@ public void setSecretKeyFile(String secretKeyFile) { _secretKeyFile = secretKeyFile; } + /** + * @param secretKeyFile + * the secretKeyFile to set + */ + public void setSecretKey(String secretKey) { + _secretKey = secretKey; + } + /** * @param authenticationMethod configured authentication method */