-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Config and JaxRsContext injection
- Introduce JaxRsConfig for extra configurations for the SecurityFilter - Add more null checks
- Loading branch information
1 parent
57955ed
commit 08e40de
Showing
20 changed files
with
182 additions
and
126 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/java/org/pac4j/jax/rs/features/JaxRsConfigProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.pac4j.jax.rs.features; | ||
|
||
import javax.ws.rs.ext.ContextResolver; | ||
|
||
import org.pac4j.core.config.Config; | ||
|
||
/** | ||
* | ||
* This class can be used to inject the pac4j {@link Config} in the JAX-RS runtime. | ||
* | ||
* @author Victor Noel - Linagora | ||
* @since 2.0.0 | ||
*/ | ||
public class JaxRsConfigProvider implements ContextResolver<Config> { | ||
|
||
private final Config config; | ||
|
||
public JaxRsConfigProvider(Config config) { | ||
this.config = config; | ||
} | ||
|
||
@Override | ||
public Config getContext(Class<?> type) { | ||
return config; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.