Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
455 changes: 455 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# .git-blame-ignore-revs
# Spotless initial cleanup
a711643b057a1f07f5590cad30d123b7ccadf1b0
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

# Binary files should be left untouched
*.jar binary

51 changes: 32 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
# Compiled class file
*.class
# Copyright 2025-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Log file
*.log
*~

# BlueJ files
*.ctxt
# Mac
.DS_Store

# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Eclipse
/.classpath
/.project
/.settings
/bin/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# Intellij IDEA
/.idea/
/*.ipr
/*.iws
/*.iml
/out/
!/.idea/inspectionProfiles/Project_Default.xml

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
# Gradle
.gradle/
.kotlin/
build/
36 changes: 36 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Contributing to the MongoDB Spring Session extension

Thank you for your interest in contributing to the MongoDB Spring Session extension.

We are building this software together and strongly encourage contributions from the community that are within the guidelines set forth
below.

Bug Fixes and New Features
--------------------------

Before starting to write code, look for existing [tickets](https://jira.mongodb.org/browse/JAVAF) or
[create one](https://jira.mongodb.org/secure/CreateIssue!default.jspa) for your bug, issue, or feature request. This helps the community
avoid working on something that might not be of interest or which has already been addressed.

Pull Requests
-------------

Pull requests should generally be made against the main (default) branch and include relevant tests, if applicable.

Code should compile with the Java 17 compiler and tests should pass under all Java versions which the driver currently
supports.

The results of pull request testing will be appended to the request. If any tests do not pass, or relevant tests are not included, the
pull request will not be considered.

To run all checks locally run:

```console
./gradlew clean check
```

Talk To Us
----------

If you want to work on something or have questions / complaints please reach out to us by creating a Question issue at
(https://jira.mongodb.org/secure/CreateIssue!default.jspa).
113 changes: 112 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,112 @@
# mongo-spring-session
# MongoDB Spring Session extension

This product enables applications to use [Spring Session](https://spring.io/projects/spring-session)
with [MongoDB](https://www.mongodb.com/) and provides a `SessionRepository` implementation backed
by MongoDB using [Spring Data MongoDB](https://spring.io/projects/spring-data-mongodb).

## Overview

Spring Session provides an API and implementations for managing a user's session information,
while also making it trivial to support clustered sessions without being tied to an application container
specific solution. It also provides transparent integration with:

* `HttpSession` - allows replacing the `HttpSession` in an application container (i.e. Tomcat) neutral way, with support for providing session IDs in headers to work with RESTful APIs.
* `WebSocket` - provides the ability to keep the `HttpSession` alive when receiving WebSocket messages
* `WebSession` - allows replacing the Spring WebFlux's `WebSession` in an application container neutral way.

## Migrating from `spring-session-data-mongodb`
Todo..

## Support / Feedback

For issues with, questions about, or feedback for the MongoDB Java, Kotlin, and Scala drivers, please look into
our [support channels](https://www.mongodb.com/docs/manual/support/). Please
do not email any of the driver developers directly with issues or
questions - you're more likely to get an answer on [StackOverflow](https://stackoverflow.com/questions/tagged/mongodb+java).

At a minimum, please include in your description the exact version of the driver that you are using. If you are having
connectivity issues, it's often also useful to paste in the line of code where you construct the MongoClient instance,
along with the values of all parameters that you pass to the constructor. You should also check your application logs for
any connectivity-related exceptions and post those as well.

## Bugs / Feature Requests

Think you’ve found a bug? Want to see a new feature in the drivers? Please open a
case in our issue management tool, JIRA:

- [Create an account and login](https://jira.mongodb.org).
- Navigate to [the JAVA Frameworks project](https://jira.mongodb.org/browse/JAVAF).
- Click **Create Issue** - Please provide as much information as possible about the issue type, which driver you are using, and how to reproduce your issue.

Bug reports in JIRA for the extension and the Core Server (i.e. SERVER) project are **public**.

If you’ve identified a security vulnerability in a driver or any other
MongoDB project, please report it according to the [instructions here](https://www.mongodb.com/docs/manual/tutorial/create-a-vulnerability-report).

## Versioning

We follow [semantic versioning](https://semver.org/spec/v2.0.0.html) when releasing.

## Binaries

Binaries and dependency information for Maven, Gradle, Ivy and others can be found at
[https://central.sonatype.com/search](https://central.sonatype.com/search?namespace=org.mongodb&name=mongodb-driver-sync).

Example for Maven:

```xml
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-spring-session</artifactId>
<version>x.y.z</version>
</dependency>
```
Snapshot builds are also published regulary via Sonatype.

Example for Maven:

```xml
<repositories>
<repository>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
```

### Testing

This project uses separate directories for unit and integration tests:

- [unit test](src/test)
- [integration test](src/integrationTest)

#### Gradle Tasks

##### All checks
```console
./gradlew clean check
```

##### Unit Tests only
```console
./gradlew clean test
```

##### Integration Tests only
```console
./gradlew clean integrationTest
```

Integration tests require a MongoDB deployment to be available

### CI/CD
This project uses [evergreen](https://github.com/evergreen-ci/evergreen), a distributed continuous integration system from MongoDB.
The evergreen configuration is in the [.evergreen](/.evergreen) directory.
Loading