Skip to content

Commit

Permalink
Merge branch 'master' into j21tc9
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrdoherty committed Aug 12, 2024
2 parents b197a24 + 5492811 commit 96f454a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Model/lib/rng/wdkModel-config.rng
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<optional>
<attribute name="secretKeyFile" />
</optional>
<optional>
<attribute name="secretKey" />
</optional>
<optional>
<attribute name="adminEmail" />
</optional>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Path> secretKeyFile, Path wdkTempDir, String webServiceUrl, String assetsUrl,
String paramRegex, Optional<Path> secretKeyFile, String secretKey, Path wdkTempDir, String webServiceUrl, String assetsUrl,
String smtpServer, String supportEmail, List<String> adminEmails, String emailSubject,
String emailContent, ModelConfigUserDB userDB, ModelConfigAppDB appDB,
ModelConfigUserDatasetStore userDatasetStoreConfig, QueryMonitor queryMonitor,
Expand All @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class ModelConfigBuilder {

// file locations
private String _secretKeyFile;
private String _secretKey;
private String _wdkTempDir = "/tmp";

// network locations
Expand Down Expand Up @@ -108,6 +109,7 @@ public ModelConfig build() throws WdkModelException {

// file locations
secretKeyFile,
_secretKey,
wdkTempDir,

// network locations
Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit 96f454a

Please sign in to comment.