Skip to content

Commit

Permalink
fix: disable shib config generation when flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
uprightech committed May 6, 2023
1 parent 1dcd1c3 commit 6751499
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javax.inject.Named;

import org.apache.commons.collections.CollectionUtils;
import org.gluu.config.oxtrust.AppConfiguration;
import org.gluu.model.GluuStatus;
import org.gluu.oxtrust.model.GluuSAMLTrustRelationship;
import org.gluu.oxtrust.model.GluuValidationStatus;
Expand Down Expand Up @@ -53,8 +54,9 @@ public class EntityIDMonitoringService {
@Inject
private Event<TimerEvent> timerEvent;

@Inject
private AppConfiguration appConfiguration;


@Inject
private ServiceUtil serviceUtil;

Expand Down Expand Up @@ -92,7 +94,12 @@ public void processMetadataValidationTimerEvent(
}

try {
process();
boolean isConfigGeneration = appConfiguration.isConfigGeneration();
if(isConfigGeneration) {
process();
}else {
log.debug("EntityID monitoring config generation disabled");
}
} catch (Throwable ex) {
log.error("Exception happened while monitoring EntityId", ex);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ private void regenerateConfigurationFiles() {
shibboleth3ConfService.generateConfigurationFiles(trustRelationships);

log.info("IDP config generation files finished. TR count: '{}'", trustRelationships.size());
}else {
log.debug("Shibboleth config generation disabled");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import javax.inject.Inject;
import javax.inject.Named;

import org.gluu.config.oxtrust.AppConfiguration;
import org.gluu.oxtrust.service.cdi.event.TranscodingRulesUpdateEvent;
import org.gluu.service.cdi.async.Asynchronous;
import org.gluu.service.cdi.event.Scheduled;
Expand All @@ -30,6 +31,9 @@ public class TranscodingRulesUpdater implements Serializable {
@Inject
private Logger log;

@Inject
private AppConfiguration appConfiguration;

@Inject
private Event<TimerEvent> timerEvent;

Expand Down Expand Up @@ -73,6 +77,12 @@ public void processTranscodingRulesUpdateEvent(@Observes @Scheduled TranscodingR

private void processTranscodingRulesUpdate() {

if(appConfiguration.isConfigGeneration() == false) {

log.debug("Shibboleth configuration generation disabled");
return;
}

log.debug("Start shibboleth transcoding rules update");
if(!shibbolethConfService.generateGluuAttributeRulesFile()) {
log.error("Shibboleth transcoding rules update failed. (Please restart service manually)");
Expand Down

0 comments on commit 6751499

Please sign in to comment.