<commit_before>package org.onetwo.boot.module.oauth2;

import java.util.Map;

import lombok.Data;

import org.springframework.boot.context.properties.ConfigurationProperties;

import com.google.common.collect.Maps;

/**
 * @author wayshall
 * <br/>
 */
@Data
@ConfigurationProperties(prefix=JFishOauth2Properties.CONFIG_PREFIX)
public class JFishOauth2Properties {
	public static final String CONFIG_PREFIX = "jfish.oauth2";
	public static final String TOKEN_STORE_ENABLED_KEY = CONFIG_PREFIX + ".tokenStore";
	
	public static final String KEYS_REDIS = "redis";
	public static final String KEYS_JDBC = "jdbc";
	public static final String KEYS_JWT = "jwt";
	public static final String KEYS_IN_MEMORY = "in_memory";
	
	
	/****
	 * auth server
	 */
	AuthorizationServerProps authorizationServer = new AuthorizationServerProps();
	ResourceServerProps resourceServer = new ResourceServerProps();
	JwtProps jwt = new JwtProps();
	
	@Data
	public static class JwtProps {
		String signingKey;
	}
	
	@Data
	public static class AuthorizationServerProps {
		boolean allowFormAuthenticationForClients;
		boolean sslOnly;<commit_msg>增加oauth2注释<commit_after>package org.onetwo.boot.module.oauth2;

import java.util.Map;

import lombok.Data;

import org.springframework.boot.context.properties.ConfigurationProperties;

import com.google.common.collect.Maps;

/**
 * 统一在网关验证授权，因此后端的api项目除了需要获取auth2而配置tokenStore外，
 * 一般可把security简单配置为：
 * security: 
   		ignored: /**
 * @author wayshall
 * <br/>
 */
@Data
@ConfigurationProperties(prefix=JFishOauth2Properties.CONFIG_PREFIX)
public class JFishOauth2Properties {
	public static final String CONFIG_PREFIX = "jfish.oauth2";
	public static final String TOKEN_STORE_ENABLED_KEY = CONFIG_PREFIX + ".tokenStore";
	
	public static final String KEYS_REDIS = "redis";
	public static final String KEYS_JDBC = "jdbc";
	public static final String KEYS_JWT = "jwt";
	public static final String KEYS_IN_MEMORY = "in_memory";
	
	
	/****
	 * auth server
	 * oauth2认证security的拦截器链，所以当auth server项目里有其它不需要验证的rest api时，
	 * 不能简单地配置为： 
	 * security: 
			ignored: /**
			
	 要手动配置需要忽略的api路径，如：
	 security:
	 		ignored: /swagger**, /api/**
	 		
	   也可以把security的相关配置disabled：
	    management: 
		    security: 
		        enabled: false
		security: 
		    basic: 
		        enabled: false
	 */
	AuthorizationServerProps authorizationServer = new AuthorizationServerProps();
	ResourceServerProps resourceServer = new ResourceServerProps();
	JwtProps jwt = new JwtProps();
	
	@Data
	public static class JwtProps {
		String signingKey;
	}
	
	@Data
	public static class AuthorizationServerProps {
		boolean allowFormAuthenticationForClients;
		boolean sslOnly;
{'fraction_non_alphanumeric': 0.08808095952023988, 'fraction_numerical': 0.004122938530734633, 'mean_word_length': 4.727467811158799, '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': '3407452', 'n_tokens_mistral': 935, 'n_tokens_neox': 894, 'n_words': 193}