<commit_before>/**
 *   Copyright 2015 Tikal-Technology
 *
 *Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License
 */
package technology.tikal.gae.system.security.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;
import org.springframework.security.core.userdetails.UserDetails;

import technology.tikal.gae.security.model.InternalGrantedAuthority;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.googlecode.objectify.annotation.Cache;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;

/**
 * 
 * @author Nekorp
 *
 */
@Entity
@Cache
public class SystemUser implements UserDetails {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    @Id
    @Length(min=8, max=26)
    @Pattern(regexp="\\w*")
    private String username;
    
    @Length(min=8, max=26)
    @Pattern(regexp="\\w*")
    private String password;
    
    private List<InternalGrantedAuthority> authorities;
    
    private Boolean activo;
    
    private SystemUser() {
        authorities = new ArrayList<>();
    }
    
    public SystemUser(String username) {
        this();
        this.username = username;
    }
    
    @Override
    public String getUsername() {
        return username;
    }
    
    @Override
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    
    public Boolean getActivo() {
        return activo;<commit_msg>Mejoras Se actualiza la expresion regular para validar paswords de usuarios de sistema<commit_after>/**
 *   Copyright 2015 Tikal-Technology
 *
 *Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License
 */
package technology.tikal.gae.system.security.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;
import org.springframework.security.core.userdetails.UserDetails;

import technology.tikal.gae.security.model.InternalGrantedAuthority;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.googlecode.objectify.annotation.Cache;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;

/**
 * 
 * @author Nekorp
 *
 */
@Entity
@Cache
public class SystemUser implements UserDetails {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    @Id
    @Length(min=8, max=26)
    @Pattern(regexp="\\w*")
    private String username;
    
    @Length(min=8, max=26)
    @Pattern(regexp="[\\w\\!\\#$\\%\\&\\(\\)\\*\\+\\-\\.\\:\\;\\<\\=\\>\\?\\[\\]\\_\\{\\|\\}]*")
    private String password;
    
    private List<InternalGrantedAuthority> authorities;
    
    private Boolean activo;
    
    private SystemUser() {
        authorities = new ArrayList<>();
    }
    
    public SystemUser(String username) {
        this();
        this.username = username;
    }
    
    @Override
    public String getUsername() {
        return username;
    }
    
    @Override
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    
    public Boolean getActivo() {
        return activo;
{'fraction_non_alphanumeric': 0.10571300044984255, 'fraction_numerical': 0.006747638326585695, 'mean_word_length': 3.0317316409791477, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '2374620', 'n_tokens_mistral': 1296, 'n_tokens_neox': 1252, 'n_words': 359}