Class LoopDetectionPredicate
java.lang.Object
net.shibboleth.profile.context.logic.AbstractRelyingPartyPredicate
net.shibboleth.profile.context.logic.LoopDetectionPredicate
- All Implemented Interfaces:
Predicate<ProfileRequestContext>
A condition that relies on a
Meter to detect looping SPs.- Since:
- 4.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classDefault tag generator that hashes the RP ID. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Predicate<ProfileRequestContext>Generalized condition in place of dedicated map.private final org.slf4j.LoggerClass logger.private final com.codahale.metrics.MetricRegistryPrivate registry to isolate timers.Map of RP names to meter names.private Function<ProfileRequestContext,String> Used with generalized condition to compute name to use in loop metric.private longCount to trigger warning.private Function<ProfileRequestContext,String> Lookup strategy to obtain subject name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetActivationCondition(Predicate<ProfileRequestContext> condition) Sets a generalized activation condition to apply in addition to the hardcoded map of RPs.voidsetRelyingPartyMap(Map<String, String> map) Set the map of relying party names to meter names to track counts.voidSets a generalized tag generation strategy to produce the loop detection metric name.voidsetThreshold(long value) Set the warning threshold for the 1 minute moving average to exceed.voidSet lookup strategy to obtain username.booleantest(ProfileRequestContext input) Methods inherited from class net.shibboleth.profile.context.logic.AbstractRelyingPartyPredicate
getRelyingPartyContext, getRelyingPartyContextLookupStrategy, setRelyingPartyContextLookupStrategy
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
privateRegistry
@Nonnull private final com.codahale.metrics.MetricRegistry privateRegistryPrivate registry to isolate timers. -
threshold
private long thresholdCount to trigger warning. -
relyingPartyMap
Map of RP names to meter names. -
activationCondition
Generalized condition in place of dedicated map. -
tagGenerationStrategy
Used with generalized condition to compute name to use in loop metric. -
usernameLookupStrategy
Lookup strategy to obtain subject name.
-
-
Constructor Details
-
LoopDetectionPredicate
Constructor.- Throws:
NoSuchAlgorithmException- if unable to create digester
-
-
Method Details
-
setThreshold
Set the warning threshold for the 1 minute moving average to exceed.Defaults to 20.
- Parameters:
value- threshold to use
-
setRelyingPartyMap
Set the map of relying party names to meter names to track counts.- Parameters:
map- map of RP/meter mappings
-
setUsernameLookupStrategy
Set lookup strategy to obtain username.- Parameters:
strategy- lookup strategy
-
setActivationCondition
Sets a generalized activation condition to apply in addition to the hardcoded map of RPs.Defaults to false.
- Parameters:
condition- condition to set- Since:
- 5.2.0
-
setTagGenerationStrategy
Sets a generalized tag generation strategy to produce the loop detection metric name.Defaults to the SHA-1 hash of the RP name.
- Parameters:
strategy- function to produce metric name- Since:
- 5.2.0
-
test
-