Skip to content

Commit

Permalink
Rename R_AKVURLInvalid as its use is no longer AKV specific
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffery-Wasty committed Sep 19, 2024
1 parent 9269c18 commit bbcdf8d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private static String getCurrentClassPath() throws SQLServerException {
URI uri = new URI(location + FORWARD_SLASH);
return uri.getPath() + DEFAULT_PROPS_FILE; // For now, we only allow "mssql-jdbc.properties" as file name.
} catch (URISyntaxException e) {
MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_AKVURLInvalid"));
MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_URLInvalid"));
Object[] msgArgs = {location + FORWARD_SLASH};
throw new SQLServerException(form.format(msgArgs), null, 0, e);
} catch (ClassNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ private void validateNonEmptyAKVPath(String masterKeyPath) throws SQLServerExcep
}
}
} catch (URISyntaxException e) {
MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_AKVURLInvalid"));
MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_URLInvalid"));

Check warning on line 648 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionAzureKeyVaultProvider.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerColumnEncryptionAzureKeyVaultProvider.java#L648

Added line #L648 was not covered by tests
Object[] msgArgs = {masterKeyPath};
throw new SQLServerException(form.format(msgArgs), null, 0, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ protected Object[][] getContents() {
{"R_ForceEncryptionTrue_HonorAEFalseRS", "Cannot set Force Encryption to true for parameter {0} because encryption is not enabled for the statement or procedure."},
{"R_ForceEncryptionTrue_HonorAETrue_UnencryptedColumnRS", "Cannot execute update because Force Encryption was set as true for parameter {0} and the database expects this parameter to be sent as plaintext. This may be due to a configuration error."},
{"R_NullValue", "{0} cannot be null."},
{"R_URLInvalid", "Invalid URL specified: {0}."},
{"R_AKVPathNull", "Azure Key Vault key path cannot be null."},
{"R_AKVURLInvalid", "Invalid URL specified: {0}."},
{"R_AKVMasterKeyPathInvalid", "Invalid Azure Key Vault key path specified: {0}."},
{"R_ManagedIdentityInitFail", "Failed to initialize package to get Managed Identity token for Azure Key Vault."},
{"R_EmptyCEK", "Empty column encryption key specified."},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public void testAkvDecryptColumnEncryptionKey(String serverName, String url, Str
akv.decryptColumnEncryptionKey("http:///^[!#$&-;=?-[]_a-", "", null);
fail(TestResource.getResource("R_expectedExceptionNotThrown"));
} catch (SQLServerException e) {
assertTrue(e.getMessage().matches(TestUtils.formatErrorMsg("R_AKVURLInvalid")), e.getMessage());
assertTrue(e.getMessage().matches(TestUtils.formatErrorMsg("R_URLInvalid")), e.getMessage());
}

// null encryptedColumnEncryptionKey
Expand Down

0 comments on commit bbcdf8d

Please sign in to comment.