Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OK-611 laskennan rinnakkaistaminen #215

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9b0f7da
OK-611 Siirretty lähtötietojen lataus koostepalveluun
jkorri Oct 28, 2024
5c5c6fb
OK-611 Poistettu valintalaskennan käynnistämiseen liittyvä toiminnall…
jkorri Oct 28, 2024
f39cb6c
OK-611 Tallennetaan sessiot kantaan
jkorri Oct 29, 2024
7f5f6f9
OK-611 Parannettu lähtötietojen haun virheenkäsittelyä
jkorri Nov 4, 2024
bafbf2f
OK-611 Tallennetaan resurssihakujen kestot
jkorri Nov 5, 2024
c3cdd1d
OK-611 Muutettu valintalaskennan lähtötietojen haun timeouttia
jkorri Nov 5, 2024
8a84514
OK-611 Säädetty timeouttia
jkorri Nov 5, 2024
017ea70
OK-611 Ei haeta lähtötietoja hakukohteille joissa laskenta ei käytössä
jkorri Nov 6, 2024
d3aa591
OK-611 Rajoitetaan tilapäisesti valintaperusteisiin tehtävien kutsuje…
jkorri Nov 6, 2024
39acd41
OK-611 Rajoitetaan SURE-kutsujen rinnakkaisuutta tilapäisesti
jkorri Nov 7, 2024
d2b69eb
OK-611 Lisätty resurssien haun kesto
jkorri Nov 7, 2024
6c32989
OK-611 Lokitetaan oppijoiden määrä
jkorri Nov 7, 2024
6574dbc
OK-611 Lisätty hienojakoisempi rinnakkaisuuden rajoitus
jkorri Nov 7, 2024
14566be
OK-611 Parannettu virheiden lokitusta
jkorri Nov 12, 2024
5de720e
OK-611 Pusketaan metriikkaa CloudWatchiin
jkorri Nov 18, 2024
acbe451
OK-611 Lisätty määrät myös valintaperusteille ja suorituksille
jkorri Nov 20, 2024
76010a9
OK-611 Rajoitettu yhtäaikaisia ataru-kutsuja
jkorri Nov 21, 2024
ea1de46
OK-611 Rajoitetaan SURE-hakujen rinnakkaisuutta
jkorri Nov 21, 2024
88fbc67
OK-611 Ei tueta hakuappia laskennan lähtötietojen haussa
jkorri Nov 20, 2024
9df5e6c
OK-611 Lokitetaan lähtötietojen haun alku ja loppu
jkorri Nov 21, 2024
f521ffc
OK-611 Poistettu käyttämätön metodi ValintaperusteetAsyncResource-luo…
jkorri Nov 22, 2024
7ceff44
OK-611 Luetaan ratelimitterin konfiguraatiot kannasta
jkorri Nov 25, 2024
6266569
OK-611 Refaktoroitu metriikoita
jkorri Nov 25, 2024
f60e38e
OK-611 Siirretty ConcurrencyLimiter omaan luokkaan
jkorri Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-jdbc</artifactId>
</dependency>

<!-- Sade -->
<dependency>
Expand Down Expand Up @@ -445,9 +449,9 @@
<version>1.16</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-slf4j_2.11</artifactId>
<version>2.5.31</version>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.11.12</version>
</dependency>

<!-- REST, Json -->
Expand Down Expand Up @@ -516,6 +520,12 @@
<version>9.22.3</version>
</dependency>

<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>cloudwatch</artifactId>
<version>2.20.162</version>
</dependency>

<!-- Tests -->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -609,16 +619,15 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_2.11</artifactId>
<version>2.5.31</version>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.20.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.19.0</version>
<scope>test</scope>
<artifactId>localstack</artifactId>
<version>1.20.3</version>
</dependency>
</dependencies>

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/fi/vm/sade/valinta/kooste/App.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package fi.vm.sade.valinta.kooste;

import java.io.*;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, MongoAutoConfiguration.class})
@EnableScheduling
public class App {

public static final String CONTEXT_PATH = "/valintalaskentakoostepalvelu";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package fi.vm.sade.valinta.kooste.configuration;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Arrays;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.cloudwatch.CloudWatchClient;
import software.amazon.awssdk.services.cloudwatch.CloudWatchClientBuilder;

@Configuration
public class AwsConfiguration {

@Bean
public CloudWatchClient cloudWatchClient(Environment environment) throws URISyntaxException {
boolean isLocal =
Arrays.stream(environment.getActiveProfiles())
.anyMatch(
env ->
(env.equalsIgnoreCase("test")
|| env.equalsIgnoreCase("mockservices")
|| env.equalsIgnoreCase("dev")));

CloudWatchClientBuilder builder =
CloudWatchClient.builder().credentialsProvider(DefaultCredentialsProvider.create());

if (isLocal) {
builder
.region(Region.US_EAST_1)
.endpointOverride(new URI("http://localhost:" + System.getProperty("localstackPort")));
}

return builder.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.session.jdbc.config.annotation.web.http.EnableJdbcHttpSession;
import org.springframework.session.web.http.CookieSerializer;
import org.springframework.session.web.http.DefaultCookieSerializer;

@Profile({"default", "dev"})
@Configuration
@Order(2)
@EnableMethodSecurity(securedEnabled = true)
@EnableWebSecurity
@EnableJdbcHttpSession
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
private Environment environment;

Expand Down Expand Up @@ -152,4 +156,14 @@ protected void configure(HttpSecurity http) throws Exception {
protected void configure(AuthenticationManagerBuilder auth) {
auth.authenticationProvider(casAuthenticationProvider());
}

@Bean
public CookieSerializer cookieSerializer() {
DefaultCookieSerializer serializer = new DefaultCookieSerializer();
serializer.setUseSecureCookie(true);
serializer.setCookieName("JSESSIONID");
serializer.setCookiePath("/valintalaskentakoostepalvelu");
serializer.setUseBase64Encoding(false);
return serializer;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ public RestCasClient getSuoritusrekisteriCasClient(
return new RestCasClient(
new CasConfig.CasConfigBuilder(
username, password, ticketsUrl, service, CSRF_VALUE, CALLER_ID, "")
.setNumberOfRetries(0)
.setJsessionName("JSESSIONID")
.build());
}
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading