<commit_before>package com.atlassian.sal.core.auth;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.atlassian.oauth.Authenticator;
import com.atlassian.oauth.spi.AuthenticationListener;
import com.atlassian.seraph.auth.DefaultAuthenticator;
import com.atlassian.seraph.filter.BaseLoginFilter;

public class SeraphAuthenticationListener implements AuthenticationListener
{
    public void authenticationSuccess(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)
    {
        request.getSession().setAttribute(DefaultAuthenticator.LOGGED_IN_KEY, result.getUser());
        request.getSession().setAttribute(DefaultAuthenticator.LOGGED_OUT_KEY, null);
        request.setAttribute(BaseLoginFilter.OS_AUTHSTATUS_KEY, BaseLoginFilter.LOGIN_SUCCESS);
    }

    public void authenticationError(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)
    {
    }

    public void authenticationFailure(Authenticator.Result result, HttpServletRequest request, HttpServletResponse response)
    {
    }

    public void authenticationNotAttempted(HttpServletRequest request, HttpServletResponse response)
    {
    }
}<commit_msg>SAL-30, SAL-31 Moving AuthenticationController, AuthenticationListener, and UserResolver from OAuth plugin into SAL<commit_after>package com.atlassian.sal.core.auth;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.atlassian.sal.api.auth.AuthenticationListener;
import com.atlassian.sal.api.auth.Authenticator;
import com.atlassian.seraph.auth.DefaultAuthenticator;
import com.atlassian.seraph.filter.BaseLoginFilter;

public class SeraphAuthenticationListener implements AuthenticationListener
{
    public void authenticationSuccess(final Authenticator.Result result, final HttpServletRequest request, final HttpServletResponse response)
    {
        request.getSession().setAttribute(DefaultAuthenticator.LOGGED_IN_KEY, result.getPrincipal());
        request.getSession().setAttribute(DefaultAuthenticator.LOGGED_OUT_KEY, null);
        request.setAttribute(BaseLoginFilter.OS_AUTHSTATUS_KEY, BaseLoginFilter.LOGIN_SUCCESS);
    }

    public void authenticationError(final Authenticator.Result result, final HttpServletRequest request, final HttpServletResponse response)
    {
    }

    public void authenticationFailure(final Authenticator.Result result, final HttpServletRequest request, final HttpServletResponse response)
    {
    }

    public void authenticationNotAttempted(final HttpServletRequest request, final HttpServletResponse response)
    {
    }
}
{'fraction_non_alphanumeric': 0.07097497198356369, 'fraction_numerical': 0.0014942099364960778, 'mean_word_length': 5.902061855670103, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5531556', 'n_tokens_mistral': 692, 'n_tokens_neox': 687, 'n_words': 132}