Class EvaluateDelegationPolicy

    • Field Detail

      • log

        @Nonnull
        private org.slf4j.Logger log
        Logger.
      • policyMaxChainLengthStrategy

        @Nonnull
        private Function<ProfileRequestContext,​Long> policyMaxChainLengthStrategy
        Function used to resolve the policy maximum delegation chain length.
      • assertionToken

        private Assertion assertionToken
        The inbound delegated assertion token being evaluated.
      • policyMaxChainLength

        private Long policyMaxChainLength
        The policy maximum token delegation chain length.
      • tokenChainLength

        private Long tokenChainLength
        The actual token delegation chain length.
      • delegationAllowed

        private boolean delegationAllowed
        Whether the request is allowed to proceed.
    • Constructor Detail

      • EvaluateDelegationPolicy

        public EvaluateDelegationPolicy()
        Constructor.
    • Method Detail

      • setPolicyMaxChainLengthStrategy

        public void setPolicyMaxChainLengthStrategy​(@Nonnull
                                                    Function<ProfileRequestContext,​Long> strategy)
        Set the strategy used to resolve the policy maximum delegation chain length.
        Parameters:
        strategy - the strategy
      • setAssertionTokenStrategy

        public void setAssertionTokenStrategy​(@Nonnull
                                              Function<ProfileRequestContext,​Assertion> strategy)
        Set the strategy used to locate the inbound assertion token to process.
        Parameters:
        strategy - lookup strategy
      • doPreExecuteInbound

        protected boolean doPreExecuteInbound​(@Nonnull
                                              ProfileRequestContext profileRequestContext)
        Pre-execute actions on the inbound message.
        Parameters:
        profileRequestContext - the current profile request context
        Returns:
        true iff doExecute(ProfileRequestContext) should proceed
      • doPreExecuteRelyingParty

        protected boolean doPreExecuteRelyingParty​(@Nonnull
                                                   ProfileRequestContext profileRequestContext)
        Pre-execute actions on the relying party context info.
        Parameters:
        profileRequestContext - the current profile request context
        Returns:
        true iff doExecute(ProfileRequestContext) should proceed
      • checkAllowedDelegate

        protected boolean checkAllowedDelegate​(@Nonnull
                                               ProfileRequestContext profileRequestContext)
        Apply policy control.
        Parameters:
        profileRequestContext - the current request context
        Returns:
        true if check passes, false if not
      • checkTokenDelegationChainLength

        protected boolean checkTokenDelegationChainLength​(@Nonnull
                                                          ProfileRequestContext profileRequestContext)
        Apply policy control which checks the actual token chain length against the policy maximum chain length.
        Parameters:
        profileRequestContext - the current request context
        Returns:
        true if check passes, false if not
      • getTokenDelegationChainLength

        protected Long getTokenDelegationChainLength​(@Nonnull
                                                     Assertion token)
        Get the length of the delegation chain in the presented token.
        Parameters:
        token - the token to evaluate
        Returns:
        the token delegation chain length
      • getDelegationRestrictionCondition

        protected DelegationRestrictionType getDelegationRestrictionCondition​(@Nullable
                                                                              Conditions conditions)
        Get the DelegationRestrictionType Condition from the supplied Conditions, if present.
        Parameters:
        conditions - the Assertion Conditions to process
        Returns:
        the DelegationRestrictionType Condition object, or null if not present
      • getPolicyMaxDelegationChainLength

        @Nonnull
        protected Long getPolicyMaxDelegationChainLength​(@Nonnull
                                                         ProfileRequestContext profileRequestContext)
        Get the effective maximum delegation chain length allowed by policy.
        Parameters:
        profileRequestContext - the current request context
        Returns:
        the policy max delegation chain policy length