Skip to content

Commit

Permalink
Merge pull request #73 from woehrl01/ack_register
Browse files Browse the repository at this point in the history
0003540: Do not send sync_disabled during registration attempt
  • Loading branch information
mmichalek committed Oct 29, 2018
2 parents 43bcd8a + 171b209 commit 94e4d5e
Showing 1 changed file with 14 additions and 2 deletions.
Expand Up @@ -933,7 +933,11 @@ public AuthenticationStatus getAuthenticationStatus(String nodeId, String securi
if (node == null) {
retVal = AuthenticationStatus.REGISTRATION_REQUIRED;
} else if (!syncEnabled(node)) {
retVal = AuthenticationStatus.SYNC_DISABLED;
if(registrationOpen(node)){
retVal = AuthenticationStatus.REGISTRATION_REQUIRED;
}else{
retVal = AuthenticationStatus.SYNC_DISABLED;
}
} else if (!isNodeAuthorized(nodeId, securityToken)) {
retVal = AuthenticationStatus.FORBIDDEN;
}
Expand All @@ -946,6 +950,14 @@ protected boolean syncEnabled(Node node) {
syncEnabled = node.isSyncEnabled();
}
return syncEnabled;
}
}

protected boolean registrationOpen(Node node){
NodeSecurity security = findNodeSecurity(node.getNodeId());
if(security != null){
return security.isRegistrationEnabled();
}
return false;
}

}

0 comments on commit 94e4d5e

Please sign in to comment.