Class JakartaSecurityManager

java.lang.Object
cloud.piranha.security.jakarta.JakartaSecurityManager
All Implemented Interfaces:
cloud.piranha.webapp.api.SecurityManager

public class JakartaSecurityManager extends Object implements cloud.piranha.webapp.api.SecurityManager
SecurityManager implementation that uses Jakarta Security semantics. WIP!
Author:
Arjan Tijms
  • Nested Class Summary

    Nested classes/interfaces inherited from interface cloud.piranha.webapp.api.SecurityManager

    cloud.piranha.webapp.api.SecurityManager.AuthenticateSource, cloud.piranha.webapp.api.SecurityManager.UsernamePasswordLoginHandler
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    authenticate​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    boolean
    authenticate​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, cloud.piranha.webapp.api.SecurityManager.AuthenticateSource source)
     
    void
    declareRoles​(String[] roles)
     
    void
     
    jakarta.servlet.http.HttpServletRequest
    getAuthenticatedRequest​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    jakarta.servlet.http.HttpServletResponse
    getAuthenticatedResponse​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    protected org.omnifaces.eleos.services.DefaultAuthenticationService
    getAuthenticationService​(jakarta.servlet.http.HttpServletRequest request)
     
    protected org.omnifaces.exousia.AuthorizationService
    getAuthorizationService​(jakarta.servlet.http.HttpServletRequest request)
     
    boolean
     
     
    cloud.piranha.webapp.api.WebApplication
     
    boolean
    isCallerAuthorizedForResource​(jakarta.servlet.http.HttpServletRequest request)
     
    boolean
    isRequestedResourcePublic​(jakarta.servlet.http.HttpServletRequest request)
     
    boolean
    isRequestSecurityAsRequired​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    boolean
    isUserInRole​(jakarta.servlet.http.HttpServletRequest request, String role)
     
    void
    login​(jakarta.servlet.http.HttpServletRequest request, String username, String password)
     
    void
    logout​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    void
    postRequestProcess​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    void
    setDenyUncoveredHttpMethods​(boolean denyUncoveredHttpMethods)
     
    void
    setUsernamePasswordLoginHandler​(cloud.piranha.webapp.api.SecurityManager.UsernamePasswordLoginHandler usernamePasswordLoginHandler)
     
    void
    setWebApplication​(cloud.piranha.webapp.api.WebApplication webApplication)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JakartaSecurityManager

      public JakartaSecurityManager()
  • Method Details

    • declareRoles

      public void declareRoles(String[] roles)
      Specified by:
      declareRoles in interface cloud.piranha.webapp.api.SecurityManager
    • declareRoles

      public void declareRoles(Collection<String> roles)
      Specified by:
      declareRoles in interface cloud.piranha.webapp.api.SecurityManager
    • getRoles

      public Set<String> getRoles()
      Specified by:
      getRoles in interface cloud.piranha.webapp.api.SecurityManager
    • isRequestSecurityAsRequired

      public boolean isRequestSecurityAsRequired(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException
      Specified by:
      isRequestSecurityAsRequired in interface cloud.piranha.webapp.api.SecurityManager
      Throws:
      IOException
      jakarta.servlet.ServletException
    • isRequestedResourcePublic

      public boolean isRequestedResourcePublic(jakarta.servlet.http.HttpServletRequest request)
      Specified by:
      isRequestedResourcePublic in interface cloud.piranha.webapp.api.SecurityManager
    • isCallerAuthorizedForResource

      public boolean isCallerAuthorizedForResource(jakarta.servlet.http.HttpServletRequest request)
      Specified by:
      isCallerAuthorizedForResource in interface cloud.piranha.webapp.api.SecurityManager
    • isUserInRole

      public boolean isUserInRole(jakarta.servlet.http.HttpServletRequest request, String role)
      Specified by:
      isUserInRole in interface cloud.piranha.webapp.api.SecurityManager
    • authenticate

      public boolean authenticate(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException
      Specified by:
      authenticate in interface cloud.piranha.webapp.api.SecurityManager
      Throws:
      IOException
      jakarta.servlet.ServletException
    • authenticate

      public boolean authenticate(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, cloud.piranha.webapp.api.SecurityManager.AuthenticateSource source) throws IOException, jakarta.servlet.ServletException
      Specified by:
      authenticate in interface cloud.piranha.webapp.api.SecurityManager
      Throws:
      IOException
      jakarta.servlet.ServletException
    • login

      public void login(jakarta.servlet.http.HttpServletRequest request, String username, String password) throws jakarta.servlet.ServletException
      Specified by:
      login in interface cloud.piranha.webapp.api.SecurityManager
      Throws:
      jakarta.servlet.ServletException
    • getAuthenticatedRequest

      public jakarta.servlet.http.HttpServletRequest getAuthenticatedRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Specified by:
      getAuthenticatedRequest in interface cloud.piranha.webapp.api.SecurityManager
    • getAuthenticatedResponse

      public jakarta.servlet.http.HttpServletResponse getAuthenticatedResponse(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Specified by:
      getAuthenticatedResponse in interface cloud.piranha.webapp.api.SecurityManager
    • postRequestProcess

      public void postRequestProcess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException
      Specified by:
      postRequestProcess in interface cloud.piranha.webapp.api.SecurityManager
      Throws:
      IOException
      jakarta.servlet.ServletException
    • logout

      public void logout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException
      Specified by:
      logout in interface cloud.piranha.webapp.api.SecurityManager
      Throws:
      jakarta.servlet.ServletException
    • getWebApplication

      public cloud.piranha.webapp.api.WebApplication getWebApplication()
      Specified by:
      getWebApplication in interface cloud.piranha.webapp.api.SecurityManager
    • setWebApplication

      public void setWebApplication(cloud.piranha.webapp.api.WebApplication webApplication)
      Specified by:
      setWebApplication in interface cloud.piranha.webapp.api.SecurityManager
    • setUsernamePasswordLoginHandler

      public void setUsernamePasswordLoginHandler(cloud.piranha.webapp.api.SecurityManager.UsernamePasswordLoginHandler usernamePasswordLoginHandler)
      Specified by:
      setUsernamePasswordLoginHandler in interface cloud.piranha.webapp.api.SecurityManager
    • getAuthenticationService

      protected org.omnifaces.eleos.services.DefaultAuthenticationService getAuthenticationService(jakarta.servlet.http.HttpServletRequest request)
    • getAuthorizationService

      protected org.omnifaces.exousia.AuthorizationService getAuthorizationService(jakarta.servlet.http.HttpServletRequest request)
    • getDenyUncoveredHttpMethods

      public boolean getDenyUncoveredHttpMethods()
      Specified by:
      getDenyUncoveredHttpMethods in interface cloud.piranha.webapp.api.SecurityManager
    • setDenyUncoveredHttpMethods

      public void setDenyUncoveredHttpMethods(boolean denyUncoveredHttpMethods)
      Specified by:
      setDenyUncoveredHttpMethods in interface cloud.piranha.webapp.api.SecurityManager