Skip to content

Commit

Permalink
Conf Tool assumed RG SUT was a simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
iheos committed Mar 13, 2018
1 parent acd4670 commit 329a971
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import gov.nist.toolkit.services.server.RawResponseBuilder
import gov.nist.toolkit.services.server.ToolkitApi
import gov.nist.toolkit.session.server.Session
import gov.nist.toolkit.simcommon.client.SimId
import gov.nist.toolkit.simcommon.client.SimIdFactory
import gov.nist.toolkit.simcommon.client.SimulatorConfig
import gov.nist.toolkit.simcommon.client.config.SimulatorConfigElement
import gov.nist.toolkit.simcommon.server.SimDb
Expand Down Expand Up @@ -86,17 +87,19 @@ class RgOrchestrationBuilder {
// RG and RR in same site - verify site contents

// Momentarily turn off SAML if the SUT is a simulator. Need manual intervening for real systems.
sutSimId = SimDb.simIdBuilder(request.siteUnderTest.name)
if (Installation.instance().propertyServiceManager().getPropertyManager().isEnableSaml()) {

sutSimConfig = api.getConfig(sutSimId)
if (sutSimConfig != null) {
stsSce = sutSimConfig.get(SimulatorProperties.requiresStsSaml)

if (stsSce != null && stsSce.hasBoolean() && stsSce.asBoolean()) {
sutSaml = true
stsSce.setBooleanValue(false) // Turn off SAML for orchestration
api.saveSimulator(sutSimConfig)
if (SimIdFactory.isSimId(request.siteUnderTest.name)) {
sutSimId = SimDb.simIdBuilder(request.siteUnderTest.name)
if (Installation.instance().propertyServiceManager().getPropertyManager().isEnableSaml()) {

sutSimConfig = api.getConfig(sutSimId)
if (sutSimConfig != null) {
stsSce = sutSimConfig.get(SimulatorProperties.requiresStsSaml)

if (stsSce != null && stsSce.hasBoolean() && stsSce.asBoolean()) {
sutSaml = true
stsSce.setBooleanValue(false) // Turn off SAML for orchestration
api.saveSimulator(sutSimConfig)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ public void run(ErrorRecorder er, MessageValidatorEngine mvc) {
// prefer TLS for Register transaction
endpoint = simulatorConfig.get(SimulatorProperties.registerTlsEndpoint).asString();
}
if (endpoint == null)
if (endpoint == null || endpoint.equals(""))
endpoint = simulatorConfig.get(SimulatorProperties.registerEndpoint).asString();
} catch (Exception e) {
}
if (endpoint == null) {
if (endpoint == null || endpoint.equals("")) {
logger.error("No register endpoint configured");
er.err(Code.XDSRepositoryError, "No register endpoint configured", this, "");
return;
Expand Down

0 comments on commit 329a971

Please sign in to comment.