Skip to content

Commit 2662460

Browse files
committed
update to spring boot 2.3.4
1 parent cec5b3e commit 2662460

9 files changed

Lines changed: 23 additions & 22 deletions

File tree

build.gradle.kts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22
import org.springframework.boot.gradle.tasks.bundling.BootJar // for launchScript
33

44
plugins {
5-
id("org.springframework.boot") version "2.2.1.RELEASE"
6-
id("io.spring.dependency-management") version "1.0.8.RELEASE"
7-
id("com.gorylenko.gradle-git-properties") version "2.0.0"
5+
id("org.springframework.boot") version "2.3.4.RELEASE"
6+
id("io.spring.dependency-management") version "1.0.10.RELEASE"
7+
id("com.gorylenko.gradle-git-properties") version "2.2.3"
88
war
99
kotlin("jvm") version "1.4.0"
1010
kotlin("plugin.spring") version "1.4.0"
@@ -16,12 +16,6 @@ group = "ch.derlin.bbdata.api"
1616
version = "2.0.0-alpha"
1717
java.sourceCompatibility = JavaVersion.VERSION_1_8
1818

19-
val developmentOnly by configurations.creating
20-
configurations {
21-
runtimeClasspath {
22-
extendsFrom(developmentOnly)
23-
}
24-
}
2519

2620
repositories {
2721
mavenCentral()
@@ -33,6 +27,7 @@ springBoot {
3327

3428
dependencies {
3529
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
30+
implementation("org.springframework.boot:spring-boot-starter-validation")
3631
// NO HAL REST: implementation("org.springframework.boot:spring-boot-starter-data-rest")
3732
implementation("org.springframework.boot:spring-boot-starter-web")
3833
implementation("org.springframework.boot:spring-boot-starter-data-redis")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
5-
zipStorePath=wrapper/dists
5+
zipStorePath=wrapper/dists

src/main/kotlin/ch/derlin/bbdata/common/cassandra/CassandraStats.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package ch.derlin.bbdata.common.cassandra
22

3-
import com.datastax.driver.core.DataType
43
import com.fasterxml.jackson.annotation.JsonProperty
54
import org.joda.time.DateTime
65
import org.springframework.data.cassandra.core.mapping.CassandraType
@@ -34,11 +33,11 @@ data class ObjectStatsCounter(
3433

3534
@Column("n_reads")
3635
@get:JsonProperty("nReads")
37-
@CassandraType(type = DataType.Name.COUNTER)
36+
@CassandraType(type = CassandraType.Name.COUNTER)
3837
val nReads: Long = 0,
3938

4039
@Column("n_values")
4140
@get:JsonProperty("nValues")
42-
@CassandraType(type = DataType.Name.COUNTER)
41+
@CassandraType(type = CassandraType.Name.COUNTER)
4342
val nValues: Long = 0
4443
)

src/main/kotlin/ch/derlin/bbdata/output/api/apikeys/Apikey.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ data class Apikey(
2828
var userId: Int = 0,
2929

3030
@Column(name = "readonly")
31-
var isReadOnly: Boolean = false,
31+
var readOnly: Boolean = false,
3232

3333
@Column(name = "description")
3434
var description: String? = null

src/main/kotlin/ch/derlin/bbdata/output/api/apikeys/ApikeyController.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ApikeyController(
5858
if (optionalUserId.isPresent && apikeyRepository.canLogin(optionalUserId.get(), loginBody.password!!) > 0) {
5959
return apikeyRepository.saveAndFlush(Apikey(
6060
userId = optionalUserId.get(),
61-
isReadOnly = false,
61+
readOnly = false,
6262
description = AUTOLOGIN_DESCRIPTION,
6363
secret = TokenGenerator.generate(),
6464
expirationDate = DateTime().plus(AUTOLOGIN_EXPIRE)
@@ -93,7 +93,7 @@ class ApikeyController(
9393

9494
return apikeyRepository.saveAndFlush(Apikey(
9595
userId = userId,
96-
isReadOnly = !writable,
96+
readOnly = !writable,
9797
description = descriptionBean?.description,
9898
secret = TokenGenerator.generate(),
9999
expirationDate = rawExpire?.let { parseDateOrDuration(it) }
@@ -113,7 +113,7 @@ class ApikeyController(
113113
val apikey = apikeyRepository.findByIdAndUserId(id, userId).orElseThrow { ItemNotFoundException("apikey (id=$id)") }
114114

115115
bean.expirationDate?.let { apikey.expirationDate = parseDateOrDuration(it) }
116-
bean.readOnly?.let { apikey.isReadOnly = it }
116+
bean.readOnly?.let { apikey.readOnly = it }
117117
bean.description?.let { apikey.description = it }
118118

119119
return apikeyRepository.saveAndFlush(apikey)

src/main/kotlin/ch/derlin/bbdata/output/api/user_groups/UsergroupMapping.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package ch.derlin.bbdata.output.api.user_groups
33
import ch.derlin.bbdata.output.api.NoUpdateOnCreateEntity
44
import ch.derlin.bbdata.output.api.users.User
55
import com.fasterxml.jackson.annotation.JsonIgnore
6+
import com.fasterxml.jackson.annotation.JsonProperty
67
import com.fasterxml.jackson.annotation.JsonUnwrapped
78
import java.io.Serializable
89
import javax.persistence.*
@@ -37,6 +38,7 @@ data class UsergroupMapping(
3738
val groupId: Int,
3839

3940
@Column(name = "is_admin")
41+
@JsonProperty("admin")
4042
var isAdmin: Boolean,
4143

4244
@JoinColumn(name = "user_id", referencedColumnName = "id", insertable = false, updatable = false)

src/main/kotlin/ch/derlin/bbdata/output/security/SecurityFilter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class AuthInterceptor : HandlerInterceptor {
113113
BadApikeyException("Access denied for user $userId : bad apikey")
114114
}
115115
// check if write access is necessary
116-
if (apikey.isReadOnly && writeRequired) {
116+
if (apikey.readOnly && writeRequired) {
117117
// check write permissions
118118
throw ForbiddenException("Access denied for user $userId : this apikey is read-only")
119119
}

src/main/resources/application-noc.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
# dynamically set the @SpringBootApplication(exclude) property
55
# add a suffix so we don't override the default
6-
spring.autoconfigure.exclude.cassandra=org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration
6+
spring.autoconfigure.exclude.cassandra=org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration,\
7+
org.springframework.boot.autoconfigure.data.cassandra.CassandraReactiveDataAutoConfiguration
78
# custom property to automatically disable any component under the given package
89
# see ExcludePackagesFilter
910
scan.exclude.cassandra=ch.derlin.bbdata.output.api.values,ch.derlin.bbdata.input,ch.derlin.bbdata.common.cassandra

src/main/resources/application.properties

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## Embedded server
2+
server.shutdown=graceful
3+
14
## Actuator info endpoint
25
# NOTE: the /info actuator endpoint and the /about regular endpoint display exactly the same content.
36
# hence, whatever you show in /info is also available publicly to anyone !
@@ -32,7 +35,7 @@ spring.jpa.show-sql = false
3235
## Cassandra properties
3336
spring.data.cassandra.contact-points=127.0.0.1
3437
spring.data.cassandra.keyspace-name=bbdata2
35-
spring.data.cassandra.jmx-enabled=false
38+
spring.data.cassandra.local-datacenter=datacenter1
3639
# The following allows to shut up warnings "Spring Data Cassandra - Could not safely identify store assignment"
3740
# For this to work ensure to set the below property, but ONLY if Cassandra enabled (ie. not NOC profile)
3841
# @EnableCassandraRepositories(basePackages = ["ch.derlin.bbdata.common.cassandra"])
@@ -86,8 +89,9 @@ spring.task.execution.pool.allow-core-thread-timeout=false
8689
## Input/Output
8790
# make json the default
8891
spring.data.rest.defaultMediaType=application/json
89-
# pretty print output + keep map order
92+
# pretty print output
9093
spring.jackson.serialization.indent-output=true
94+
# keep order of properties
9195
spring.jackson.serialization.order-map-entries-by-keys=true
9296
# dates (declared here only for swagger)
9397
spring.jackson.date-format=yyyy-MM-dd'T'HH:mm:ss

0 commit comments

Comments
 (0)