Skip to content

Commit 5d5e5c2

Browse files
committed
Closes #23 to ensure we consistently name Host Groups Host Enclaves
1 parent 6c47570 commit 5d5e5c2

File tree

10 files changed

+27
-27
lines changed

10 files changed

+27
-27
lines changed

api/src/main/java/io/sentrius/sso/startup/ConfigurationApplicationTask.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ protected List<HostGroup> createHostGroups(List<SideEffect> sideEffects, Map<Str
276276
if (action) {
277277

278278
hostGroup = hostGroupRepository.save(hostGroup);
279-
log.info("Creating Host Group {} with {}", hostGroup.getId(), hostGroupDto.getDisplayName());
279+
log.info("Creating Host Enclave {} with {}", hostGroup.getId(), hostGroupDto.getDisplayName());
280280
profiles.add(hostGroup);
281281
for(var hs : hostGroup.getHostSystems()) {
282282
if (null == hs.getHostGroups()){
@@ -287,27 +287,27 @@ protected List<HostGroup> createHostGroups(List<SideEffect> sideEffects, Map<Str
287287
systemRepository.save(hs);
288288
}
289289
}
290-
sideEffects.add(SideEffect.builder().sideEffectDescription("Creating Host Group " + hostGroupDto.getDisplayName()).type(
290+
sideEffects.add(SideEffect.builder().sideEffectDescription("Creating Host Enclave " + hostGroupDto.getDisplayName()).type(
291291
SideEffectType.UPDATE_DATABASE).asset("HostGroups").build());
292292
}else {
293293

294294
boolean existsInHostGroup = false;
295295

296296

297297
for(HostGroup hg : hostGroups) {
298-
log.info("Updating Host Group {} with {}", hg.getId(), hg.getId());
298+
log.info("Updating Host Enclave {} with {}", hg.getId(), hg.getId());
299299
profiles.add(hg);
300300

301301
for(var hs : hostGroup.getHostSystems()) {
302302
if (!systemRepository.isAssignedToHostGroups(hs.getId(), List.of( hg.getId()))) {
303303
if (action) {
304304
hs.getHostGroups().add(hg);
305305
systemRepository.save(hs);
306-
log.info("Updating Host Group {} with {}", hg.getId(), hs.getId());
306+
log.info("Updating Host Enclave {} with {}", hg.getId(), hs.getId());
307307
}
308308

309309
sideEffects.add(SideEffect.builder()
310-
.sideEffectDescription("Updating Host Group " + hostGroupDto.getDisplayName()).type(
310+
.sideEffectDescription("Updating Host Enclave " + hostGroupDto.getDisplayName()).type(
311311
SideEffectType.UPDATE_DATABASE).asset("HostGroups").build());
312312
}
313313
}
@@ -453,10 +453,10 @@ protected List<User> createUsers(
453453

454454

455455
sideEffects.add(SideEffect.builder().sideEffectDescription(
456-
"Assigning user " + userDTO.getUsername() + " to Host Group " +
456+
"Assigning user " + userDTO.getUsername() + " to Host Enclave " +
457457
hostGroup.getName()).type(
458458
SideEffectType.UPDATE_DATABASE).asset("Users").build());
459-
log.info("Assigning user {} to Host Group {}", userDTO.getUsername(),
459+
log.info("Assigning user {} to Host Enclave {}", userDTO.getUsername(),
460460
hostGroup.getId());
461461
user.getHostGroups().add(hostGroup);
462462
}
@@ -473,15 +473,15 @@ protected List<User> createUsers(
473473
for (var profile : userDTO.getHostGroups()) {
474474
for (HostGroup hostGroup : profiles) {
475475
if (hostGroup.getName().equals(profile.getDisplayName())) {
476-
log.info("Assigning user {} to Host Group {}", userDTO.getUsername(),
476+
log.info("Assigning user {} to Host Enclave {}", userDTO.getUsername(),
477477
hostGroup.getId());
478478
if (null == hostGroup.getId() || !userRepository.isAssignedToHostGroups(user.getId(),
479479
List.of(hostGroup.getId()))) {
480480
sideEffects.add(SideEffect.builder().sideEffectDescription(
481-
"Assigning user " + userDTO.getUsername() + " to Host Group " +
481+
"Assigning user " + userDTO.getUsername() + " to Host Enclave " +
482482
hostGroup.getName()).type(
483483
SideEffectType.UPDATE_DATABASE).asset("Users").build());
484-
log.info("Assigning user {} to Host Group {}", userDTO.getUsername(),
484+
log.info("Assigning user {} to Host Enclave {}", userDTO.getUsername(),
485485
hostGroup.getId()
486486
);
487487
}

api/src/main/resources/static/js/rules.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ $(document).ready(function () {
110110

111111
if (row.canEdit) {
112112
buttons +=
113-
`<button class="btn btn-secondary spacer spacer-middle" data-bs-toggle="modal" data-bs-target="#edit_dialog_${data}" onclick="editRule(${data})">Edit</button><button id="role_btn_${data}" onclick="assignRule(${data})" class="btn btn-secondary assign_btn spacer spacer-right">Assign Host Groups</button>
113+
`<button class="btn btn-secondary spacer spacer-middle" data-bs-toggle="modal" data-bs-target="#edit_dialog_${data}" onclick="editRule(${data})">Edit</button><button id="role_btn_${data}" onclick="assignRule(${data})" class="btn btn-secondary assign_btn spacer spacer-right">Assign Host Enclaves</button>
114114
`;
115115
}
116116

@@ -165,7 +165,7 @@ $(document).ready(function () {
165165
if (response.ok) {
166166
$('#rule-table').DataTable().ajax.reload(null, false);
167167
} else {
168-
alert("Failed to assign host groups.");
168+
alert("Failed to assign host enclaves.");
169169
}
170170
const modal = bootstrap.Modal.getInstance(document.getElementById("assignHostGroupsModal"));
171171
modal.hide();

api/src/main/resources/templates/fragments/assign_rule.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<!-- Assign Host Groups Modal -->
1+
<!-- Assign Host Enclaves Modal -->
22
<div class="modal fade" id="assignHostGroupsModal" tabindex="-1" aria-labelledby="assignHostGroupsModalLabel" aria-hidden="true">
33
<div class="modal-dialog">
44
<div class="modal-content">
55
<form id="assignHostGroupsForm" method="POST">
66
<div class="modal-header">
7-
<h5 class="modal-title" id="assignHostGroupsModalLabel">Assign Host Groups</h5>
7+
<h5 class="modal-title" id="assignHostGroupsModalLabel">Assign Host Enclaves</h5>
88
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
99
</div>
1010
<div class="modal-body">
@@ -15,17 +15,17 @@ <h5 class="modal-title" id="assignHostGroupsModalLabel">Assign Host Groups</h5>
1515
<label for="assignRuleName" class="form-label">Rule Name</label>
1616
<input type="text" class="form-control" id="assignRuleName" name="assignRuleName" readonly>
1717
</div>
18-
<!-- Host Groups Multi-select -->
18+
<!-- Host Enclaves Multi-select -->
1919
<div class="mb-3">
20-
<label for="hostGroups" class="form-label">Host Groups</label>
20+
<label for="hostGroups" class="form-label">Host Enclaves</label>
2121
<select name="hostGroups" id="hostGroups" class="form-select" multiple>
2222
<!-- Options will be dynamically populated -->
2323
</select>
2424
</div>
2525
</div>
2626
<div class="modal-footer">
2727
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
28-
<button type="submit" class="btn btn-primary">Assign Host Groups</button>
28+
<button type="submit" class="btn btn-primary">Assign Host Enclaves</button>
2929
</div>
3030
<!-- CSRF Token -->
3131

api/src/main/resources/templates/fragments/dashboard/dashboard_cards.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h5 class="card-title">Number of assigned hosts</h5>
5050
<i class="fas fa-users card-icon"></i> <!-- Icon for the card -->
5151
</div>
5252
<div class="card-body">
53-
<h5 class="card-title">Number of Host Groups</h5>
53+
<h5 class="card-title">Number of Host Enclaves</h5>
5454
<p class="card-text"><span id="assigned-sgs"></span></p>
5555
</div>
5656
</div>

api/src/main/resources/templates/fragments/ssh_server_card.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<img src="/images/hosts_medium.png" alt="Terminal Icon" class="card-image">
66
</div>
77
<div class="card-content">
8-
<h3 class="card-title">Host Groups</h3>
8+
<h3 class="card-title">Host Enclaves</h3>
99
<div class="card-stats">
1010
<div class="card-stat">
1111
<span>Assigned Systems:</span>

api/src/main/resources/templates/fragments/topbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<li class="nav-item" th:if="${enclaveList != null && !enclaveList.empty}">
2424
<select th:name="enclaveList" th:onchange="'javascript:changeProfile(this.value)'"
2525
class="form-select view_frm_select" title="Enclave">
26-
<option value="">- Select Host Group -</option>
26+
<option value="">- Select Host Enclave -</option>
2727
<option th:each="p : ${enclaveList}" th:value="${p.id}" th:text="${p.nm}" th:if="${p.selected == true}" selected></option>
2828
<option th:each="p : ${enclaveList}" th:value="${p.id}" th:text="${p.nm}" th:if="${p.selected != true}"></option>
2929
</select>

api/src/main/resources/templates/sso/ssh/list_servers.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ <h3>Assigned SSH Servers</h3>
8989
<tr>
9090
<th>System Name</th>
9191
<th>Hostname</th>
92-
<th>Host Group</th>
92+
<th>Host Enclave</th>
9393
<th>SSH User</th>
9494
<th>Port</th>
9595
<th>Operations</th>

core/src/main/java/io/sentrius/sso/core/data/specification/HostGroupSpecification.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static Specification<HostGroup> findByUserIdAndOptionalFilters(@NonNull L
1818
return (root, query, criteriaBuilder) -> {
1919
List<Predicate> predicates = new ArrayList<>();
2020

21-
// Join the users to filter host groups by user ID
21+
// Join the users to filter host enclaves by user ID
2222
Join<HostGroup, User> userJoin = root.join("users", JoinType.INNER);
2323
predicates.add(criteriaBuilder.equal(userJoin.get("id"), userId));
2424

core/src/main/java/io/sentrius/sso/core/services/HostGroupService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public HostGroup getHostGroup(Long hostGroupId) {
4343
@Transactional
4444
public Optional<HostGroup> getHostGroupWithHostSystems(User user, Long hostGroupId) {
4545
HostGroup hostGroup = hostGroupRepository.findByIdWithUsers(hostGroupId)
46-
.orElseThrow(() -> new EntityNotFoundException("Host Group not found"));
46+
.orElseThrow(() -> new EntityNotFoundException("Host Enclave not found"));
4747

4848

4949
boolean userIsMember = hostGroup.getUsers().stream()
@@ -69,7 +69,7 @@ public List<HostSystem> getAssignedHostsForUser(User user) {
6969

7070
userRepository.findHostGroupsByUserId(user.getId()).forEach(hostGroup -> {
7171
HostGroup sys = hostGroupRepository.findById(hostGroup.getId())
72-
.orElseThrow(() -> new EntityNotFoundException("Host Group not found"));
72+
.orElseThrow(() -> new EntityNotFoundException("Host Enclave not found"));
7373
log.info("HostGroup: {}", sys.getId());
7474
if (null != sys && null != sys.getHostSystemList()) {
7575
Hibernate.initialize(sys.getHostSystemList());
@@ -93,7 +93,7 @@ public List<HostSystem> getAssignedHostsForUserAndId(User user, Long groupId) {
9393
return hostGroup.getId().equals(groupId);
9494
}).forEach(hostGroup -> {
9595
HostGroup sys = hostGroupRepository.findById(hostGroup.getId())
96-
.orElseThrow(() -> new EntityNotFoundException("Host Group not found"));
96+
.orElseThrow(() -> new EntityNotFoundException("Host Enclave not found"));
9797
log.info("HostGroup: {}", sys.getId());
9898
if (null != sys && null != sys.getHostSystemList()) {
9999
Hibernate.initialize(sys.getHostSystemList());

core/src/main/java/io/sentrius/sso/core/services/UserService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public User getOperatingUser(HttpServletRequest request,
9595
log.info("Creating new user: {}", operatingUser);
9696
save(operatingUser);
9797
HostGroup newHg =
98-
HostGroup.builder().name("Host Group for " + operatingUser.getUsername()).description(
99-
operatingUser.getUsername() + "'s Host Group").build();
98+
HostGroup.builder().name("Host Enclave for " + operatingUser.getUsername()).description(
99+
operatingUser.getUsername() + "'s Host Enclave").build();
100100
ProfileDB.save(newHg);
101101

102102
operatingUser.getHostGroups().add(newHg);

0 commit comments

Comments
 (0)