@Provider @Priority(value=2000) public class WebAcFilter extends Object implements ContainerRequestFilter, ContainerResponseFilter
ContainerRequestFilter
that implements WebAC-based authorization.Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_WEBAC_APPENDABLE_METHODS
The configuration key controlling with HTTP methods should apply to the acl:Append.
|
static String |
CONFIG_WEBAC_CHALLENGES
The configuration key controlling which WWW-Authenticate challenges are provided on 401 errors.
|
static String |
CONFIG_WEBAC_READABLE_METHODS
The configuration key controlling with HTTP methods should apply to the acl:Read.
|
static String |
CONFIG_WEBAC_REALM
The configuration key controlling the realm used in a WWW-Authenticate header, or 'trellis' by default.
|
static String |
CONFIG_WEBAC_SCOPE
The configuration key controlling the scope(s) used in a WWW-Authenticate header.
|
static String |
CONFIG_WEBAC_WRITABLE_METHODS
The configuration key controlling with HTTP methods should apply to the acl:Write.
|
Constructor and Description |
---|
WebAcFilter()
For use with RESTeasy and CDI proxies.
|
WebAcFilter(WebAcService accessService)
Create a new WebAc-based auth filter.
|
WebAcFilter(WebAcService accessService,
List<String> challengeTypes,
String realm,
String scope,
String baseUrl)
Create a WebAc-based auth filter.
|
Modifier and Type | Method and Description |
---|---|
void |
filter(ContainerRequestContext ctx) |
void |
filter(ContainerRequestContext req,
ContainerResponseContext res) |
public static final String CONFIG_WEBAC_CHALLENGES
Multiple challenges should be separated with commas.
public static final String CONFIG_WEBAC_READABLE_METHODS
Values defined here will be in addition to GET, HEAD and OPTIONS. Multiple methods should be separated with commas.
public static final String CONFIG_WEBAC_WRITABLE_METHODS
Values defined here will be in addition to GET, HEAD and OPTIONS. Multiple methods should be separated with commas.
public static final String CONFIG_WEBAC_APPENDABLE_METHODS
Values defined here will be in addition to GET, HEAD and OPTIONS. Multiple methods should be separated with commas.
public static final String CONFIG_WEBAC_REALM
public static final String CONFIG_WEBAC_SCOPE
public WebAcFilter()
@Inject public WebAcFilter(WebAcService accessService)
accessService
- the access servicepublic WebAcFilter(WebAcService accessService, List<String> challengeTypes, String realm, String scope, String baseUrl)
accessService
- the access servicechallengeTypes
- the WWW-Authenticate challenge typesrealm
- the authentication realmscope
- the authentication scopebaseUrl
- the base URL, may be nullpublic void filter(ContainerRequestContext ctx)
filter
in interface ContainerRequestFilter
public void filter(ContainerRequestContext req, ContainerResponseContext res)
filter
in interface ContainerResponseFilter