-
Notifications
You must be signed in to change notification settings - Fork 1.1k
MongoSession should be public
#2217
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
Comments
Any chance to get at least a short answer about your thoughts / plans or vision with this? would be great! |
Hi @EugenMayer, I plan to review the issues in Spring Session and prioritize them in the next few weeks. It may take some time but eventually, this issue will be analyzed. I appreciate your patience. |
@marcusdacoregio is there any rough timeline on how this will be moving? The reason i ask is, this is the one blocker for us moving to sb 3.0 and right now there is no possible work-arround at all for us (besides forking, which would be a horrible option). So having somewhat an idea here, what this is going to move to, would be awesome! |
As a workaround I use Spring 3 for the project itself and dependencies except for this one I use version 2.7. I think it's kind of a bad practice for security, but it works |
@Georglider thank you for the idea. Not an option for us here, but thank you for sharing. I assume you are also hindered by the same issue i describe above then? |
Yes, because of this change I can't directly change attributes and hook into existing mongoIndexedSessionRepository as I did in the older version |
Hi @vpavic, can you provide us with some insights into those changes? It seems to me that
There is no way to provide such an implementation with Do you recommend any workaround or is there anything that we are missing? |
Hi @EugenMayer, are you able to provide more details on why you need to customize the |
@marcusdacoregio we moved away from MongoSession entirely due to this reasons here, so we have no need / motivated for the progress here. We planed to auther fork the mongosession part but decided that the long term effort is not worth it. I think the reasons we had are outlined above okish, not going to dig this up 6 months later again, sorry. Maybe someone else is a better ref for you here. Thanks for following up |
Understood @EugenMayer, I'll close this for now since I feel that I lack more detail about why that is needed. If someone else has the same problem feel free to add the details here and we might reopen the issue. |
Hello @marcusdacoregio, I want to create custom session converter so attributes can be stored different (not in binary format). This way I can change data in database very efficiently. Is there any workaround for this except older version? Or maybe there's a better way of changing attribute for a session in binary way? |
Description Issue Example Code @Override
protected @NonNull DBObject convert(@NonNull final MongoSession source) {
return super.convert(source);
}
@Override
protected @Nullable MongoSession convert(@NonNull final Document source) {
try {
return super.convert(source);
} catch (final InvalidMongoSessionDocumentException e) {
final MongoSession mongoSession = new MongoSession();
mongoSession.setExpireAt(new Date(0));
return mongoSession;
}
} Expected Behavior Current Behavior Is there any workaround? |
Hi, folks. Since we have allowed a similar customization on the Redis support I think we should at least make the It feels weird that we have a public API that exposes the package-private |
public
You happened to notice this just right now? I was wrong and broken since the issue was created #2217 (comment) and what you now write is 'Since redis does the right thing now, we also should do the right thing'. There are 0 new information's or facts today, it all has been discussed and should have been instantly fixed exactly 1 year ago. But well, this issue has it's birthday today, so maybe this caused the re-thinking. Seriously, this issue is good for a lough at least. /rant over |
Hi, @EugenMayer. I am sorry that you feel frustrated about this. You are always free to provide your implementation to workaround some issues while they can have a proper fix, it may not feel optimal, but it is a great alternative. I also asked you 6 months ago for more details about the issue to help us get more reasons to revert the decision made to change it to package-private. That all said, I understand your frustration, I hope that you understand that there is more than just changing the code. |
Hi, guys
![]() Current version doesn't let developer to make it this way |
Hi @frct1. Your |
Hi,
|
This change has impacted my team as well, we use the mongo session to update users authorities in real time without the user needing to log out and back in |
how do I implement this? MongoSession is underlined in red in my IDE
|
With #2170 MongoSession was made package private.
The problem with that is, that if someone, as we do, implements
AbstractMongoSessionConverter
to support customconvert
implementations (for DBObject and back), it becomes no longer possible.Interestingly
AbstractMongoSessionConverter
ispublic
andabstract
, so it is intended to implement it. In addition,convert
is protected, not private. So it is intended that one can override it.But due to MongoSession being
package private
this is no longer possible and i'am yet unware on how to workaround this limitation.AFAIR with this new limitation spring session requires, that the MongoDB session strucuture is exactly what the developers first though of, without any ability to adopt it.
That being said, it's odd to see that at the same time
AbstractMongoSessionConverter
being abstract and not implementingconvert
at all, this detail is "left open". On can either useJacksonMongoSessionConverter
orJdkMongoSessionConverter
and that's about it.Could someone explain why this limitation is important / what the rational is introducing this limitation in the first place?
Also i would love to understand why this public to package private change is by no means reflected in the https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#embedded-mongodb changlog guide? Is it really so unimportant?
Thank you!
The text was updated successfully, but these errors were encountered: