Examples of SecurityHandler


Examples of org.apache.hadoop.oncrpc.security.SecurityHandler

  @Override
  public COMMIT3Response commit(XDR xdr, RpcInfo info) {
    //Channel channel, int xid,
    //    SecurityHandler securityHandler, InetAddress client) {
    COMMIT3Response response = new COMMIT3Response(Nfs3Status.NFS3_OK);
    SecurityHandler securityHandler = getSecurityHandler(info);
    DFSClient dfsClient = clientCache.getDfsClient(securityHandler.getUser());
    if (dfsClient == null) {
      response.setStatus(Nfs3Status.NFS3ERR_SERVERFAULT);
      return response;
    }
   
View Full Code Here

Examples of org.apache.hadoop.oncrpc.security.SecurityHandler

  public void testWriteStableHow() throws IOException, InterruptedException {
    NfsConfiguration config = new NfsConfiguration();
    DFSClient client = null;
    MiniDFSCluster cluster = null;
    RpcProgramNfs3 nfsd;
    SecurityHandler securityHandler = Mockito.mock(SecurityHandler.class);
    Mockito.when(securityHandler.getUser()).thenReturn(
        System.getProperty("user.name"));
    String currentUser = System.getProperty("user.name");
    config.set(
            DefaultImpersonationProvider.getProxySuperuserGroupConfKey(currentUser),
            "*");
 
View Full Code Here

Examples of org.apache.olio.webapp.security.SecurityHandler

           
            // Implement a simple security model for now.
            // Programtic security is needed to match submitters with their events.
            HttpServletRequest httpRequest=(HttpServletRequest)request;
            HttpServletResponse httpResponse=(HttpServletResponse)response;
            SecurityHandler securityHandler=SecurityHandler.getInstance();
            String resource=httpRequest.getServletPath();
            logger.finer("\nEntity Filter - Have servletpath = " + resource);
           
            if(resource.equals("/login.jsp")) {
                // login page either being accessed or submitted
                logger.finer("Entity Filter - have login page request or submission");
               
                // see if parameters are submitted
                String userName=request.getParameter(WebConstants.USER_NAME_PARAM);
                String password=request.getParameter(WebConstants.PASSWORD_PARAM);
                String accessingURL=request.getParameter("accessingURL");
                if(userName != null) {
                    // login action
                    Person person=securityHandler.login(getFilterConfig().getServletContext(), httpRequest, httpResponse, userName, password);
                    if(person != null) {
                        // login successful, return originally requested resource
                        // don't like showing login in url because can't bookmark so redirect to it
                        httpResponse.sendRedirect(httpRequest.getContextPath() + accessingURL);
                    } else {
                        // error on login, populate error and go to login page again
                        // make sure to set hidden accessingURL again
                       
                        // set response header to alert ajax calls of a login error.
                        httpResponse.addHeader("LogginError", WebappUtil.getMessage("login_error"));
                       
                        RequestDispatcher requestDispatcher=httpRequest.getRequestDispatcher("/login.jsp?accessingURL=" +
                                httpResponse.encodeURL(accessingURL) + "&loginError=" +
                                httpResponse.encodeURL(WebappUtil.getMessage("login_error")));
                        requestDispatcher.forward(httpRequest, httpResponse);
                        return;
                    }
                }
               
            } else if(!securityHandler.isPersonLoggedIn(httpRequest)) {
                // the person isn't logged in, see if they are accessing a protected resource

                // since we have a rest type of url, need to get path info to decide if path protected
                String pathInfo=httpRequest.getPathInfo();
                if(pathInfo != null) {
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.SecurityHandler

     *
     * @throws BadSecurityHandlerException If there is an error during protection.
     */
    public void protect(ProtectionPolicy pp) throws BadSecurityHandlerException
    {
        SecurityHandler handler = SecurityHandlersManager.getInstance().getSecurityHandler(pp);
        securityHandler = handler;
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.SecurityHandler

            COSDictionary trailer = cosDoc.getTrailer();
            trailer.removeItem(COSName.getPDFName("Encrypt"));
        }
        else
        {
            SecurityHandler securityHandler = document.getSecurityHandler();
            if(securityHandler != null)
            {
                try
                {
                    securityHandler.prepareDocumentForEncryption(document);
                    this.willEncrypt = true;
                }
                catch(IOException e)
                {
                    throw new COSVisitorException( e );
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.SecurityHandler

        }
        else
        {
            if (document.getEncryption() != null)
            {
                SecurityHandler securityHandler = document.getEncryption().getSecurityHandler();
                if(securityHandler != null)
                {
                    securityHandler.prepareDocumentForEncryption(document);
                    willEncrypt = true;
                }
                else
                {
                    willEncrypt = false;
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.SecurityHandler

        if (!isEncrypted())
        {
            encryption = new PDEncryption();
        }

        SecurityHandler securityHandler = SecurityHandlerFactory.INSTANCE.newSecurityHandlerForPolicy(policy);
        if (securityHandler == null)
        {
            throw new IOException("No security handler for policy " + policy);
        }
View Full Code Here

Examples of org.eclipse.jetty.security.SecurityHandler

     */
    public synchronized void addServant(URL url, JettyHTTPHandler handler) {
       
        checkRegistedContext(url);
       
        SecurityHandler securityHandler = null;
        if (server == null) {
            DefaultHandler defaultHandler = null;
            // create a new jetty server instance if there is no server there           
            server = new Server();
           
View Full Code Here

Examples of org.eclipse.jetty.security.SecurityHandler

                              ConfigurationFactory configurationFactory,
                              String realmName,
                              String authMethod,
                              Properties properties,
                              ClassLoader classLoader) throws Exception {
        SecurityHandler securityHandler = null;
        if (configurationFactory != null) {
            BuiltInAuthMethod builtInAuthMethod = BuiltInAuthMethod.getValueOf(authMethod);
            JettySecurityHandlerFactory  factory = new JettySecurityHandlerFactory(builtInAuthMethod, null, null, realmName, configurationFactory);
            //TODO use actual default subject here.
            securityHandler = factory.buildSecurityHandler(contextID, null, null, false);
View Full Code Here

Examples of org.eclipse.jetty.security.SecurityHandler

            PreHandler preHandler = preHandlerFactory.createHandler();
            sessionHandler = handlerFactory.createHandler(preHandler);
        } else {
            sessionHandler = new SessionHandler();
        }
        SecurityHandler securityHandler = null;
//        if (securityRealmName != null) {
//            InternalJAASJettyRealm internalJAASJettyRealm = jettyContainer.addRealm(securityRealmName);
            //wrap jetty realm with something that knows the dumb realmName
//            JAASJettyRealm realm = new JAASJettyRealm(realmName, internalJAASJettyRealm);
        if (securityHandlerFactory != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.