Compare commits

...

51 Commits

Author SHA1 Message Date
Eleftheria Stein
840907993b Release 2.6.3 2022-04-19 17:37:41 +02:00
Eleftheria Stein
4db41c1caf Upgrade Spring Data to 2021.1.4
Closes gh-2058
2022-04-19 15:41:20 +02:00
Eleftheria Stein
f4840e98a2 Upgrade test dependencies 2022-04-19 12:27:09 +02:00
Eleftheria Stein
8c99c9f904 Upgrade Spring Security to 5.6.3
Closes gh-2064
2022-04-19 12:26:40 +02:00
Eleftheria Stein
f70f1f20f9 Upgrade Reactor to 2020.0.18
Closes gh-2065
2022-04-19 12:25:20 +02:00
Eleftheria Stein
ac1a77e5fe Upgrade Jackson to 2.13.2.20220328
Closes gh-2066
2022-04-19 12:21:58 +02:00
Eleftheria Stein
214a556dd4 Upgrade Spring Framework to 5.3.19
Closes gh-2063
2022-04-19 12:21:22 +02:00
Eleftheria Stein
cace484fbe Upgrade samples to Spring Boot 2.6.6
Closes gh-2067
2022-04-19 12:20:16 +02:00
Felix Scheinost
24c198fe98 Fix bug in JDBC SaveMode.ON_GET_ATTRIBUTE 2022-04-08 17:50:51 +02:00
Eleftheria Stein
2c1b79375d Upgrade samples to Spring Boot 2.6.5
This also makes the necessary changes for the Thymeleaf Layout Dialect 3.0 update.

