Skip to content

Commit f3f6278

Browse files
committed
Fixed audit logs
1 parent 7bba39e commit f3f6278

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

vault/src/main/java/io/scalecube/security/vault/VaultServiceRolesInstaller.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ public static Builder builder() {
7676
*/
7777
public void install() {
7878
if (isNullOrNoneOrEmpty(vaultAddress)) {
79-
LOGGER.debug("Skipping serviceRoles installation, vaultAddress not set");
79+
LOGGER.debug("Skipping service roles installation, vault address not set");
8080
return;
8181
}
8282

8383
final ServiceRoles serviceRoles = loadServiceRoles();
8484
if (serviceRoles == null || serviceRoles.roles.isEmpty()) {
85-
LOGGER.debug("Skipping serviceRoles installation, serviceRoles not set");
85+
LOGGER.debug("Skipping service roles installation, service roles not set");
8686
return;
8787
}
8888

@@ -95,6 +95,7 @@ public void install() {
9595
final var keyName = keyNameSupplier.get();
9696

9797
createVaultIdentityKey(rest.url(vaultIdentityKeyUri(keyName)), keyName);
98+
LOGGER.debug("Vault identity key: {}", keyName);
9899

99100
for (var role : serviceRoles.roles) {
100101
final var roleName = roleNameBuilder.apply(role.role);
@@ -103,9 +104,10 @@ public void install() {
103104
keyName,
104105
role.role,
105106
role.permissions);
107+
LOGGER.debug("Vault identity role: {}", roleName);
106108
}
107109

108-
LOGGER.debug("Installed serviceRoles ({})", serviceRoles);
110+
LOGGER.debug("Installed service roles: {}", serviceRoles);
109111
})
110112
.get(timeout, timeUnit);
111113
} catch (Exception e) {
@@ -114,10 +116,6 @@ public void install() {
114116
}
115117

116118
private ServiceRoles loadServiceRoles() {
117-
if (serviceRolesSources == null) {
118-
return null;
119-
}
120-
121119
for (Supplier<ServiceRoles> serviceRolesSource : serviceRolesSources) {
122120
final ServiceRoles serviceRoles = serviceRolesSource.get();
123121
if (serviceRoles != null) {
@@ -146,7 +144,6 @@ private void createVaultIdentityKey(Rest rest, String keyName) {
146144

147145
try {
148146
awaitSuccess(rest.body(body).post().getStatus());
149-
LOGGER.debug("Created vault identity key: {}", keyName);
150147
} catch (RestException e) {
151148
throw new RuntimeException("Failed to create vault identity key: " + keyName, e);
152149
}
@@ -164,7 +161,6 @@ private void createVaultIdentityRole(
164161

165162
try {
166163
awaitSuccess(rest.body(body).post().getStatus());
167-
LOGGER.debug("Created vault identity role: {}", roleName);
168164
} catch (RestException e) {
169165
throw new RuntimeException("Failed to create vault identity role: " + roleName, e);
170166
}

0 commit comments

Comments
 (0)