Package ch.tocco.nice2.web.core.api.auth
Class SecureSettings
java.lang.Object
ch.tocco.nice2.web.core.api.auth.SecureSettings
-
Constructor Summary
ConstructorDescriptionSecureSettings
(RunEnvironmentService runEnvironmentService, boolean neverRequireSecureConnection) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkSecuredConnection
(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) Checks the request whether it originates from a secure connection.static boolean
isSecure
(jakarta.servlet.http.HttpServletRequest req) Checks whether the request reached this servlet using a secure connection.
-
Constructor Details
-
SecureSettings
public SecureSettings(RunEnvironmentService runEnvironmentService, @Value("${nice2.web.core.neverRequireSecureConnection}") boolean neverRequireSecureConnection)
-
-
Method Details
-
checkSecuredConnection
public void checkSecuredConnection(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws SendErrorException, IOException Checks the request whether it originates from a secure connection. If not and it has been defined as required (the default), an HTTP 400 (bad request) error is sent as response. If the request originates from a secure connection or this is configured to be not required, this method is a noop.- Throws:
SendErrorException
IOException
-
isSecure
public static boolean isSecure(jakarta.servlet.http.HttpServletRequest req) Checks whether the request reached this servlet using a secure connection.
-