Compare commits

...

39 Commits

Author SHA1 Message Date
Eleftheria Stein
5d521aa9bc Add End-of-Life Notice 2020-11-18 13:03:12 +01:00
Eleftheria Stein
e14c840354 Remove from CI 2020-11-18 12:59:58 +01:00
Eleftheria Stein
f36713d0ee Next development version 2020-09-16 12:50:09 +02:00
Eleftheria Stein
12721d83ad Release 2.1.13.RELEASE 2020-09-16 11:43:16 +02:00
Eleftheria Stein
92c7302103 Upgrade Spring Data to Lovelace-SR20
Closes gh-1700
2020-09-16 11:16:56 +02:00
Eleftheria Stein
1adb9bb481 Upgrade test dependencies 2020-09-15 15:32:42 +02:00
Eleftheria Stein
8faef3613b Upgrade Spring Framework to 5.1.18.RELEASE
Closes gh-1697
2020-09-15 15:32:10 +02:00
Eleftheria Stein
65702d159e Upgrade Spring Security to 5.1.12.RELEASE
Closes gh-1696
2020-09-15 15:21:34 +02:00
Eleftheria Stein
48f061450c Upgrade Reactor to Californium-SR21
Closes gh-1695
2020-09-15 15:19:44 +02:00
Eleftheria Stein
a77196a851 Upgrade samples to Spring Boot 2.1.16.RELEASE
Closes gh-1694
2020-09-15 15:19:23 +02:00
Eleftheria Stein
4d18ed1826 Next development version 2020-05-13 15:23:01 -04:00
Eleftheria Stein
b20dd33af7 Release 2.1.12.RELEASE 2020-05-13 14:55:31 -04:00
Eleftheria Stein
ad51021e22 Upgrade test dependencies 2020-05-13 11:03:35 -04:00
Eleftheria Stein
41a84efd21 Upgrade samples to Spring Boot 2.1.14
Resolves gh-1639
2020-05-13 11:02:58 -04:00
Eleftheria Stein
6cb1764066 Upgrade Spring Security to 5.1.10.RELEASE
Resolves gh-1638
2020-05-13 10:20:59 -04:00
Eleftheria Stein
07f16ffc6a Upgrade Spring Data to Lovelace-SR17
Resolves gh-1637
2020-05-13 10:19:35 -04:00
Eleftheria Stein
54b428dbeb Upgrade Spring Framework to 5.1.15.RELEASE
Resolves gh-1636
2020-05-13 10:18:11 -04:00
Eleftheria Stein
e789fcc628 Upgrade Reactor to Californium-SR18
Resolves gh-1635
2020-05-13 10:16:20 -04:00
Eleftheria Stein
15d22a9dd4 Next development version 2020-03-04 15:16:21 -05:00
Eleftheria Stein
40cb8de232 Release 2.1.11.RELEASE 2020-03-04 14:18:59 -05:00
Eleftheria Stein
b394f56731 Revert "Upgrade Hazelcast to 3.11.7"
This reverts commit e7fd59ccf9.
2020-03-04 12:44:05 -05:00
Eleftheria Stein
e7fd59ccf9 Upgrade Hazelcast to 3.11.7
Resolves: #1601
2020-03-04 11:51:30 -05:00
Eleftheria Stein
6e5352d48f Upgrade samples to Spring Boot 2.1.13
Resolves #1600
2020-03-04 11:49:37 -05:00
Eleftheria Stein
2507c86cba Upgrade Spring Security to 5.1.8.RELEASE
Resolves $1599
2020-03-04 11:47:25 -05:00
Eleftheria Stein
01f7ff9a51 Upgrade Spring Data to Lovelace-SR16
Resolves #1598
2020-03-04 11:16:33 -05:00
Eleftheria Stein
1ce95f8591 Upgrade Reactor to Californium-SR16
Resolves #1597
2020-03-04 11:14:41 -05:00
Eleftheria Stein
a9d003af4d Upgrade Spring Framework to 5.1.14.RELEASE
Resolves #1532
2020-03-04 11:13:27 -05:00
Eleftheria Stein
797b0a62a8 Next development version 2020-01-29 09:29:18 +01:00
Eleftheria Stein
943abb8eca Release 2.1.10.RELEASE 2020-01-28 12:34:06 +01:00
Eleftheria Stein
9f78688ffa Upgrade Spring Security to 5.1.7.RELEASE
Resolves: #1572
2020-01-28 12:14:14 +01:00
Eleftheria Stein
c391adfea1 Upgrade Spring Data to Lovelace-SR14
Resolves: #1571
2020-01-28 12:13:23 +01:00
Eleftheria Stein
9befe44769 Upgrade Reactor to Californium-SR14
Resolves: #1570
2020-01-28 12:11:56 +01:00
Eleftheria Stein
6aa85236e0 Update note in custom-cookie index page
Resolves: gh-1559
2020-01-13 12:52:43 +01:00
Vedran Pavic
5ebe699d7c Polish DefaultCookieSerializer
See: #1514
2019-10-09 21:06:45 +02:00
Vedran Pavic
f6a670d78e Update Travis CI config 2019-10-08 12:50:52 +02:00
Vedran Pavic
c63761317d Upgrade samples to Spring Boot 2.1.9.RELEASE
Resolves: #1533
2019-10-08 09:37:57 +02:00
Vedran Pavic
f0aed6b8b8 Ensure session cookie's expires directive uses GMT format
Resolves: #1514
2019-10-07 22:51:10 +02:00
Vedran Pavic
4a3f0d5f34 Improve Hazelcast client-server topology integration tests
Resolves: #1527
2019-10-07 22:35:24 +02:00
Rob Winch
5d88b6bf28 Next development version 2019-09-30 22:32:32 -05:00
11 changed files with 76 additions and 199 deletions

