This repository was archived by the owner on Aug 28, 2024. It is now read-only.
Commit ccb52c7 1 parent 62ff4af commit ccb52c7 Copy full SHA for ccb52c7
File tree 2 files changed +6
-4
lines changed
azure-spring-boot/src/main/java/com/microsoft/azure
spring/autoconfigure/storage
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 24
24
import java .security .InvalidKeyException ;
25
25
import java .util .HashMap ;
26
26
27
+ import static org .apache .commons .codec .digest .DigestUtils .sha256Hex ;
28
+
27
29
@ Configuration
28
30
@ ConditionalOnClass (ServiceURL .class )
29
31
@ EnableConfigurationProperties (StorageProperties .class )
@@ -59,12 +61,12 @@ public ServiceURL createServiceUrl(@Autowired(required = false) PipelineOptions
59
61
60
62
return serviceURL ;
61
63
}
62
-
64
+
63
65
private URL getURL () throws MalformedURLException {
64
66
if (properties .isEnableHttps ()) {
65
67
return new URL (String .format (BLOB_HTTPS_URL , properties .getAccountName ()));
66
68
}
67
- return new URL (String .format (BLOB_URL , properties .getAccountName ()));
69
+ return new URL (String .format (BLOB_URL , properties .getAccountName ()));
68
70
}
69
71
70
72
private PipelineOptions buildOptions (PipelineOptions fromOptions ) {
@@ -90,7 +92,7 @@ private void trackCustomEvent() {
90
92
customTelemetryProperties .put (TelemetryData .SERVICE_NAME , packageNames [packageNames .length - 1 ]);
91
93
}
92
94
93
- customTelemetryProperties .putIfAbsent (TelemetryData .ACCOUNT_NAME , properties .getAccountName ());
95
+ customTelemetryProperties .putIfAbsent (TelemetryData .ACCOUNT_HASH_NAME , sha256Hex ( properties .getAccountName () ));
94
96
95
97
telemetryProxy .trackEvent (ClassUtils .getUserClass (this .getClass ()).getSimpleName (), customTelemetryProperties );
96
98
}
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ public class TelemetryData {
10
10
public static final String INSTALLATION_ID = "installationId" ;
11
11
public static final String PROJECT_VERSION = "version" ;
12
12
public static final String SERVICE_NAME = "serviceName" ;
13
- public static final String ACCOUNT_NAME = "accountName " ;
13
+ public static final String ACCOUNT_HASH_NAME = "accountHashName " ;
14
14
}
You can’t perform that action at this time.
0 commit comments