Closes gh-1980
2022-03-29 15:33:08 +02:00
Eleftheria Stein
fba9313c6b Document release process for 2.6.x
Issue gh-2036
2022-02-23 14:22:25 +01:00
Eleftheria Stein
c2288615bf Update antora to 2.6.3 2022-02-22 14:38:24 +01:00
Eleftheria Stein
ad52fc0297 Next development version 2022-02-22 14:13:29 +01:00
Eleftheria Stein
2516a495af Release 2.6.2 2022-02-22 10:31:00 +01:00
Eleftheria Stein
9be7ac7fa6 Upgrade test dependencies 2022-02-22 10:30:29 +01:00
Eleftheria Stein
c335a49924 Upgrade Hazelcast 4 to 4.2.4
Closes gh-2029
2022-02-22 10:29:20 +01:00
Eleftheria Stein
092e6c6607 Upgrade MongoDB to 4.4.2
Closes gh-2034
2022-02-22 10:28:02 +01:00
Eleftheria Stein
0924c9558a Upgrade Reactor to 2020.0.16
Closes gh-2031
2022-02-22 10:27:20 +01:00
Eleftheria Stein
0484781541 Upgrade Jackson to 2.13.1
Closes gh-2033
2022-02-22 10:26:38 +01:00
Eleftheria Stein
3995f8bf65 Upgrade Spring Framework to 5.3.16
Closes gh-2028
2022-02-22 10:25:32 +01:00
Eleftheria Stein
ad16f17398 Upgrade Spring Data to 2021.1.2
Closes gh-2032
2022-02-22 10:24:56 +01:00
Eleftheria Stein
11aa50e83c Upgrade Spring Security to 5.6.2
Closes gh-2030
2022-02-22 10:24:32 +01:00
Eleftheria Stein
a0246a61b6 Update to jakarta.servlet-api dependency
Closes gh-1960
2022-01-25 13:26:47 +01:00
Eleftheria Stein
8f20fa328a Update to jakarta.annotation-api dependency
Closes gh-1956
2022-01-25 12:50:29 +01:00
Ruslan Molchanov
12ce8de84e Fix memory leak with null principal in Redis
Closes gh-1987
2022-01-20 10:05:05 +01:00
Eleftheria Stein
dba22292a3 Run CI on all branches 2022-01-05 14:29:57 +02:00
Eleftheria Stein
a08c721118 Next development version 2021-12-21 16:31:16 +02:00
Eleftheria Stein
70e0c6d22d Update antora version 2021-12-21 15:44:58 +02:00
Eleftheria Stein
61bf2eca49 Release 2.6.1 2021-12-21 15:12:26 +02:00
Eleftheria Stein
59923121f0 Make gretty samples compatible with logback 1.2.9
Explicitly reference the logback.xml file to prevent gretty from configuring the defaults using groovy.
2021-12-21 11:10:33 +02:00
Eleftheria Stein
b5f8e29585 Upgrade test dependencies 2021-12-21 11:10:22 +02:00
Eleftheria Stein
307a1f0dde Upgrade Hazelcast 4 to 4.2.3
Closes gh-1979
2021-12-21 10:09:06 +02:00
Eleftheria Stein
ced2d8421c Upgrade Spring Security to 5.6.1
Closes gh-1978
2021-12-21 10:08:25 +02:00
Eleftheria Stein
d98ff97e1a Upgrade Spring Framework to 5.3.14
Closes gh-1977
2021-12-21 10:03:02 +02:00
Eleftheria Stein
757175516f Upgrade Reactor to 2020.0.14
Closes gh-1976
2021-12-21 10:02:30 +02:00
Eleftheria Stein
8ae55b7ee4 GitHub Actions uses spring-builds+github user
This is more clear than spring-builds user
2021-12-07 15:43:42 +01:00
Eleftheria Stein
1eb53ead9d Update README to include MongoDB
Issue gh-1901
2021-11-26 17:37:12 +01:00
Guillaume Husta
72159794f4 Doc : typo on Username _user-
user should be in italic
2021-11-19 14:56:56 +01:00
Eleftheria Stein
aaf122f3a6 Include 2.6.0 and 3.0 snapshots in reference docs 2021-11-17 11:28:54 +01:00
Eleftheria Stein
6f823805f2 Include 2.6.8 release in docs 2021-11-17 11:04:55 +01:00
Eleftheria Stein
7807aa9f3c Next development version 2021-11-16 18:56:49 +01:00
Eleftheria Stein
76924bc923 Release 2.6.0 2021-11-16 14:21:51 +01:00
Eleftheria Stein
134f89dd41 Upgrade test dependencies 2021-11-16 13:57:45 +01:00
Eleftheria Stein
33812f7197 Upgrade MongoDB to 4.4.0
Closes gh-1967
2021-11-16 13:56:44 +01:00
Eleftheria Stein
bcf17ba3b7 Upgrade samples to Spring Boot 2.5.6
Closes gh-1966
2021-11-16 13:37:41 +01:00
Eleftheria Stein
98f656ad46 Upgrade Jackson to 2.13.0
Closes gh-1965
2021-11-16 13:11:51 +01:00
Eleftheria Stein
7832942752 Upgrade Spring Security to 5.6.0
Closes gh-1964
2021-11-16 13:07:43 +01:00
Eleftheria Stein
722069a5f8 Upgrade Spring Data to 2021.1.0
Closes gh-1963
2021-11-16 13:06:41 +01:00
Eleftheria Stein
addbdbc1a2 Upgrade Spring Framework to 5.3.13
Closes gh-1962
2021-11-16 13:05:51 +01:00
Eleftheria Stein
004466ed07 Upgrade Reactor to 2020.0.13
Closes gh-1961
2021-11-16 13:04:32 +01:00
Eleftheria Stein
aeb5bc545c Update to Gradle 7.3
Closes gh-1959
2021-11-15 09:59:22 +01:00
42 changed files with 237 additions and 71 deletions

View File

@@ -2,8 +2,6 @@ name: CI
on:
push:
branches:
- main
schedule:
- cron: '0 10 * * *' # Once per day at 10am UTC
workflow_dispatch: # Manual trigger
@@ -33,7 +31,7 @@ jobs:
- name: Setup gradle user name
run: |
mkdir -p ~/.gradle
echo 'systemProp.user.name=spring-builds' >> ~/.gradle/gradle.properties
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
- name: Cache Gradle packages
uses: actions/cache@v2
with:
@@ -59,7 +57,7 @@ jobs:
- name: Setup gradle user name
run: |
mkdir -p ~/.gradle
echo 'systemProp.user.name=spring-builds' >> ~/.gradle/gradle.properties
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
- name: Deploy artifacts
run: |
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
@@ -87,7 +85,7 @@ jobs:
- name: Setup gradle user name
run: |
mkdir -p ~/.gradle
echo 'systemProp.user.name=spring-builds' >> ~/.gradle/gradle.properties
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
- name: Deploy Docs
run: |
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"

View File

