-
Notifications
You must be signed in to change notification settings - Fork 28
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
b.o.d.j.u.RequestUtils - Error getting subject: Futures timed out after [2000 milliseconds] #8
Comments
This is the reason I changed the signature of getSubject in 2.3.3 to return a Subject and not a promise. You're using 2.3.2, I guess? |
Yes, I will update. But I got the following error when rewriting the getSubject method.
MyDynamicResourceHandler looks like this. public boolean isAllowed(final String name, final String meta, final DeadboltHandler deadboltHandler, final Http.Context ctx) {
final DynamicResourceHandler handler = HANDLERS.get(name);
// return deadboltHandler.getSubject(ctx).map(
// new F.Function<Subject, Boolean>() {
// @Override
// public Boolean apply(Subject subject) throws Throwable {
if(meta.isEmpty()) return true;
Subject subject = deadboltHandler.getSubject(ctx);
// Check if permission pattern applied as meta is allowed!
if(!DeadboltAnalyzer.checkPatternEquality(subject, meta)) {
Logger.debug(String.format("Access failed to %s", meta));
return false;
}
boolean result = false;
if (handler == null) {
Logger.error("No handler available for " + name);
} else {
result = handler.isAllowed(name, meta, deadboltHandler, ctx);
}
return result;
// }
// }
// ).get(1, TimeUnit.SECONDS);
} |
DeadboltAnalyzer's methods are not static any more, because people were asking for DI support. You can declare a static DeadboltAnalyzer in your MyDynamicResourceHandler class and reference that instead. |
Thanks! Then it will hopefully work without the errors now then. |
No further issues reported on this topic. |
I get this error all the time now.
I guess that it's caused by my getSubject method, but I have timed "Application.getLoggedOnUser()" and it takes 14-27ms so it couldn't be that I guess. So what could cause this?
My getSubject method looks like this.
The text was updated successfully, but these errors were encountered: