Comments (11)
iirc : simply declare Session
as parameter of your method, and use it.
from nubes.
Nope. the method throws a null pointer exception for Session
. I tried both, with and without explicitly setting a SessionHandler
on the router. I could see in the nubes code that CookieHandler
is being set but could not find anywhere in the code where a SessionHandler
is being set. Is there an example i can use?
from nubes.
I'll have a look tomorrow. Auth/Session is the only part of the code I didn't write myself.
(the only place a sessionhandler is set is when you're using an auth provider)
from nubes.
"Version 1.1 should be available shortly" according to bintray.
You should be able to use the Session as a method parameter even though you're not using a built-in authentication mechanism.
Let me know if it suits your needs or not :)
from nubes.
Couple of things:
- I marked one of my controller methods with
Auth
annotation and other one was not marked. I did not provide anyAuthProvider
. Both paths were served. I was expecting it to throw an exception. Dont know if this is the way it should be - I provided a
ShiroAuth
provider ( as this is what i want to use in my app ).- For the path not marked with
Auth
annotation, cookievertx-web.session
was not returned in response - For the path marked with
Auth
annotation, cookievertx-web.session
was correctly returned in response, however, re-visiting the unmarked path, the cookie was again not returned
- For the path not marked with
- Is there any other way to provide
authProvider
orVertxNubes.setAuthProvider
is the correct way
So my needs ( just to elaborate: would be happy to help, let me know)
- There should be an annotation way to tell this web app is session cookie enabled with or without auth . And once mentioned, all paths should be able to return
vertx-web.session
in response without explicitly mentioning so - There should be a annotation way to configure an
AuthProvider
. Not a big issue to useset
but for a library promoting Annotation, this would be more in tune :) - If there are paths which are marked with
@Auth
if there is noAuthProvider
set then it should throw an exception rather making the path unsecured.
Later today I will try to update the code which can highlight these issues for you
from nubes.
OK. I'll try to rework the auth part completely.
I'm not using it myself (since I've always been using using custom authentication services) and as I mentionned earlier, I did not write this part of the code. I'm not happy with the way it's configured, too.
So I guess it's time (and OAuth2 support coming in vert.x 3.2 has to be added, too) to rewrite this part of Nubes properly.
For the cookie thing, I'll try to create a standard vertx-web app with an authenticated and a public route but I think the problem doesn't lie within Nubes.
I'll try to rethink everything related to auth from scratch. Again, that's not that easy since I've never used it myself.
from nubes.
And may be a login and logout handler annotation on a controller method because nubes is injecting the AuthProvider
which is needed by the FormLoginHanlder
from nubes.
Would you be taking this up soon? Or can I get started on a fork?
from nubes.
I'm in the middle of a move to another city, which means (aside a very very busy schedule) I probably won't be connected to the internet in the upcoming weeks.
If you feel like working on a fork, the licence allows it, so feel free, np at all,
I'll give it a look and help you as soon as I'm able to.
from nubes.
I will need some opinion! Don't to digress away from the library's core philosophy.
For sessions, I am planning to add a type annotation SessionEnabled
toVertxNubes
and NubesServer
. So a SessionHandler
will be set on all routes if initialized as @SessionEnabled VertxNubes nubes = ...
Does it seem ok?
from nubes.
That sounds good on a philosophical point of view :)
.Be careful with the implementation though, I guess if a route is already annotated with auth-realated stuff, the sessionhandler will be attached to the route (be careful you don't attach it twice in that case ;) )
Also, there are a ton of unit tests, you can run them to make sure you didn't break anything (there's ~85-90% code coverage). And also, make sure you compile the tests with the -parameters
options (if you run them in your IDE for example) or some tests won't work.
Have fun :)
from nubes.
Related Issues (20)
- Could not get my controller method to execute HOT 4
- Use composable futures instead of MultipleFutures HOT 1
- vertx 3.2.1 support HOT 1
- Use attribute name for service name resolution
- Support RxJava observables
- Use JSR 303 for bean validation
- Do you guys support RateLimiter or something similar HOT 1
- Start VertxNubes HOT 2
- java.lang.ClassNotFoundException: io.vertx.codegen.annotations.ProxyGen HOT 2
- Session object HOT 3
- Parameter adapter for Boolean.class HOT 1
- Suggestion: consider using FastClasspathScanner to find annotations HOT 4
- Use a functional approach
- i love you HOT 5
- nubes session error HOT 9
- How can I use this with JWT? HOT 16
- Vert.x version parity HOT 12
- FastClasspathScanner is outdated -- consider porting to ClassGraph
- Chinese scrambling HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nubes.