-
Notifications
You must be signed in to change notification settings - Fork 21
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
[WIP] Update pac4j-core to version 6.1.1 #611
base: master
Are you sure you want to change the base?
Conversation
Hi @leleuj |
context.getAbsolutePath(defaultUrl, false), renewSession, defaultClient); | ||
protected void filter(Config config, ContainerRequestContext requestContext) throws IOException { | ||
JaxRsFrameworkParameters frameworkParameters = new JaxRsFrameworkParameters(providers, requestContext); | ||
buildLogic(config).perform(config, getAbsolutePath(requestContext, defaultUrl, false), renewSession, defaultClient, frameworkParameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this was already missing, but I think we also need: FrameworkAdapter.INSTANCE.applyDefaultSettingsIfUndefined(config);
in the callback as well as in the logout and security filter.
localLogout, destroySession, centralLogout); | ||
protected void filter(Config config, ContainerRequestContext requestContext) throws IOException { | ||
JaxRsFrameworkParameters frameworkParameters = new JaxRsFrameworkParameters(providers, requestContext); | ||
buildLogic(config).perform(config, defaultUrl, getAbsolutePath(requestContext, logoutUrlPattern, false), localLogout, destroySession, centralLogout, frameworkParameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same feedback here
|
||
// Note: basically, there is two possible outcomes: | ||
// either the access is granted or there was an error or a redirect! | ||
// For the former, we do nothing (see SecurityGrantedAccessOutcome comments) | ||
// For the later, we interpret the error and abort the request using jax-rs | ||
// abstractions | ||
buildLogic(config).perform(context, sessionStore, config, new SecurityGrantedAccessOutcome(), adapter(config), | ||
clients, authorizers, matchers); | ||
buildLogic(config).perform(config, new SecurityGrantedAccessOutcome(), clients, authorizers, matchers, frameworkParameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same again here: the FrameworkAdapter.INSTANCE.applyDefaultSettingsIfUndefined(config);
is only in the AbstractFilter
, is it really used here? It's an initialization call which should be done "everywhere".
import org.pac4j.core.context.FrameworkParameters; | ||
import org.pac4j.jax.rs.helpers.ProvidersContext; | ||
|
||
public class JaxRsFrameworkParameters implements FrameworkParameters { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some Javadoc (even obvious).
@@ -79,8 +79,8 @@ | |||
</scm> | |||
|
|||
<properties> | |||
<pac4j.version>5.7.7</pac4j.version> | |||
<java.version>11</java.version> | |||
<pac4j.version>6.1.1</pac4j.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we upgrade pac4j release but we should also upgrade the version of library itself: v7.0.0-SNAPSHOT.
The README should be updated as well.
Please find a few feedbacks to help you in the migration process. Notice that the wiki: https://github.com/pac4j/jax-rs-pac4j/wiki will also need some updates (later on). |
This PR is to update the jax-rs-pac4j project to be compatible with pac4j-core version 6.1.1
Changes:
WebContextFactory
implementation (calledDefaultJaxRsWebContextFactory
) which plugs into the existingJaxRsContextFactoryProvider
- required by new pac4j frameworkSessionStoreFactory
implementations (calledJaxRsSessionStoreFactory
,GrizzlySessionStoreFactory
andServletSessionStoreFactory
) - required by new pac4j frameworkFrameworkParameters
calledJaxRsFrameworkParameters
- required by new pac4j frameworkPac4jFeature
(renamed toPac4jDefaultFeature
). Implementation of Pac4J feature subclasses still have the same nameAbstractFilter#filter(JaxRsContext)
toAbstractFilter#filter(Config,ContainerRequestContext)
FrameworkAdapter.INSTANCE.applyDefaultSettingsIfUndefined(config)
statement toAbstractFilter#filter(ContainerRequestContext)
adapt
method inCallbackFilter
as this is handled byDefaultJaxRsHttpActionAdapter
and called withinDefeaultSecurityLogic