@@ -19,9 +19,9 @@ This Spring Session repository consists of the following modules:
* Spring Session Data Redis - provides `SessionRepository` and `ReactiveSessionRepository` implementation backed by Redis and configuration support
* Spring Session JDBC - provides `SessionRepository` implementation backed by a relational database and configuration support
* Spring Session Hazelcast - provides `SessionRepository` implementation backed by Hazelcast and configuration support
* Spring Session MongoDB - provides `SessionRepository` implementation backed by MongoDB and configuration support
Additional Spring Session modules can be found in the https://github.com/spring-projects/spring-session-data-mongodb[spring-session-data-mongodb] repository
and https://github.com/spring-projects/spring-session-data-geode[spring-session-data-geode] repository.
Additional Spring Session modules can be found in the https://github.com/spring-projects/spring-session-data-geode[spring-session-data-geode] repository.
== Getting Started

101
RELEASE.adoc Normal file
View File

@@ -0,0 +1,101 @@
== 1. Update Dependencies
Dependencies are declared in `gradle/dependency-management.gradle`.
Update Spring Framework, Spring Security and Spring Data at a minimum.
Run all the checks:
[source,bash]
----
$ ./gradlew check
----
Create separate issues for each dependency update, aside from test dependencies which can be combined into a single commit.
== 2. Check All Issues are Closed
You can manually check at https://github.com/spring-projects/spring-session/milestones
== 3. Update Release Version
Update the version number in `gradle.properties` for the release, for example `2.6.0-M1`, `2.6.0-RC1`, `2.6.3`
== 4. Update Antora Version
You will need to update the antora.yml version.
== 5. Build Locally
Run the build using
[source,bash]
----
$ ./gradlew check
----
== 6. Push the Release Commit
Push the commit and GitHub actions will build and deploy the artifacts.
Wait for the artifact to appear in https://repo1.maven.org/maven2/org/springframework/session/spring-session-core/
== 7. Tag the release
Tag the release and then push the tag
....
git tag 2.6.3
git push origin 2.6.3
....
== 8. Update to Next Development Version
Update `gradle.properties` version to next `+SNAPSHOT+` version, update antora.yml and then push
== 9. Update version on project pages
Update the versions on https://spring.io/projects for Spring Session Core, Spring Session Data Redis, Spring Session JDBC, Spring Session Hazelcast, and Spring Session MongoDB.
== 10. Update Release Notes on GitHub
Download
https://github.com/spring-io/github-changelog-generator/releases/latest[the
GitHub release notes generator]
* Generate the release notes
....
java -jar github-changelog-generator.jar \
--changelog.repository=spring-projects/spring-session \
$MILESTONE release-notes
....
Note 1: `+$MILESTONE+` is something like `+2.6.1+` or `+2.6.0-M1+`. +
Note 2: This will create a file on your filesystem
called `+release-notes+`.
* Copy the release notes to your clipboard (your mileage may vary with
the following command)
....
cat release-notes | xclip -selection clipboard
....
* Create the
https://github.com/spring-projects/spring-session/releases[release on
GitHub], associate it with the tag, and paste the generated notes.
== 11. Close / Create Milestone
* In
https://github.com/spring-projects/spring-session/milestones[GitHub
Milestones], create a new milestone for the next release version
* Move any open issues from the existing milestone you just released to
the new milestone.
* Close the milestone for the release.
== 12. Announce the release
* Announce via Slack on https://pivotal.slack.com/messages/spring-session[#spring-session], and tag any downstream Spring Session projects (e.g Spring Session for Apache Geode).
Note: Do not post on #spring-release or create a blog post. Those steps happen after the Spring Session BOM is released.

View File

