/** * Get the function to run to determine the next subflow to run. * * @param event the event to transition from * * @return flow determination strategy */ @Nonnull public Function<ProfileRequestContext,String> getNextFlowStrategy(@Nonnull @NotEmpty final String event) { if (nextFlowStrategyMap.containsKey(event)) { return nextFlowStrategyMap.get(event); } else { return FunctionSupport.constant(null); } }
/** * Set the default authentication methods to use, expressed as custom principals. * * @param methods default authentication methods to use */ public void setDefaultAuthenticationMethods( @Nullable @NonnullElements final Collection<Principal> methods) { if (methods != null) { defaultAuthenticationMethodsLookupStrategy = FunctionSupport.constant( (Collection<Principal>) new ArrayList<>(Collections2.filter(methods, Predicates.notNull()))); } else { defaultAuthenticationMethodsLookupStrategy = null; } }
/** * Set the authentication flows to use. * * @param flows flow identifiers to use */ public void setAuthenticationFlows(@Nullable @NonnullElements final Collection<String> flows) { if (flows != null) { authenticationFlowsLookupStrategy = FunctionSupport.<ProfileRequestContext,Set<String>>constant( new HashSet<>(StringSupport.normalizeStringCollection(flows))); } else { authenticationFlowsLookupStrategy = null; } }
/** * Set the ordered collection of post-authentication interceptor flows to enable. * * @param flows flow identifiers to enable */ public void setPostAuthenticationFlows(@Nullable @NonnullElements final Collection<String> flows) { if (flows != null) { postAuthenticationFlowsLookupStrategy = FunctionSupport.<ProfileRequestContext,Collection<String>>constant( new ArrayList<>(StringSupport.normalizeStringCollection(flows))); } else { postAuthenticationFlowsLookupStrategy = null; } }
/** * Set DuoIntegration details to use directly. * * @param duo Duo integration details */ public void setDuoIntegration(@Nonnull final DuoIntegration duo) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); Constraint.isNotNull(duo, "DuoIntegration cannot be null"); duoIntegrationLookupStrategy = FunctionSupport.constant(duo); }
/** * Set DuoIntegration details to use directly. * * @param duo Duo integration details */ public void setDuoIntegration(@Nonnull final DuoIntegration duo) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); Constraint.isNotNull(duo, "DuoIntegration cannot be null"); duoIntegrationLookupStrategy = FunctionSupport.constant(duo); }
/** * Set resource. * * @param res resource */ public void setResource(@Nullable final String res) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); resourceLookupStrategy = FunctionSupport.constant(StringSupport.trimOrNull(res)); }
/** * Set operation. * * @param op operation */ public void setOperation(@Nullable final String op) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); operationLookupStrategy = FunctionSupport.constant(StringSupport.trimOrNull(op)); }
/** Constructor. */ public ValidateDuoWebResponse() { duoIntegrationLookupStrategy = FunctionSupport.constant(null); usernameLookupStrategy = new CanonicalUsernameLookupStrategy(); setMetricName(DEFAULT_METRIC_NAME); }
/** Constructor. */ public ValidateDuoAuthAPI() { duoIntegrationLookupStrategy = FunctionSupport.constant(null); usernameLookupStrategy = new CanonicalUsernameLookupStrategy(); setMetricName(DEFAULT_METRIC_NAME); }
/** * Set an explicit access control policy name to apply. * * @param name policy name */ public void setPolicyName(@Nonnull @NotEmpty final String name) { policyNameLookupStrategy = FunctionSupport.constant( Constraint.isNotNull(StringSupport.trimOrNull(name), "Policy name cannot be null or empty")); }
if (flowId != null) { nextFlowStrategyMap.put(trimmed, FunctionSupport.<ProfileRequestContext,String>constant(flowId));
/** * Set the attribute IDs to pass into the resolver. * * @param attributeIds attribute ID collection */ public void setAttributesToResolve(@Nonnull @NonnullElements final Collection<String> attributeIds) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); Constraint.isNotNull(attributeIds, "Attribute ID collection cannot be null"); attributesLookupStrategy = FunctionSupport.<ProfileRequestContext,Collection<String>>constant( StringSupport.normalizeStringCollection(attributeIds)); }
/** * Set an explicit policy name to apply. * * @param name policy name */ public void setPolicyName(@Nonnull @NotEmpty final String name) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); policyNameLookupStrategy = FunctionSupport.constant( Constraint.isNotNull(StringSupport.trimOrNull(name), "Policy name cannot be null or empty")); }
/** * Set the maximum failed attempts within window. * * <p>Defaults to 5.</p> * * @param attempts maximum failed attempts */ public void setMaxAttempts(@Positive final int attempts) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); maxAttemptsLookupStrategy = FunctionSupport.constant( (int) Constraint.isGreaterThan(0, attempts, "Attempts must be greater than zero")); }
/** Constructor. */ public AbstractEncryptAction() { encryptionCtxLookupStrategy = Functions.compose(new ChildContextLookup<>(EncryptionContext.class), new OutboundMessageContextLookup()); keyPlacementLookupStrategy = FunctionSupport.<ProfileRequestContext,KeyPlacement>constant(KeyPlacement.INLINE); encryptToSelf = Predicates.alwaysFalse(); }
/** Constructor. */ PopulateMultiFactorAuthenticationContext() { transitionMapLookupStrategy = FunctionSupport.constant(null); multiFactorContextCreationStrategy = Functions.compose( new ChildContextLookup(MultiFactorAuthenticationContext.class, true), new ChildContextLookup(AuthenticationContext.class)); activeResultLookupStrategy = new DefaultResultLookupStrategy(); }
/** * Constructor. * * @param id profile Id */ public BasicAdministrativeFlowDescriptor(@Nonnull @NotEmpty @ParameterName(name="id") final String id) { super(id); supportsNonBrowserPredicate = Predicates.alwaysTrue(); authenticatedPredicate = Predicates.alwaysFalse(); policyNameLookupStrategy = FunctionSupport.constant(null); resolveAttributesPredicate = Predicates.alwaysFalse(); builderFactory = XMLObjectProviderRegistrySupport.getBuilderFactory(); uiInfo = ((SAMLObjectBuilder<UIInfo>) builderFactory.<UIInfo>getBuilderOrThrow( UIInfo.DEFAULT_ELEMENT_NAME)).buildObject(); }
/** * Set interval after which counter is reset. * * <p>Defaults to 5 minutes.</p> * * @param window counter window */ @Duration public void setCounterInterval(@Duration @Positive final long window) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); counterIntervalLookupStrategy = FunctionSupport.constant( Constraint.isGreaterThan(0, window, "Counter interval must be greater than 0")); }