Skip to content

Commit 5ec147b

Browse files
authored
Merge pull request #108 from SentriusLLC/fix_npes
Resolve NPEs in demo installer
2 parents d5b9ef1 + fd0665c commit 5ec147b

File tree

7 files changed

+25
-10
lines changed

7 files changed

+25
-10
lines changed

.local.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SENTRIUS_VERSION=1.1.507
1+
SENTRIUS_VERSION=1.1.510
22
SENTRIUS_SSH_VERSION=1.1.45
33
SENTRIUS_KEYCLOAK_VERSION=1.1.60
44
SENTRIUS_AGENT_VERSION=1.1.51
@@ -7,4 +7,4 @@ LLMPROXY_VERSION=1.0.88
77
LAUNCHER_VERSION=1.0.91
88
AGENTPROXY_VERSION=1.0.92
99
SSHPROXY_VERSION=1.0.91
10-
RDPPROXY_VERSION=1.0.121
10+
RDPPROXY_VERSION=1.0.122

.local.env.bak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SENTRIUS_VERSION=1.1.507
1+
SENTRIUS_VERSION=1.1.510
22
SENTRIUS_SSH_VERSION=1.1.45
33
SENTRIUS_KEYCLOAK_VERSION=1.1.60
44
SENTRIUS_AGENT_VERSION=1.1.51
@@ -7,4 +7,4 @@ LLMPROXY_VERSION=1.0.88
77
LAUNCHER_VERSION=1.0.91
88
AGENTPROXY_VERSION=1.0.92
99
SSHPROXY_VERSION=1.0.91
10-
RDPPROXY_VERSION=1.0.121
10+
RDPPROXY_VERSION=1.0.122

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ protected List<User> createUsers(
584584
throws SQLException, GeneralSecurityException {
585585
List<User> users = new ArrayList<>();
586586
Map<Long, Set<Long>> assignments = new HashMap<>();
587-
if (null != installConfiguration.getUsers()) {
587+
if (null != installConfiguration.getNpes()) {
588588
for (var userDTO : installConfiguration.getUsers()) {
589589
if (userDTO.getPassword() == null || userDTO.getPassword().isEmpty()) {
590590
log.warn("User {} has no password");
@@ -613,8 +613,6 @@ protected List<User> createUsers(
613613

614614
User user = User.from(userDTO, type.get());
615615

616-
user.setIdentityType(IdentityType.NON_PERSON_ENTITY);
617-
618616

619617

620618
User finalUser = user;
@@ -714,8 +712,8 @@ protected List<User> createNPEs(
714712
throws SQLException, GeneralSecurityException {
715713
List<User> users = new ArrayList<>();
716714
Map<Long, Set<Long>> assignments = new HashMap<>();
717-
if (null != installConfiguration.getUsers()) {
718-
for (var userDTO : installConfiguration.getUsers()) {
715+
if (null != installConfiguration.getNpes()) {
716+
for (var userDTO : installConfiguration.getNpes()) {
719717
if (userDTO.getPassword() == null || userDTO.getPassword().isEmpty()) {
720718
log.warn("User {} has no password");
721719
userDTO.setPassword(UUID.randomUUID().toString());
@@ -742,6 +740,7 @@ protected List<User> createNPEs(
742740
}
743741

744742
User user = User.from(userDTO, type.get());
743+
user.setIdentityType(IdentityType.NON_PERSON_ENTITY);
745744

746745

747746

core/src/main/java/io/sentrius/sso/core/dto/HostSystemDTO.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public class HostSystemDTO {
2525

2626
private String authorizedKeys;
2727

28-
private boolean isRdp;
28+
@Builder.Default
29+
private boolean isRdp = false;
2930
private boolean rdpUser;
3031
private boolean rdpPassword;
3132

core/src/main/java/io/sentrius/sso/core/dto/UserDTO.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ public class UserDTO {
2323
public String team;
2424
public String password;
2525

26+
@Builder.Default
27+
public Boolean isNpe= false;
28+
2629
@Builder.Default
2730
public String status = "ACTIVE";
2831

dataplane/src/main/java/io/sentrius/sso/core/model/HostSystem.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ public static HostSystem fromDTO(HostSystemDTO dto) {
209209
hostSystem.setErrorMsg(dto.getErrorMsg());
210210
hostSystem.setPort(dto.getPort());
211211
hostSystem.setSshUser(dto.getSshUser());
212+
if (dto.isRdp()) {
213+
hostSystem.setRdpEnabled(dto.isRdp());
214+
hostSystem.setRdpUser(dto.isRdpUser() ? dto.getSshUser() : "");
215+
hostSystem.setRdpPassword(dto.isRdpPassword() ? dto.getPassword() : "");
216+
}
217+
212218
return hostSystem;
213219
}
214220

docker/sentrius/demoInstaller.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ systems:
5353
port: 22
5454
host: sentrius-bad-ssh
5555
authorizedKeys: ~/.ssh/authorized_keys
56+
- displayName: sentrius-rdp-test
57+
sshUser: ubuntu
58+
password: ubuntu
59+
rdp: true
60+
host: sentrius-rdp
5661

5762
## Define groups of users who are assigned to systems
5863
## also entails the configuration that is applied to groupf
@@ -63,6 +68,7 @@ managementGroups:
6368
description: test group
6469
systems:
6570
- SSH-HOST
71+
- sentrius-rdp-test
6672
configuration:
6773
configurationName: testConfig
6874
terminalsLocked: false

0 commit comments

Comments
 (0)