Skip to content

Commit f8b9276

Browse files
committed
adding a log output for every authorization check
1 parent cfd5a62 commit f8b9276

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/org/opensolaris/opengrok/authorization/AuthorizationFramework.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,11 +617,20 @@ private boolean checkAll(HttpServletRequest request, String cache, Nameable enti
617617

618618
private boolean performCheck(Nameable entity, Predicate<AuthorizationPluginWrapper> predicate) {
619619
boolean overallDecision = true;
620+
LOGGER.log(Level.FINEST, "Authorization for \"{0}\"",
621+
new Object[]{entity.getName()});
620622
for (AuthorizationPluginWrapper plugin : getPlugins()) {
621623
// run the plugin's test method
622624
try {
625+
LOGGER.log(Level.FINEST, "Plugin \"{0}\" [{1}] testing a name \"{2}\"",
626+
new Object[]{plugin.getClassname(), plugin.getRole(), entity.getName()});
627+
623628
boolean pluginDecision = predicate.test(plugin);
624629

630+
LOGGER.log(Level.FINEST, "Plugin \"{0}\" [{1}] testing a name \"{2}\" => {3}",
631+
new Object[]{plugin.getClassname(), plugin.getRole(), entity.getName(),
632+
pluginDecision ? "true" : "false"});
633+
625634
if (!pluginDecision && plugin.isRequired()) {
626635
// required sets a failure but still invokes all other plugins
627636
overallDecision = false;
@@ -642,6 +651,10 @@ private boolean performCheck(Nameable entity, Predicate<AuthorizationPluginWrapp
642651
entity.getName()),
643652
ex);
644653

654+
LOGGER.log(Level.FINEST, "Plugin \"{0}\" [{1}] testing a name \"{2}\" => {3}",
655+
new Object[]{plugin.getClassname(), plugin.getRole(), entity.getName(),
656+
"false (failed)"});
657+
645658
// set the return value to false for this faulty plugin
646659
if (!plugin.isSufficient()) {
647660
overallDecision = false;
@@ -652,6 +665,8 @@ private boolean performCheck(Nameable entity, Predicate<AuthorizationPluginWrapp
652665
}
653666
}
654667
}
668+
LOGGER.log(Level.FINEST, "Authorization for \"{0}\" => {1}",
669+
new Object[]{entity.getName(), overallDecision ? "true" : "false"});
655670
return overallDecision;
656671
}
657672
}

0 commit comments

Comments
 (0)