View File

@@ -1,20 +1,16 @@
language: java
sudo: required
services: docker
jdk: oraclejdk8
language: java
jdk:
- openjdk8
- openjdk11
services:
- docker
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
install: true
script: ./gradlew clean build --refresh-dependencies --no-daemon
script: ./gradlew clean check --no-daemon --refresh-dependencies --stacktrace

155
Jenkinsfile vendored
View File

@@ -1,155 +0,0 @@
properties([
buildDiscarder(logRotator(numToKeepStr: '10')),
pipelineTriggers([
cron('@daily')
]),
])
def SUCCESS = hudson.model.Result.SUCCESS.toString()
currentBuild.result = SUCCESS
try {
parallel check: {
stage('Check') {
timeout(time: 45, unit: 'MINUTES') {
node('ubuntu1804') {
checkout scm
try {
withEnv(["JAVA_HOME=${tool 'jdk8'}"]) {
sh './gradlew clean check --no-daemon --refresh-dependencies --stacktrace'
}
}
catch (e) {
currentBuild.result = 'FAILED: check'
throw e
}
finally {
junit '**/build/test-results/*/*.xml'
}
}
}
}
},
jdk9: {
stage('JDK 9') {
timeout(time: 45, unit: 'MINUTES') {
node {
checkout scm
try {
withEnv(["JAVA_HOME=${tool 'jdk9'}"]) {
sh './gradlew clean test --no-daemon --refresh-dependencies --stacktrace'
}
}
catch (e) {
currentBuild.result = 'FAILED: jdk9'
throw e
}
}
}
}
},
jdk10: {
stage('JDK 10') {
timeout(time: 45, unit: 'MINUTES') {
node {
checkout scm
try {
withEnv(["JAVA_HOME=${tool 'jdk10'}"]) {
sh './gradlew clean test --no-daemon --refresh-dependencies --stacktrace'
}
}
catch (e) {
currentBuild.result = 'FAILED: jdk10'
throw e
}
}
}
}
},
jdk11: {
stage('JDK 11') {
timeout(time: 45, unit: 'MINUTES') {
node('ubuntu1804') {
checkout scm
try {
withEnv(["JAVA_HOME=${tool 'jdk11'}"]) {
sh './gradlew clean test integrationTest --no-daemon --refresh-dependencies --stacktrace'
}
}
catch (e) {
currentBuild.result = 'FAILED: jdk11'
throw e
}
}
}
}
}
if (currentBuild.result == 'SUCCESS') {
parallel artifacts: {
stage('Deploy Artifacts') {
node {
checkout scm
try {
withCredentials([file(credentialsId: 'spring-signing-secring.gpg', variable: 'SIGNING_KEYRING_FILE')]) {
withCredentials([string(credentialsId: 'spring-gpg-passphrase', variable: 'SIGNING_PASSWORD')]) {
withCredentials([usernamePassword(credentialsId: 'oss-token', passwordVariable: 'OSSRH_PASSWORD', usernameVariable: 'OSSRH_USERNAME')]) {
withCredentials([usernamePassword(credentialsId: '02bd1690-b54f-4c9f-819d-a77cb7a9822c', usernameVariable: 'ARTIFACTORY_USERNAME', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
withEnv(["JAVA_HOME=${tool 'jdk8'}"]) {
sh './gradlew deployArtifacts finalizeDeployArtifacts --no-daemon --refresh-dependencies --stacktrace -Psigning.secretKeyRingFile=$SIGNING_KEYRING_FILE -Psigning.keyId=$SPRING_SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -PossrhUsername=$OSSRH_USERNAME -PossrhPassword=$OSSRH_PASSWORD -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD'
}
}
}
}
}
}
catch (e) {
currentBuild.result = 'FAILED: artifacts'
throw e
}
}
}
},
docs: {
stage('Deploy Docs') {
node {
checkout scm
try {
withCredentials([file(credentialsId: 'docs.spring.io-jenkins_private_ssh_key', variable: 'DEPLOY_SSH_KEY')]) {
withEnv(["JAVA_HOME=${tool 'jdk8'}"]) {
sh './gradlew deployDocs --no-daemon --refresh-dependencies --stacktrace -PdeployDocsSshKeyPath=$DEPLOY_SSH_KEY -PdeployDocsSshUsername=$SPRING_DOCS_USERNAME'
}
}
}
catch (e) {
currentBuild.result = 'FAILED: docs'
throw e
}
}
}
}
}
}
finally {
def buildStatus = currentBuild.result
def buildNotSuccess = !SUCCESS.equals(buildStatus)
def lastBuildNotSuccess = !SUCCESS.equals(currentBuild.previousBuild?.result)
if (buildNotSuccess || lastBuildNotSuccess) {
stage('Notify') {
node {
final def RECIPIENTS = [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']]
def subject = "${buildStatus}: Build ${env.JOB_NAME} ${env.BUILD_NUMBER} status is now ${buildStatus}"
def details = "The build status changed to ${buildStatus}. For details see ${env.BUILD_URL}"
emailext(
subject: subject,
body: details,
recipientProviders: RECIPIENTS,
to: "$SPRING_SESSION_TEAM_EMAILS"
)
}
}
}
}

View File

@@ -1,3 +1,9 @@
[NOTE]
======
This branch of Spring Session has reached its https://github.com/spring-projects/spring-boot/wiki/Supported-Versions[End of Life], meaning that there are no further maintenance releases or security patches planned.
Please migrate to a supported branch as soon as possible.
======
= Spring Session
image:https://travis-ci.org/spring-projects/spring-session.svg?branch=master["Build Status", link="https://travis-ci.org/spring-projects/spring-session"] image:https://badges.gitter.im/spring-projects/spring-session.svg[link="https://gitter.im/spring-projects/spring-session?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]

View File

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

View File

@@ -1 +1 @@
version=2.1.9.RELEASE
version=2.1.14.BUILD-SNAPSHOT

View File

@@ -1,10 +1,10 @@
dependencyManagement {
imports {
mavenBom 'io.projectreactor:reactor-bom:Californium-SR12'
mavenBom 'org.springframework:spring-framework-bom:5.1.10.RELEASE'
mavenBom 'org.springframework.data:spring-data-releasetrain:Lovelace-SR11'
mavenBom 'org.springframework.security:spring-security-bom:5.1.5.RELEASE'
mavenBom 'org.testcontainers:testcontainers-bom:1.12.0'
mavenBom 'io.projectreactor:reactor-bom:Californium-SR21'
mavenBom 'org.springframework:spring-framework-bom:5.1.18.RELEASE'
mavenBom 'org.springframework.data:spring-data-releasetrain:Lovelace-SR20'
mavenBom 'org.springframework.security:spring-security-bom:5.1.12.RELEASE'
mavenBom 'org.testcontainers:testcontainers-bom:1.12.5'
}
dependencies {
@@ -13,20 +13,20 @@ dependencyManagement {
entry 'hazelcast-client'
}
dependency 'com.h2database:h2:1.4.199'
dependency 'com.h2database:h2:1.4.200'
dependency 'com.microsoft.sqlserver:mssql-jdbc:7.4.1.jre8'
dependency 'com.zaxxer:HikariCP:3.4.1'
dependency 'com.zaxxer:HikariCP:3.4.5'
dependency 'edu.umd.cs.mtc:multithreadedtc:1.01'
dependency 'io.lettuce:lettuce-core:5.2.0.RELEASE'
dependency 'javax.annotation:javax.annotation-api:1.3.2'
dependency 'javax.servlet:javax.servlet-api:4.0.1'
dependency 'junit:junit:4.12'
dependency 'mysql:mysql-connector-java:8.0.17'
dependency 'mysql:mysql-connector-java:8.0.21'
dependency 'org.apache.derby:derby:10.14.2.0'
dependency 'org.assertj:assertj-core:3.13.2'
dependency 'org.hsqldb:hsqldb:2.5.0'
dependency 'org.hsqldb:hsqldb:2.5.1'
dependency 'org.mariadb.jdbc:mariadb-java-client:2.4.4'
dependency 'org.mockito:mockito-core:3.0.0'
dependency 'org.postgresql:postgresql:42.2.8'
dependency 'org.postgresql:postgresql:42.2.16'
}
}

View File

@@ -1,6 +1,6 @@
dependencyManagement {
imports {
mavenBom 'com.fasterxml.jackson:jackson-bom:2.10.0'
mavenBom 'com.fasterxml.jackson:jackson-bom:2.10.5'
}
dependencies {
@@ -10,14 +10,14 @@ dependencyManagement {
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.33.0'
dependency 'org.slf4j:jcl-over-slf4j:1.7.28'
dependency 'org.slf4j:log4j-over-slf4j:1.7.28'
dependency 'org.slf4j:jcl-over-slf4j:1.7.30'
dependency 'org.slf4j:log4j-over-slf4j:1.7.30'
dependency 'org.webjars:bootstrap:2.3.2'
dependency 'org.webjars:html5shiv:3.7.3'
dependency 'org.webjars:jquery:1.12.4'
dependency 'org.webjars:knockout:2.3.0'
dependency 'org.webjars:sockjs-client:0.3.4'
dependency 'org.webjars:stomp-websocket:2.3.0'
dependency 'org.webjars:stomp-websocket:2.3.3'
dependency 'org.webjars:webjars-taglib:0.3'
}
}

View File

@@ -15,7 +15,7 @@
<body>
<div class="container">
<h1>Description</h1>
<p>This application demonstrates how to use a Redis instance to back your session. Notice that there is no JSESSIONID cookie. We are also able to customize the way of identifying what the requested session id is.</p>
<p>This application demonstrates how to customize the session cookie. Notice that the name of the cookie is JSESSIONID.</p>
<h1>Try it</h1>

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2018 the original author or authors.
* Copyright 2014-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,9 +16,10 @@
package org.springframework.session.web.http;
import java.time.Clock;
import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Base64;
@@ -62,6 +63,8 @@ public class DefaultCookieSerializer implements CookieSerializer {
domainValid.set('-');
}
private Clock clock = Clock.systemUTC();
private String cookieName = "SESSION";
private Boolean useSecureCookie;
@@ -135,9 +138,9 @@ public class DefaultCookieSerializer implements CookieSerializer {
int maxAge = getMaxAge(cookieValue);
if (maxAge > -1) {
sb.append("; Max-Age=").append(cookieValue.getCookieMaxAge());
OffsetDateTime expires = (maxAge != 0)
? OffsetDateTime.now().plusSeconds(maxAge)
: Instant.EPOCH.atOffset(ZoneOffset.UTC);
ZonedDateTime expires = (maxAge != 0)
? ZonedDateTime.now(this.clock).plusSeconds(maxAge)
: Instant.EPOCH.atZone(ZoneOffset.UTC);
sb.append("; Expires=")
.append(expires.format(DateTimeFormatter.RFC_1123_DATE_TIME));
}
@@ -267,6 +270,10 @@ public class DefaultCookieSerializer implements CookieSerializer {
}
}
void setClock(Clock clock) {
this.clock = clock.withZone(ZoneOffset.UTC);
}
/**
* Sets if a Cookie marked as secure should be used. The default is to use the value
* of {@link HttpServletRequest#isSecure()}.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2018 the original author or authors.
* Copyright 2014-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,9 @@
package org.springframework.session.web.http;
import java.time.Clock;
import java.time.Instant;
import java.time.ZoneOffset;
import java.util.Base64;
import javax.servlet.http.Cookie;
@@ -26,6 +29,7 @@ import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.springframework.http.HttpHeaders;
import org.springframework.mock.web.MockCookie;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
@@ -56,7 +60,7 @@ public class DefaultCookieSerializerTests {
private MockHttpServletRequest request;
private MockHttpServletResponse response;
private CookiePreservingMockHttpServletResponse response;
private DefaultCookieSerializer serializer;
@@ -70,7 +74,7 @@ public class DefaultCookieSerializerTests {
public void setup() {
this.cookieName = "SESSION";
this.request = new MockHttpServletRequest();
this.response = new MockHttpServletResponse();
this.response = new CookiePreservingMockHttpServletResponse();
this.sessionId = "sessionId";
this.serializer = new DefaultCookieSerializer();
this.serializer.setUseBase64Encoding(this.useBase64Encoding);
@@ -232,7 +236,7 @@ public class DefaultCookieSerializerTests {
this.serializer.writeCookieValue(cookieValue(this.sessionId));
assertThat(getCookie().getDomain()).isEqualTo("example.com");
this.response = new MockHttpServletResponse();
this.response = new CookiePreservingMockHttpServletResponse();
}
String[] notMatchingDomains = { "example.com", "localhost", "127.0.0.1" };
@@ -241,7 +245,7 @@ public class DefaultCookieSerializerTests {
this.serializer.writeCookieValue(cookieValue(this.sessionId));
assertThat(getCookie().getDomain()).isNull();
this.response = new MockHttpServletResponse();
this.response = new CookiePreservingMockHttpServletResponse();
}
}
@@ -326,34 +330,41 @@ public class DefaultCookieSerializerTests {
this.serializer.writeCookieValue(cookieValue(this.sessionId));
assertThat(getCookie().getMaxAge()).isEqualTo(-1);
assertThat(this.response.rawCookie).doesNotContain("Expires");
}
@Test
public void writeCookieCookieMaxAgeExplicit() {
this.serializer.setClock(Clock.fixed(Instant.parse("2019-10-07T20:10:00Z"), ZoneOffset.UTC));
this.serializer.setCookieMaxAge(100);
this.serializer.writeCookieValue(cookieValue(this.sessionId));
assertThat(getCookie().getMaxAge()).isEqualTo(100);
assertThat(this.response.rawCookie).contains("Expires=Mon, 7 Oct 2019 20:11:40 GMT");
}
@Test
public void writeCookieCookieMaxAgeExplicitEmptyCookie() {
this.serializer.setClock(Clock.fixed(Instant.parse("2019-10-07T20:10:00Z"), ZoneOffset.UTC));
this.serializer.setCookieMaxAge(100);
this.serializer.writeCookieValue(cookieValue(""));
assertThat(getCookie().getMaxAge()).isEqualTo(0);
assertThat(this.response.rawCookie).contains("Expires=Thu, 1 Jan 1970 00:00:00 GMT");
}
@Test
public void writeCookieCookieMaxAgeExplicitCookieValue() {
this.serializer.setClock(Clock.fixed(Instant.parse("2019-10-07T20:10:00Z"), ZoneOffset.UTC));
CookieValue cookieValue = cookieValue(this.sessionId);
cookieValue.setCookieMaxAge(100);
this.serializer.writeCookieValue(cookieValue);
assertThat(getCookie().getMaxAge()).isEqualTo(100);
assertThat(this.response.rawCookie).contains("Expires=Mon, 7 Oct 2019 20:11:40 GMT");
}
// --- secure ---
@@ -531,4 +542,18 @@ public class DefaultCookieSerializerTests {
return new CookieValue(this.request, this.response, cookieValue);
}
private static class CookiePreservingMockHttpServletResponse extends MockHttpServletResponse {
private String rawCookie;
@Override
public void addHeader(String name, String value) {
if (HttpHeaders.SET_COOKIE.equals(name)) {
this.rawCookie = value;
}
super.addHeader(name, value);
}
}
}

View File

@@ -22,8 +22,8 @@ import com.hazelcast.core.HazelcastInstance;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.testcontainers.containers.BindMode;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.utility.MountableFile;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -50,11 +50,9 @@ public class HazelcastClientRepositoryITests extends AbstractHazelcastRepository
private static GenericContainer container = new GenericContainer<>(
"hazelcast/hazelcast:3.11.4")
.withExposedPorts(5701)
.withEnv("JAVA_OPTS",
"-Dhazelcast.config=/opt/hazelcast/config_ext/hazelcast.xml")
.withClasspathResourceMapping("/hazelcast-server.xml",
"/opt/hazelcast/config_ext/hazelcast.xml",
BindMode.READ_ONLY);
.withCopyFileToContainer(
MountableFile.forClasspathResource("/hazelcast-server.xml"),
"/opt/hazelcast/hazelcast.xml");
@BeforeClass
public static void setUpClass() {