<commit_before>package org.apereo.cas.interrupt.webflow.actions;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apereo.cas.authentication.Authentication;
import org.apereo.cas.authentication.principal.Service;
import org.apereo.cas.interrupt.InterruptInquirer;
import org.apereo.cas.interrupt.InterruptResponse;
import org.apereo.cas.interrupt.webflow.InterruptUtils;
import org.apereo.cas.services.RegisteredService;
import org.apereo.cas.web.support.WebUtils;
import org.springframework.webflow.action.AbstractAction;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;

/**
 * This is {@link InquireInterruptAction}.
 *
 * @author <NAME>
 * @since 5.2.0
 */
@Slf4j
@RequiredArgsConstructor
public class InquireInterruptAction extends AbstractAction {
    private final InterruptInquirer interruptInquirer;

    @Override
    protected Event doExecute(final RequestContext requestContext) {
        final Authentication authentication = WebUtils.getAuthentication(requestContext);
        final Service service = WebUtils.getService(requestContext);
        final RegisteredService registeredService = WebUtils.getRegisteredService(requestContext);

        final InterruptResponse response = this.interruptInquirer.inquire(authentication, registeredService, service);
        if (response == null || !response.isInterrupt()) {
            return no();
        }
        InterruptUtils.putInterruptIn(requestContext, response);
        WebUtils.putPrincipal(requestContext, authentication.getPrincipal());
        return yes();
    }
}<commit_msg>pass along credential to interrupt<commit_after>package org.apereo.cas.interrupt.webflow.actions;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apereo.cas.authentication.Authentication;
import org.apereo.cas.authentication.Credential;
import org.apereo.cas.authentication.principal.Service;
import org.apereo.cas.interrupt.InterruptInquirer;
import org.apereo.cas.interrupt.InterruptResponse;
import org.apereo.cas.interrupt.webflow.InterruptUtils;
import org.apereo.cas.services.RegisteredService;
import org.apereo.cas.web.support.WebUtils;
import org.springframework.webflow.action.AbstractAction;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;

/**
 * This is {@link InquireInterruptAction}.
 *
 * @author <NAME>
 * @since 5.2.0
 */
@Slf4j
@RequiredArgsConstructor
public class InquireInterruptAction extends AbstractAction {
    private final InterruptInquirer interruptInquirer;

    @Override
    protected Event doExecute(final RequestContext requestContext) {
        final Authentication authentication = WebUtils.getAuthentication(requestContext);
        final Service service = WebUtils.getService(requestContext);
        final RegisteredService registeredService = WebUtils.getRegisteredService(requestContext);
        final Credential credential = WebUtils.getCredential(requestContext);

        final InterruptResponse response = this.interruptInquirer.inquire(authentication, registeredService, service, credential);
        if (response == null || !response.isInterrupt()) {
            return no();
        }
        InterruptUtils.putInterruptIn(requestContext, response);
        WebUtils.putPrincipal(requestContext, authentication.getPrincipal());
        return yes();
    }
}
{'fraction_non_alphanumeric': 0.09056712962962964, 'fraction_numerical': 0.003472222222222222, 'mean_word_length': 5.043706293706293, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5112875', 'n_tokens_mistral': 952, 'n_tokens_neox': 922, 'n_words': 173}