Top Description Fields Constructors Methods
io.undertow.servlet.handlers.security

public Class ServletConfidentialityConstraintHandler

extends SinglePortConfidentialityHandler
Class Inheritance
Static Imports
io.undertow.servlet.UndertowServletMessages.MESSAGES

Servlet specific extension to SinglePortConfidentialityHandler
Author
Darran Lofthouse

Field Summary

Modifier and TypeField and Description
private final ConfidentialPortManager

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
confidentialityRequired(HttpServerExchange
- The HttpServerExchange for the request being processed.
exchange
)

Overrides io.undertow.security.handlers.AbstractConfidentialityHandler.confidentialityRequired.

Use the HttpServerExchange to identify if confidentiality is required.

protected URI
getRedirectURI(HttpServerExchange
- The HttpServerExchange for the request being processed.
exchange
)

Overrides io.undertow.security.handlers.SinglePortConfidentialityHandler.getRedirectURI.

All sub-classes are required to provide an implementation of this method, using the HttpServerExchange for the current request return the address to use for a redirect should confidentiality be required and the request not be confidential.

public void
protected boolean

Returns:

true if the request is 'sufficiently' confidential, false otherwise.
isConfidential
(final HttpServerExchange
- The HttpServerExchange for the request being processed.
exchange
)

Overrides io.undertow.security.handlers.AbstractConfidentialityHandler.isConfidential.

Use the HttpServerExchange supplied to check if this request is already 'sufficiently' confidential.

Inherited from io.undertow.security.handlers.SinglePortConfidentialityHandler:
getRedirectURI

Field Detail

portManagerback to summary
private final ConfidentialPortManager portManager

Constructor Detail

ServletConfidentialityConstraintHandlerback to summary
public ServletConfidentialityConstraintHandler(final ConfidentialPortManager portManager, final HttpHandler next)

Method Detail

confidentialityRequiredback to summary
protected boolean confidentialityRequired(HttpServerExchange exchange)

Overrides io.undertow.security.handlers.AbstractConfidentialityHandler.confidentialityRequired.

Doc from io.undertow.security.handlers.AbstractConfidentialityHandler.confidentialityRequired.

Use the HttpServerExchange to identify if confidentiality is required. This method currently returns true for all requests, sub-classes can override this to provide a custom check.

Todo

we should deprecate this and just use a predicate to decide to execute the handler instead

Parameters
exchange:HttpServerExchange

- The HttpServerExchange for the request being processed.

Returns:boolean

true if the request requires confidentiality, false otherwise.

Annotations
@Override
getRedirectURIback to summary
protected URI getRedirectURI(HttpServerExchange exchange) throws URISyntaxException

Overrides io.undertow.security.handlers.SinglePortConfidentialityHandler.getRedirectURI.

Doc from io.undertow.security.handlers.AbstractConfidentialityHandler.getRedirectURI.

All sub-classes are required to provide an implementation of this method, using the HttpServerExchange for the current request return the address to use for a redirect should confidentiality be required and the request not be confidential.

Parameters
exchange:HttpServerExchange

- The HttpServerExchange for the request being processed.

Returns:URI

The URI to redirect to.

Annotations
@Override
handleRequestback to summary
public void handleRequest(HttpServerExchange exchange) throws Exception

Overrides io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest.

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
isConfidentialback to summary
protected boolean isConfidential(final HttpServerExchange exchange)

Overrides io.undertow.security.handlers.AbstractConfidentialityHandler.isConfidential.

Use the HttpServerExchange supplied to check if this request is already 'sufficiently' confidential. Here we say 'sufficiently' as sub-classes can override this and maybe even go so far as querying the actual SSLSession.

Parameters
exchange:HttpServerExchange

- The HttpServerExchange for the request being processed.

Returns:boolean

true if the request is 'sufficiently' confidential, false otherwise.