<commit_before>package fr.insee.pogues.webservice.rest;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.apache.http.HttpStatus;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.json.simple.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@Component
@Path("/")
@Tag(name = "Pogues Public Resources")
public class PublicResources {
	
	final static Logger logger = LogManager.getLogger(PublicResources.class);
	
	@Value("${fr.insee.pogues.authentication}")
    String authentificationType;
	
	@Value("${fr.insee.pogues.search.disable}")
	boolean isSearchDisable;
	
	@GET
	@Path("/init")
	@Produces(MediaType.APPLICATION_JSON)
	@Operation(operationId = "getInit", summary = "Initial properties")
	public Response getProperties() throws Exception {
		JSONObject props = new JSONObject();
		try {
			props.put("authType", authentificationType);
			props.put("isSearchDisable", isSearchDisable);<commit_msg>Defines a default value for disabling search feature in UI<commit_after>package fr.insee.pogues.webservice.rest;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.apache.http.HttpStatus;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.json.simple.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@Component
@Path("/")
@Tag(name = "Pogues Public Resources")
public class PublicResources {
	
	final static Logger logger = LogManager.getLogger(PublicResources.class);
	
	@Value("${fr.insee.pogues.authentication}")
    String authentificationType;
	
	@Value("${fr.insee.pogues.search.disable:false}")
	boolean isSearchDisable;
	
	@GET
	@Path("/init")
	@Produces(MediaType.APPLICATION_JSON)
	@Operation(operationId = "getInit", summary = "Initial properties")
	public Response getProperties() throws Exception {
		JSONObject props = new JSONObject();
		try {
			props.put("authType", authentificationType);
			props.put("isSearchDisable", isSearchDisable);
{'fraction_non_alphanumeric': 0.12744706352377147, 'fraction_numerical': 0.0031961646024770275, 'mean_word_length': 5.767567567567568, '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': '6272391', 'n_tokens_mistral': 820, 'n_tokens_neox': 800, 'n_words': 148}