-
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.
Merge pull request #16 from victornoel/issue-15-config-http-action-ad…
…apter Exploit Config's HttpActionAdapter
- Loading branch information
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
src/main/java/org/pac4j/jax/rs/filters/JaxRsHttpActionAdapter.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,22 @@ | ||
package org.pac4j.jax.rs.filters; | ||
|
||
import org.pac4j.core.http.HttpActionAdapter; | ||
import org.pac4j.jax.rs.pac4j.JaxRsContext; | ||
|
||
/** | ||
* | ||
* @author Victor Noel - Linagora | ||
* @since 1.1.1 | ||
* | ||
*/ | ||
public class JaxRsHttpActionAdapter implements HttpActionAdapter<Object, JaxRsContext> { | ||
|
||
public static final JaxRsHttpActionAdapter INSTANCE = new JaxRsHttpActionAdapter(); | ||
|
||
@Override | ||
public Object adapt(int code, JaxRsContext context) { | ||
context.getRequestContext().abortWith(context.getAbortBuilder().build()); | ||
return null; | ||
} | ||
|
||
} |