<commit_before>package ua.sernikov.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;
import ua.sernikov.domain.Application;
import ua.sernikov.domain.NewApplicationRequest;
import ua.sernikov.service.ApplicationService;

import javax.validation.Valid;
import java.util.List;

@RestController
@RequestMapping(value = "/applications",
        consumes = MediaType.APPLICATION_JSON_UTF8_VALUE,
        produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class ApplicationController {

    private ApplicationService applicationService;

    @Autowired
    public ApplicationController(ApplicationService applicationService) {
        this.applicationService = applicationService;
    }

    @RequestMapping(method = RequestMethod.GET)
    public List<Application> getAllApplications() {
        return applicationService.getAllApplications();
    }

    @RequestMapping(method = RequestMethod.GET, params = "publisherKey")
    public List<Application> getAllPublisherApplications(@RequestParam String publisherKey) {
        Assert.hasText(publisherKey);
        return applicationService.getAllPublisherApplications(publisherKey);
    }
<commit_msg>Secured Applications endpoint to view all applications for any Operator<commit_after>package ua.sernikov.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.security.access.annotation.Secured;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;
import ua.sernikov.domain.Application;
import ua.sernikov.domain.NewApplicationRequest;
import ua.sernikov.service.ApplicationService;

import javax.validation.Valid;
import java.util.List;

@RestController
@RequestMapping(value = "/applications",
        consumes = MediaType.APPLICATION_JSON_UTF8_VALUE,
        produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class ApplicationController {

    private ApplicationService applicationService;

    @Autowired
    public ApplicationController(ApplicationService applicationService) {
        this.applicationService = applicationService;
    }

    @Secured("ROLE_OPERATOR")
    @RequestMapping(method = RequestMethod.GET)
    public List<Application> getAllApplications() {
        return applicationService.getAllApplications();
    }

    @RequestMapping(method = RequestMethod.GET, params = "publisherKey")
    public List<Application> getAllPublisherApplications(@RequestParam String publisherKey) {
        Assert.hasText(publisherKey);
        return applicationService.getAllPublisherApplications(publisherKey);
    }

{'fraction_non_alphanumeric': 0.08186080057699242, 'fraction_numerical': 0.00144248106743599, 'mean_word_length': 5.362385321100917, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '680272', 'n_tokens_mistral': 720, 'n_tokens_neox': 699, 'n_words': 128}