Skip to content

Commit

Permalink
remove unused codes (#27722)
Browse files Browse the repository at this point in the history
  • Loading branch information
saragluna authored Mar 18, 2022
1 parent afe170c commit 9fe9738
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

package com.azure.spring.cloud.autoconfigure.keyvault.environment;

import com.azure.core.exception.HttpRequestException;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.util.paging.ContinuablePagedIterable;
import com.azure.security.keyvault.secrets.SecretClient;
Expand Down Expand Up @@ -163,18 +161,18 @@ private void refreshProperties() {
}

/**
* For convention we need to support all relaxed binding format from spring, these may include:
* For convention, we need to support all relaxed binding format from spring, these may include:
* <table>
* <tr><td>Spring relaxed binding names</td></tr>
* <tr><td>acme.my-project.person.first-name</td></tr>
* <tr><td>acme.myProject.person.firstName</td></tr>
* <tr><td>acme.my_project.person.first_name</td></tr>
* <tr><td>ACME_MYPROJECT_PERSON_FIRSTNAME</td></tr>
* </table>
* But azure keyvault only allows ^[0-9a-zA-Z-]+$ and case insensitive, so
* there must be some conversion between spring names and azure keyvault
* names. For example, the 4 properties stated above should be convert to
* acme-myproject-person-firstname in keyvault.
* But azure key vault only allows ^[0-9a-zA-Z-]+$ and case-insensitive, so
* there must be some conversion between spring names and azure key vault
* names. For example, the 4 properties stated above should be converted to
* acme-myproject-person-firstname in key vault.
*
* @param property of secret instance.
* @return the value of secret with given name or null.
Expand Down Expand Up @@ -205,21 +203,4 @@ void setProperties(HashMap<String, String> properties) {
this.properties = properties;
}

boolean isUp() {
boolean result;
try {
//noinspection ResultOfMethodCallIgnored
secretClient.listPropertiesOfSecrets();
result = true;
} catch (HttpResponseException httpResponseException) {
result = httpResponseException.getResponse().getStatusCode() < 500;
} catch (HttpRequestException httpRequestException) {
LOGGER.error("An HTTP error occurred while checking key vault connectivity", httpRequestException);
result = false;
} catch (RuntimeException runtimeException) {
LOGGER.error("A runtime error occurred while checking key vault connectivity", runtimeException);
result = false;
}
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,4 @@ public Object getProperty(String name) {
return operations.getProperty(name);
}

boolean isUp() {
return operations.isUp();
}
}

0 comments on commit 9fe9738

Please sign in to comment.