<commit_before>package org.opensingular.server.p.commons.spring.security;


import org.opensingular.lib.support.spring.util.AutoScanDisabled;
import org.opensingular.server.commons.auth.AdminCredentialChecker;
import org.opensingular.server.commons.auth.AdministrationAuthenticationProvider;
import org.opensingular.server.commons.config.IServerContext;
import org.opensingular.server.commons.spring.security.config.cas.SingularCASSpringSecurityConfig;
import org.opensingular.server.p.commons.config.PServerContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

import javax.inject.Inject;

public class SecurityConfigs {

    @AutoScanDisabled
    @Configuration
    @EnableWebMvc
    @Order(103)
    public static class CASPeticionamento extends SingularCASSpringSecurityConfig {
        @Override
        protected IServerContext getContext() {
            return PServerContext.PETITION;
        }

        @Override
        public String getCASLogoutURL() {
            return "";
        }
    }

    @AutoScanDisabled
    @Configuration
    @EnableWebMvc
    @Order(104)
    public static class CASAnalise extends SingularCASSpringSecurityConfig {
        @Override
        protected IServerContext getContext() {
            return PServerContext.WORKLIST;
        }

        @Override
        public String getCASLogoutURL() {
            return "";
        }
    }

    @AutoScanDisabled
    @Configuration
    @EnableWebMvc
    @Order(105)
    public static class AdministrationSecuriry extends WebSecurityConfigurerAdapter {

        @Inject
        private AdminCredentialChecker credentialChecker;

        @Override
        protected void configure(HttpSecurity http) throws Exception {
            http
                    .authorizeRequests()
                    .antMatchers("/").permitAll()
                    .anyRequest().authenticated()
                    .and()
                    .csrf().disable()
                    .httpBasic();
        }

        @Override
        protected void configure(AuthenticationManagerBuilder auth) throws Exception {
            auth.authenticationProvider(new AdministrationAuthenticationProvider(credentialChecker, PServerContext.ADMINISTRATION));
        }

    }

}<commit_msg>corrigindo antmatcher<commit_after>package org.opensingular.server.p.commons.spring.security;


import org.opensingular.lib.support.spring.util.AutoScanDisabled;
import org.opensingular.server.commons.auth.AdminCredentialChecker;
import org.opensingular.server.commons.auth.AdministrationAuthenticationProvider;
import org.opensingular.server.commons.config.IServerContext;
import org.opensingular.server.commons.spring.security.config.cas.SingularCASSpringSecurityConfig;
import org.opensingular.server.p.commons.config.PServerContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

import javax.inject.Inject;

public class SecurityConfigs {

    @AutoScanDisabled
    @Configuration
    @EnableWebMvc
    @Order(103)
    public static class CASPeticionamento extends SingularCASSpringSecurityConfig {
        @Override
        protected IServerContext getContext() {
            return PServerContext.PETITION;
        }

        @Override
        public String getCASLogoutURL() {
            return "";
        }
    }

    @AutoScanDisabled
    @Configuration
    @EnableWebMvc
    @Order(104)
    public static class CASAnalise extends SingularCASSpringSecurityConfig {
        @Override
        protected IServerContext getContext() {
            return PServerContext.WORKLIST;
        }

        @Override
        public String getCASLogoutURL() {
            return "";
        }
    }

    @AutoScanDisabled
    @Configuration
    @EnableWebMvc
    @Order(105)
    public static class AdministrationSecuriry extends WebSecurityConfigurerAdapter {

        @Inject
        private AdminCredentialChecker credentialChecker;

        @Override
        protected void configure(HttpSecurity http) throws Exception {
            http
                    .authorizeRequests()
                    .antMatchers("/administration").permitAll()
                    .anyRequest().authenticated()
                    .and()
                    .csrf().disable()
                    .httpBasic();
        }

        @Override
        protected void configure(AuthenticationManagerBuilder auth) throws Exception {
            auth.authenticationProvider(new AdministrationAuthenticationProvider(credentialChecker, PServerContext.ADMINISTRATION));
        }

    }

}
{'fraction_non_alphanumeric': 0.0754012691302725, 'fraction_numerical': 0.0033594624860022394, 'mean_word_length': 3.0414781297134237, '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': '1701296', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1295, 'n_words': 223}