@@ -82,7 +82,7 @@ public class Main {
8282 private IStatsCollectorQueue _statsCollectorQueue ;
8383 private RotatingServiceStore serviceProvider ;
8484 private RotatingServiceLinkStore serviceLinkProvider ;
85- private RotatingCloudEncryptionKeyApiProvider s3KeyProvider ;
85+ private RotatingCloudEncryptionKeyApiProvider cloudEncryptionKeyProvider ;
8686
8787 public Main (Vertx vertx , JsonObject config ) throws Exception {
8888 this .vertx = vertx ;
@@ -134,17 +134,17 @@ public Main(Vertx vertx, JsonObject config) throws Exception {
134134 this .fsOptOut = configureCloudOptOutStore ();
135135 }
136136
137- String s3KeyMdPath = this .config .getString (Const .Config .CloudEncryptionKeysMetadataPathProp );
138- this .s3KeyProvider = new RotatingCloudEncryptionKeyApiProvider (fsStores , new GlobalScope (new CloudPath (s3KeyMdPath )));
137+ String cloudEncryptionKeyMdPath = this .config .getString (Const .Config .CloudEncryptionKeysMetadataPathProp );
138+ this .cloudEncryptionKeyProvider = new RotatingCloudEncryptionKeyApiProvider (fsStores , new GlobalScope (new CloudPath (cloudEncryptionKeyMdPath )));
139139 String sitesMdPath = this .config .getString (Const .Config .SitesMetadataPathProp );
140140 String keypairMdPath = this .config .getString (Const .Config .ClientSideKeypairsMetadataPathProp );
141141 this .clientSideKeypairProvider = new RotatingClientSideKeypairStore (fsStores , new GlobalScope (new CloudPath (keypairMdPath )));
142142 String clientsMdPath = this .config .getString (Const .Config .ClientsMetadataPathProp );
143- this .clientKeyProvider = new RotatingClientKeyProvider (fsStores , new GlobalScope (new CloudPath (clientsMdPath )),s3KeyProvider );
143+ this .clientKeyProvider = new RotatingClientKeyProvider (fsStores , new GlobalScope (new CloudPath (clientsMdPath )), cloudEncryptionKeyProvider );
144144 String keysetKeysMdPath = this .config .getString (Const .Config .KeysetKeysMetadataPathProp );
145- this .keysetKeyStore = new RotatingKeysetKeyStore (fsStores , new GlobalScope (new CloudPath (keysetKeysMdPath )),s3KeyProvider );
145+ this .keysetKeyStore = new RotatingKeysetKeyStore (fsStores , new GlobalScope (new CloudPath (keysetKeysMdPath )), cloudEncryptionKeyProvider );
146146 String keysetMdPath = this .config .getString (Const .Config .KeysetsMetadataPathProp );
147- this .keysetProvider = new RotatingKeysetProvider (fsStores , new GlobalScope (new CloudPath (keysetMdPath )),s3KeyProvider );
147+ this .keysetProvider = new RotatingKeysetProvider (fsStores , new GlobalScope (new CloudPath (keysetMdPath )), cloudEncryptionKeyProvider );
148148 String saltsMdPath = this .config .getString (Const .Config .SaltsMetadataPathProp );
149149 this .saltProvider = new RotatingSaltProvider (fsStores , saltsMdPath );
150150 this .optOutStore = new CloudSyncOptOutStore (vertx , fsLocal , this .config , operatorKey , Clock .systemUTC ());
@@ -156,7 +156,7 @@ public Main(Vertx vertx, JsonObject config) throws Exception {
156156 this .serviceLinkProvider = new RotatingServiceLinkStore (fsStores , new GlobalScope (new CloudPath (serviceLinkMdPath )));
157157 }
158158
159- this .siteProvider = clientSideTokenGenerate ? new RotatingSiteStore (fsStores , new GlobalScope (new CloudPath (sitesMdPath )), s3KeyProvider ) : null ;
159+ this .siteProvider = clientSideTokenGenerate ? new RotatingSiteStore (fsStores , new GlobalScope (new CloudPath (sitesMdPath )), cloudEncryptionKeyProvider ) : null ;
160160
161161 if (useStorageMock && coreAttestUrl == null ) {
162162 if (clientSideTokenGenerate ) {
@@ -167,7 +167,7 @@ public Main(Vertx vertx, JsonObject config) throws Exception {
167167 this .saltProvider .loadContent ();
168168 this .keysetProvider .loadContent ();
169169 this .keysetKeyStore .loadContent ();
170- this .s3KeyProvider .loadContent ();
170+ this .cloudEncryptionKeyProvider .loadContent ();
171171
172172 if (this .validateServiceLinks ) {
173173 this .serviceProvider .loadContent ();
@@ -307,6 +307,8 @@ private void run() throws Exception {
307307
308308 private Future <Void > createStoreVerticles () throws Exception {
309309 // load metadatas for the first time
310+ cloudEncryptionKeyProvider .loadContent ();
311+
310312 if (clientSideTokenGenerate ) {
311313 siteProvider .getMetadata ();
312314 clientSideKeypairProvider .getMetadata ();
@@ -335,7 +337,7 @@ private Future<Void> createStoreVerticles() throws Exception {
335337 fs .add (createAndDeployRotatingStoreVerticle ("auth" , clientKeyProvider , "auth_refresh_ms" ));
336338 fs .add (createAndDeployRotatingStoreVerticle ("keyset" , keysetProvider , "keyset_refresh_ms" ));
337339 fs .add (createAndDeployRotatingStoreVerticle ("keysetkey" , keysetKeyStore , "keysetkey_refresh_ms" ));
338- fs .add (createAndDeployRotatingStoreVerticle ("cloud_encryption_keys" , s3KeyProvider , "s3keys_refresh_ms " ));
340+ fs .add (createAndDeployRotatingStoreVerticle ("cloud_encryption_keys" , cloudEncryptionKeyProvider , "cloud_encryption_keys_refresh_ms " ));
339341 fs .add (createAndDeployRotatingStoreVerticle ("salt" , saltProvider , "salt_refresh_ms" ));
340342 fs .add (createAndDeployCloudSyncStoreVerticle ("optout" , fsOptOut , optOutCloudSync ));
341343 CompositeFuture .all (fs ).onComplete (ar -> {
0 commit comments