@@ -4,7 +4,7 @@ buildscript {
snapshotBuild = version.endsWith('SNAPSHOT')
milestoneBuild = !(releaseBuild || snapshotBuild)
springBootVersion = '2.5.5'
springBootVersion = '2.6.6'
}
repositories {

View File

@@ -64,7 +64,7 @@ dependencies {
implementation 'com.github.spullara.mustache.java:compiler:0.9.10'
implementation 'io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.15'
implementation 'io.spring.nohttp:nohttp-gradle:0.0.9'
implementation 'net.sourceforge.htmlunit:htmlunit:2.37.0'
implementation 'net.sourceforge.htmlunit:htmlunit:2.55.0'
implementation 'org.hidetake:gradle-ssh-plugin:2.10.1'
implementation 'org.jfrog.buildinfo:build-info-extractor-gradle:4.24.20'
implementation 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1'

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -9,7 +9,7 @@ repositories {
}
dependencies {
optional 'javax.servlet:javax.servlet-api:3.1.0'
optional 'jakarta.servlet:jakarta.servlet-api:4.0.4'
testImplementation platform('org.junit:junit-bom:5.8.1')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'

View File

@@ -4,7 +4,7 @@ plugins {
}
dependencies {
provided 'javax.servlet:javax.servlet-api'
provided 'jakarta.servlet:jakarta.servlet-api:4.0.4'
testImplementation 'commons-io:commons-io:2.11.0'
testImplementation 'org.assertj:assertj-core:3.21.0'
testImplementation platform('org.junit:junit-bom:5.8.1')

View File

@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
version=2.6.0-SNAPSHOT
version=2.6.3

View File

@@ -1,12 +1,12 @@
dependencyManagement {
imports {
mavenBom 'io.projectreactor:reactor-bom:2020.0.12'
mavenBom 'com.fasterxml.jackson:jackson-bom:2.11.2'
mavenBom 'org.junit:junit-bom:5.8.1'
mavenBom 'org.springframework:spring-framework-bom:5.3.11'
mavenBom 'org.springframework.data:spring-data-bom:2021.1.0-RC1'
mavenBom 'org.springframework.security:spring-security-bom:5.6.0-RC1'
mavenBom 'org.testcontainers:testcontainers-bom:1.16.0'
mavenBom 'io.projectreactor:reactor-bom:2020.0.18'
mavenBom 'com.fasterxml.jackson:jackson-bom:2.13.2.20220328'
mavenBom 'org.junit:junit-bom:5.8.2'
mavenBom 'org.springframework:spring-framework-bom:5.3.19'
mavenBom 'org.springframework.data:spring-data-bom:2021.1.4'
mavenBom 'org.springframework.security:spring-security-bom:5.6.3'
mavenBom 'org.testcontainers:testcontainers-bom:1.16.3'
}
dependencies {
@@ -15,19 +15,19 @@ dependencyManagement {
entry 'hazelcast-client'
}
dependency 'org.aspectj:aspectjweaver:1.9.7'
dependency 'ch.qos.logback:logback-core:1.2.3'
dependency 'org.aspectj:aspectjweaver:1.9.9.1'
dependency 'ch.qos.logback:logback-core:1.2.11'
dependency 'com.google.code.findbugs:jsr305:3.0.2'
dependency 'com.h2database:h2:1.4.200'
dependency 'com.ibm.db2:jcc:11.5.6.0'
dependency 'com.microsoft.sqlserver:mssql-jdbc:9.4.0.jre8'
dependency 'com.ibm.db2:jcc:11.5.7.0'
dependency 'com.microsoft.sqlserver:mssql-jdbc:9.4.1.jre8'
dependency 'com.oracle.database.jdbc:ojdbc8:21.3.0.0'
dependency 'com.zaxxer:HikariCP:3.4.5'
dependency 'edu.umd.cs.mtc:multithreadedtc:1.01'
dependency 'io.lettuce:lettuce-core:6.1.5.RELEASE'
dependency 'javax.annotation:javax.annotation-api:1.3.2'
dependency 'javax.servlet:javax.servlet-api:4.0.1'
dependency 'mysql:mysql-connector-java:8.0.26'
dependency 'io.lettuce:lettuce-core:6.1.8.RELEASE'
dependency 'jakarta.annotation:jakarta.annotation-api:1.3.5'
dependency 'jakarta.servlet:jakarta.servlet-api:4.0.4'
dependency 'mysql:mysql-connector-java:8.0.28'
dependency 'org.apache.derby:derby:10.14.2.0'
dependency 'org.assertj:assertj-core:3.21.0'
dependency 'org.hamcrest:hamcrest:2.1'
@@ -38,12 +38,12 @@ dependencyManagement {
entry 'mockito-junit-jupiter'
}
dependencySet(group: 'org.mongodb', version: '4.2.3') {
dependencySet(group: 'org.mongodb', version: '4.4.2') {
entry 'mongodb-driver-core'
entry 'mongodb-driver-sync'
entry 'mongodb-driver-reactivestreams'
}
dependency 'org.postgresql:postgresql:42.2.24'
dependency 'org.postgresql:postgresql:42.3.3'
}
}

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -6,8 +6,8 @@ dependencies {
api "org.springframework:spring-jcl"
optional "io.projectreactor:reactor-core"
optional "javax.annotation:javax.annotation-api"
optional "javax.servlet:javax.servlet-api"
optional "jakarta.annotation:jakarta.annotation-api"
optional "jakarta.servlet:jakarta.servlet-api"
optional "org.springframework:spring-context"
optional "org.springframework:spring-jdbc"
optional "org.springframework:spring-messaging"

View File

@@ -41,5 +41,5 @@ dependencies {
testImplementation "org.mockito:mockito-core"
testImplementation "org.mockito:mockito-junit-jupiter"
testImplementation "io.projectreactor:reactor-test"
testImplementation "javax.servlet:javax.servlet-api"
testImplementation "jakarta.servlet:jakarta.servlet-api"
}

View File

@@ -15,7 +15,7 @@ dependencies {
testImplementation "org.mockito:mockito-core"
testImplementation "org.springframework:spring-test"
testImplementation "io.projectreactor:reactor-test"
testImplementation "javax.servlet:javax.servlet-api"
testImplementation "jakarta.servlet:jakarta.servlet-api"
testImplementation "org.springframework:spring-web"
testImplementation "org.springframework.security:spring-security-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"

View File

@@ -527,6 +527,30 @@ class RedisIndexedSessionRepositoryITests extends AbstractRedisITests {
assertThat(findByPrincipalName.keySet()).containsOnly(changeSessionId);
}
@Test // gh-1987
void changeSessionIdWhenPrincipalNameChangesFromNullThenIndexShouldNotBeCreated() {
String principalName = null;
String principalNameChanged = "findByChangedPrincipalName" + UUID.randomUUID();
RedisSession toSave = this.repository.createSession();
toSave.setAttribute(INDEX_NAME, principalName);
this.repository.save(toSave);
RedisSession findById = this.repository.findById(toSave.getId());
String changeSessionId = findById.changeSessionId();
findById.setAttribute(INDEX_NAME, principalNameChanged);
this.repository.save(findById);
Map<String, RedisSession> findByPrincipalName = this.repository.findByIndexNameAndIndexValue(INDEX_NAME,
principalName);
assertThat(findByPrincipalName).isEmpty();
findByPrincipalName = this.repository.findByIndexNameAndIndexValue(INDEX_NAME, principalNameChanged);
assertThat(findByPrincipalName).hasSize(1);
assertThat(findByPrincipalName.keySet()).containsOnly(changeSessionId);
}
@Test
void changeSessionIdWhenOnlyChangeId() {
String attrName = "changeSessionId";

View File

@@ -858,11 +858,13 @@ public class RedisIndexedSessionRepository
catch (NonTransientDataAccessException ex) {
handleErrNoSuchKeyError(ex);
}
String originalPrincipalRedisKey = getPrincipalKey(this.originalPrincipalName);
RedisIndexedSessionRepository.this.sessionRedisOperations.boundSetOps(originalPrincipalRedisKey)
.remove(this.originalSessionId);
RedisIndexedSessionRepository.this.sessionRedisOperations.boundSetOps(originalPrincipalRedisKey)
.add(sessionId);
if (this.originalPrincipalName != null) {
String originalPrincipalRedisKey = getPrincipalKey(this.originalPrincipalName);
RedisIndexedSessionRepository.this.sessionRedisOperations.boundSetOps(originalPrincipalRedisKey)
.remove(this.originalSessionId);
RedisIndexedSessionRepository.this.sessionRedisOperations.boundSetOps(originalPrincipalRedisKey)
.add(sessionId);
}
}
this.originalSessionId = sessionId;
}

View File

@@ -9,7 +9,8 @@ content:
- url: https://github.com/spring-io/spring-generated-docs
branches: [spring-projects/spring-session/*]
- url: https://github.com/spring-projects/spring-session
branches: [main]
branches: [main,3.0.x]
tags: ['2.6.*','!2.6.0-M*','!2.6.0-RC*']
start_path: spring-session-docs
urls:
latest_version_segment_strategy: redirect:to

View File

@@ -1,3 +1,2 @@
name: ROOT
version: '2.6.0'
prerelease: '-SNAPSHOT'
version: '2.6.3'

View File

@@ -170,7 +170,7 @@ You can now try to use the application. To do so, use your favorite REST client
Note that you are prompted for basic authentication. Provide the following information for the username and password:
* *Username* _user-
* *Username* _user_
* *Password* _password_
Then run the following command:

View File

@@ -22,7 +22,7 @@ dependencies {
testImplementation 'org.assertj:assertj-core'
testImplementation 'com.hazelcast:hazelcast'
testImplementation 'io.lettuce:lettuce-core'
testImplementation 'javax.servlet:javax.servlet-api'
testImplementation 'jakarta.servlet:jakarta.servlet-api'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}

View File

@@ -21,11 +21,11 @@ artifacts {
dependencies {
api project(':spring-session-core')
optional "com.hazelcast:hazelcast:4.2.2"
optional "com.hazelcast:hazelcast:4.2.4"
api "org.springframework:spring-context"
api "javax.annotation:javax.annotation-api"
api "jakarta.annotation:jakarta.annotation-api"
testImplementation "javax.servlet:javax.servlet-api"
testImplementation "jakarta.servlet:jakarta.servlet-api"
testImplementation "org.assertj:assertj-core"
testImplementation "org.mockito:mockito-core"
testImplementation "org.springframework:spring-test"
@@ -35,7 +35,7 @@ dependencies {
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
integrationTestCompile "org.testcontainers:testcontainers"
integrationTestCompile "com.hazelcast:hazelcast:4.2"
integrationTestCompile "com.hazelcast:hazelcast:4.2.4"
integrationTestCompile project(":spring-session-hazelcast")
}

View File

@@ -45,7 +45,7 @@ import org.springframework.test.context.web.WebAppConfiguration;
@WebAppConfiguration
class ClientServerHazelcast4IndexedSessionRepositoryITests extends AbstractHazelcast4IndexedSessionRepositoryITests {
private static GenericContainer container = new GenericContainer<>("hazelcast/hazelcast:4.2.2")
private static GenericContainer container = new GenericContainer<>("hazelcast/hazelcast:4.2.4")
.withExposedPorts(5701).withCopyFileToContainer(MountableFile.forClasspathResource("/hazelcast-server.xml"),
"/opt/hazelcast/hazelcast.xml");

View File

@@ -7,13 +7,13 @@ configurations {
dependencies {
api project(':spring-session-core')
api "com.hazelcast:hazelcast"
api "javax.annotation:javax.annotation-api"
api "jakarta.annotation:jakarta.annotation-api"
api "org.springframework:spring-context"
hazelcast4(project(path: ":hazelcast4", configuration: 'classesOnlyElements'))
compileOnly(project(":hazelcast4"))
testImplementation "javax.servlet:javax.servlet-api"
testImplementation "jakarta.servlet:jakarta.servlet-api"
testImplementation "org.assertj:assertj-core"
testImplementation "org.mockito:mockito-core"
testImplementation "org.springframework:spring-test"

View File

@@ -7,7 +7,7 @@ dependencies {
api "org.springframework:spring-context"
api "org.springframework:spring-jdbc"
testImplementation "javax.servlet:javax.servlet-api"
testImplementation "jakarta.servlet:jakarta.servlet-api"
testImplementation "org.assertj:assertj-core"
testImplementation "org.mockito:mockito-core"
testImplementation "org.springframework:spring-test"

View File

@@ -46,7 +46,7 @@ final class DatabaseContainers {
}
static MySQLContainer<?> mySql() {
return new MySQLContainer<>("mysql:8.0.27");
return new MySQLContainer<>("mysql:8.0.28");
}
static OracleContainer oracle() {

View File

@@ -728,7 +728,8 @@ public class JdbcIndexedSessionRepository
T attributeValue = supplier.get();
if (attributeValue != null
&& JdbcIndexedSessionRepository.this.saveMode.equals(SaveMode.ON_GET_ATTRIBUTE)) {
this.delta.put(attributeName, DeltaValue.UPDATED);
this.delta.merge(attributeName, DeltaValue.UPDATED, (oldDeltaValue,
deltaValue) -> (oldDeltaValue == DeltaValue.ADDED) ? oldDeltaValue : deltaValue);
}
return attributeValue;
}

View File

@@ -655,6 +655,20 @@ class JdbcIndexedSessionRepositoryTests {
verifyNoMoreInteractions(this.jdbcOperations);
}
@Test
void saveWithSaveModeOnGetAttributeAndNewAttributeSetAndGet() {
this.repository.setSaveMode(SaveMode.ON_GET_ATTRIBUTE);
MapSession delegate = new MapSession();
delegate.setAttribute("attribute1", (Supplier<String>) () -> "value1");
JdbcSession session = this.repository.new JdbcSession(delegate, UUID.randomUUID().toString(), false);
session.setAttribute("attribute2", "value2");
session.getAttribute("attribute2");
this.repository.save(session);
verify(this.jdbcOperations, times(1)).update(startsWith("INSERT INTO SPRING_SESSION_ATTRIBUTES ("),
isA(PreparedStatementSetter.class));
verifyNoMoreInteractions(this.jdbcOperations);
}
@Test
void saveWithSaveModeAlways() {
this.repository.setSaveMode(SaveMode.ALWAYS);

View File

@@ -1,17 +1,17 @@
dependencyManagement {
imports {
mavenBom 'com.fasterxml.jackson:jackson-bom:2.13.0'
mavenBom 'com.fasterxml.jackson:jackson-bom:2.13.2.20220328'
}
dependencies {
dependency 'ch.qos.logback:logback-classic:1.2.6'
dependency 'ch.qos.logback:logback-classic:1.2.11'
dependency 'com.maxmind.geoip2:geoip2:2.15.0'
dependency 'javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.2'
dependency 'javax.servlet.jsp:javax.servlet.jsp-api:2.3.3'
dependency 'org.apache.taglibs:taglibs-standard-jstlel:1.2.5'
dependency 'org.seleniumhq.selenium:htmlunit-driver:2.52.0'
dependency 'org.slf4j:jcl-over-slf4j:1.7.32'
dependency 'org.slf4j:log4j-over-slf4j:1.7.32'
dependency 'org.slf4j:jcl-over-slf4j:1.7.36'
dependency 'org.slf4j:log4j-over-slf4j:1.7.36'
dependency 'org.webjars:bootstrap:2.3.2'
dependency 'org.webjars:html5shiv:3.7.3-1'
dependency 'org.webjars:jquery:3.6.0'

View File

@@ -7,7 +7,7 @@ dependencies {
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
implementation "org.springframework.boot:spring-boot-starter-security"
implementation "com.hazelcast:hazelcast:4.2.2"
implementation "com.hazelcast:hazelcast:4.2.4"
implementation "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect"
implementation "org.webjars:bootstrap"
implementation "org.webjars:html5shiv"

View File

@@ -2,3 +2,7 @@ logging:
level:
org.springframework.data.mongodb: DEBUG
org.springframework.session: DEBUG
spring:
mongodb:
embedded:
version: 3.0.0

View File

@@ -1,3 +1,4 @@
spring.thymeleaf.cache=false
spring.template.cache=false
spring.data.mongodb.port=0
spring.mongodb.embedded.version=3.0.0

View File

@@ -1,4 +1,4 @@
<html xmlns:layout="https://github.com/ultraq/thymeleaf-layout-dialect" layout:decorator="layout">
<html xmlns:layout="https://github.com/ultraq/thymeleaf-layout-dialect" layout:decorate="layout">
<head>
<title>Secured Content</title>
</head>

View File

@@ -3,7 +3,7 @@
xmlns:th="https://www.thymeleaf.org"
xmlns:layout="https://github.com/ultraq/thymeleaf-layout-dialect">
<head>
<title layout:title-pattern="$DECORATOR_TITLE - $CONTENT_TITLE">Spring Session Sample</title>
<title layout:title-pattern="$LAYOUT_TITLE - $CONTENT_TITLE">Spring Session Sample</title>
<link rel="icon" type="image/x-icon" th:href="@{/resources/img/favicon.ico}" href="../static/img/favicon.ico"/>
<link th:href="@{/webjars/bootstrap/css/bootstrap.min.css}" href="/webjars/bootstrap/css/bootstrap.min.css" rel="stylesheet"></link>
<style type="text/css">

View File

@@ -17,7 +17,7 @@ dependencies {
implementation "ch.qos.logback:logback-classic"
implementation "org.testcontainers:testcontainers"
providedCompile "javax.servlet:javax.servlet-api"
providedCompile "jakarta.servlet:jakarta.servlet-api"
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"
@@ -29,4 +29,5 @@ dependencies {
gretty {
jvmArgs = ['-Dspring.profiles.active=embedded-redis']
logbackConfigFile = "src/main/resources/logback.xml"
}

View File

@@ -19,7 +19,7 @@ dependencies {
implementation "org.slf4j:log4j-over-slf4j"
implementation "ch.qos.logback:logback-classic"
providedCompile "javax.servlet:javax.servlet-api"
providedCompile "jakarta.servlet:jakarta.servlet-api"
providedCompile "javax.servlet.jsp:javax.servlet.jsp-api"
testImplementation "org.assertj:assertj-core"
@@ -29,3 +29,7 @@ dependencies {
integrationTestCompile "org.seleniumhq.selenium:htmlunit-driver"
integrationTestCompile "org.seleniumhq.selenium:selenium-support"
}
gretty {
logbackConfigFile = "src/main/resources/logback.xml"
}

View File

@@ -16,7 +16,7 @@ dependencies {
implementation "org.slf4j:log4j-over-slf4j"
implementation "ch.qos.logback:logback-classic"
providedCompile "javax.servlet:javax.servlet-api"
providedCompile "jakarta.servlet:jakarta.servlet-api"
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"
@@ -25,3 +25,7 @@ dependencies {
integrationTestCompile "org.seleniumhq.selenium:htmlunit-driver"
integrationTestCompile "org.seleniumhq.selenium:selenium-support"
}
gretty {
logbackConfigFile = "src/main/resources/logback.xml"
}

View File

@@ -17,7 +17,7 @@ dependencies {
implementation "ch.qos.logback:logback-classic"
implementation "org.testcontainers:testcontainers"
providedCompile "javax.servlet:javax.servlet-api"
providedCompile "jakarta.servlet:jakarta.servlet-api"
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"
@@ -29,4 +29,5 @@ dependencies {
gretty {
jvmArgs = ['-Dspring.profiles.active=embedded-redis']
logbackConfigFile = "src/main/resources/logback.xml"
}

View File

@@ -18,7 +18,7 @@ dependencies {
implementation "ch.qos.logback:logback-classic"
implementation "org.testcontainers:testcontainers"
providedCompile "javax.servlet:javax.servlet-api"
providedCompile "jakarta.servlet:jakarta.servlet-api"
testImplementation "org.springframework.security:spring-security-test"
testImplementation "org.assertj:assertj-core"
@@ -30,4 +30,5 @@ dependencies {
gretty {
jvmArgs = ['-Dspring.profiles.active=embedded-redis']
servletContainer = 'tomcat9'
logbackConfigFile = "src/main/resources/logback.xml"
}

View File

@@ -19,7 +19,7 @@ dependencies {
implementation "ch.qos.logback:logback-classic"
implementation "org.testcontainers:testcontainers"
providedCompile "javax.servlet:javax.servlet-api"
providedCompile "jakarta.servlet:jakarta.servlet-api"
providedCompile "javax.servlet.jsp:javax.servlet.jsp-api"
testImplementation "org.assertj:assertj-core"
@@ -33,4 +33,5 @@ dependencies {
gretty {
jvmArgs = ['-Dspring.profiles.active=embedded-redis']
logbackConfigFile = "src/main/resources/logback.xml"
}

View File

@@ -15,7 +15,7 @@ dependencies {
implementation "org.slf4j:log4j-over-slf4j"
implementation "ch.qos.logback:logback-classic"
providedCompile "javax.servlet:javax.servlet-api"
providedCompile "jakarta.servlet:jakarta.servlet-api"
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"
@@ -24,3 +24,7 @@ dependencies {
integrationTestCompile "org.seleniumhq.selenium:htmlunit-driver"
integrationTestCompile "org.seleniumhq.selenium:selenium-support"
}
gretty {
logbackConfigFile = "src/main/resources/logback.xml"
}

View File

@@ -16,7 +16,7 @@ dependencies {
implementation "org.slf4j:log4j-over-slf4j"
implementation "ch.qos.logback:logback-classic"
providedCompile "javax.servlet:javax.servlet-api"
providedCompile "jakarta.servlet:jakarta.servlet-api"
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"
@@ -25,3 +25,7 @@ dependencies {
integrationTestCompile "org.seleniumhq.selenium:htmlunit-driver"
integrationTestCompile "org.seleniumhq.selenium:selenium-support"
}
gretty {
logbackConfigFile = "src/main/resources/logback.xml"
}

View File

@@ -17,7 +17,7 @@ dependencies {
implementation "ch.qos.logback:logback-classic"
implementation "org.testcontainers:testcontainers"
providedCompile "javax.servlet:javax.servlet-api"
providedCompile "jakarta.servlet:jakarta.servlet-api"
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"
@@ -29,4 +29,5 @@ dependencies {
gretty {
jvmArgs = ['-Dspring.profiles.active=embedded-redis']
logbackConfigFile = "src/main/resources/logback.xml"
}