-
Notifications
You must be signed in to change notification settings - Fork 194
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
Add filesystem store backend #251
base: master
Are you sure you want to change the base?
Conversation
I just came into this PR because I implemented the store based on gorilla/sessions Is this PR (should fix #182) being considered? |
@geschke Please help to take a look build fails. |
Perhaps I misunderstood how the test file is meant to be applied. I attempted to run the tests locally, but encountered errors when using the commands specified in the
This works fine when I run
But it fails with the go test command in When I remove the
Please provide guidance on how to proceed. Should I commit the mentioned changes? Unfortunately, I seem unable to run the tests in my GitHub repository; perhaps I've overlooked something here. Thanks in advance & |
When testing the sessions middleware, I realized that a filesystem store was missing, which is the default in PHP. Upon examining the underlying Gorilla sessions library, I discovered an experimental implementation of a filesystem store. Despite its experimental status, it performed well in my tests when integrated into a Gin application using pure Gorilla sessions.
To support the Gorilla FilesystemStore, I added the necessary code in a filesystem backend module, provided by this pull request.
While testing the filesystem module, I noticed discrepancies in the test files for the backend modules. For instance, the
cookie_test.go
file didn't work as expected - the function "NewStore()
" was missing. After modifying it to "cookie.NewStore()
" and importing the "gin-contrib/sessions/cookie
" module, the test ran successfully with the command "go test cookie/cookie_test.go
". I didn't make changes to another module in this pull request, since I'm not very experienced with the Golang test system. Please correct me if I'm mistaken.In the "
filesystem_test.go
" file, which is essentially a modified copy of the cookie test, I used the function "filesystem.NewStore()
", and the tests ran successfully in my environment. However, the test revealed an issue with theOptions
settings in the FilesystemStore of the Gorilla sessions module version 1.2.1, used in this library. This problem has been resolved in the current version, 1.2.2, so I updated the version number ingo.mod
.I would appreciate it if you could merge this pull request, as I believe the addition of the filesystem store is valuable, particularly for development and testing purposes.
Thanks in advance &
Kind regards,
Ralf