public WebSecurityManager getManager(String ctxId, String name, boolean remove) { return getManager(SECURITY_MANAGERS, ctxId, name, remove); }
public<T> void addManagerToApp(String ctxId, String name, String appName, WebSecurityManager manager) { addManagerToApp(SECURITY_MANAGERS, CONTEXT_IDS, ctxId, name, appName, manager); }
public<T> String[] getContextsForApp(String appName, boolean remove) { return getContextsForApp(CONTEXT_IDS, appName, remove); }
/** * Translate Web Bundle Policy * @param webBD * @param remove boolean indicated whether any existing policy statements * are removed form context before translation * @throws DeploymentException */ private void loadPolicy(WebBundleDescriptor webBD, boolean remove) throws DeploymentException { try { if (webBD != null) { if (remove) { String cid = SecurityUtil.getContextID(webBD); WebSecurityManager wsm = wsmf.getManager(cid, null, true); if (wsm != null) { wsm.release(); } } wsmf.createManager(webBD, true, serverContext); } } catch (Exception se) { String msg = "Error in generating security policy for " + webBD.getModuleDescriptor().getModuleName(); throw new DeploymentException(msg, se); } }
public WebSecurityManager createManager(WebBundleDescriptor wbd, boolean register, ServerContext context) { String ctxId = WebSecurityManager.getContextID(wbd); WebSecurityManager manager = null; if (register) { manager = getManager(ctxId, null,false); } if (manager == null || !register) { try { probeProvider.securityManagerCreationStartedEvent(wbd.getModuleID()); manager = new WebSecurityManager(wbd, context, this, register); probeProvider.securityManagerCreationEndedEvent(wbd.getModuleID()); if (register) { String appName = wbd.getApplication().getRegistrationName(); addManagerToApp(ctxId, null, appName, manager); probeProvider.securityManagerCreationEvent(ctxId); } } catch (javax.security.jacc.PolicyContextException e) { logger.log(Level.FINE, "[Web-Security] FATAL Exception. Unable to create WebSecurityManager: " + e.getMessage()); throw new RuntimeException(e); } } return manager; } }
public void updateWebSecurityManager() { if (webSecurityManager == null) { webSecurityManager = getWebSecurityManager(true); } if (webSecurityManager != null) { try { webSecurityManager.release(); webSecurityManager.destroy(); } catch (Exception ex) { ex.printStackTrace(); } webSecurityManager = webSecurityManagerFactory.createManager(webDesc, true, serverContext); if (_logger.isLoggable(Level.FINE)) { _logger.fine("WebSecurityManager for "+CONTEXT_ID+" has been update"); } } }
public<T> ArrayList<WebSecurityManager> getManagersForApp(String appName, boolean remove) { return getManagersForApp(SECURITY_MANAGERS, CONTEXT_IDS, appName, remove); }
public static Group getGroupInstance(String name, String realm){ WebSecurityManagerFactory fact = getWebSecurityManagerFactory(); Group g = (Group)fact.getAdminGroup(name, realm); if(g == null){ g = new Group(name); } return g; } }
public static PrincipalImpl getPrincipalInstance(String name, String realm){ WebSecurityManagerFactory fact = getWebSecurityManagerFactory(); PrincipalImpl p = (PrincipalImpl)fact.getAdminPrincipal(name, realm) ; if(p == null){ p = new PrincipalImpl(name); } return p; }
public<T> ArrayList<WebSecurityManager> getManagers(String ctxId, boolean remove) { return getManagers(SECURITY_MANAGERS, ctxId, remove); }
public WebSecurityManagerFactory() { registerPolicyHandlers(); }
/** * Translate Web Bundle Policy * @param webBD * @param remove boolean indicated whether any existing policy statements * are removed form context before translation * @throws DeploymentException */ private void loadPolicy(WebBundleDescriptor webBD, boolean remove) throws DeploymentException { try { if (webBD != null) { if (remove) { String cid = SecurityUtil.getContextID(webBD); WebSecurityManager wsm = wsmf.getManager(cid, null, true); if (wsm != null) { wsm.release(); } } wsmf.createManager(webBD, true, serverContext); } } catch (Exception se) { String msg = "Error in generating security policy for " + webBD.getModuleDescriptor().getModuleName(); throw new DeploymentException(msg, se); } }
public WebSecurityManager createManager(WebBundleDescriptor wbd, boolean register, ServerContext context) { String ctxId = WebSecurityManager.getContextID(wbd); WebSecurityManager manager = null; if (register) { manager = getManager(ctxId, null,false); } if (manager == null || !register) { try { probeProvider.securityManagerCreationStartedEvent(wbd.getModuleID()); manager = new WebSecurityManager(wbd, context, this, register); probeProvider.securityManagerCreationEndedEvent(wbd.getModuleID()); if (register) { String appName = wbd.getApplication().getRegistrationName(); addManagerToApp(ctxId, null, appName, manager); probeProvider.securityManagerCreationEvent(ctxId); } } catch (javax.security.jacc.PolicyContextException e) { logger.log(Level.FINE, "[Web-Security] FATAL Exception. Unable to create WebSecurityManager: " + e.getMessage()); throw new RuntimeException(e); } } return manager; } }
/** * Generate the JSR 115 policy file for a web application, bundled * within a ear or deployed as a standalone war file. * * Implementation note: If the generated file doesn't contains * all the permission, the role mapper is probably broken. */ protected void configureSecurity(WebBundleDescriptor wbd, boolean isSystem) { try { webSecurityManagerFactory.createManager(wbd,true, serverContext); String context = WebSecurityManager.getContextID(wbd); SecurityUtil.generatePolicyFile(context); if (isSystem && context.equals("__admingui/__admingui")) { websecurityProbeProvider.policyCreationEvent(context); } } catch (Exception ce) { _logger.log(Level.SEVERE, "policy.configure", ce); throw new RuntimeException(ce); } }
public<T> ArrayList<WebSecurityManager> getManagersForApp(String appName, boolean remove) { return getManagersForApp(SECURITY_MANAGERS, CONTEXT_IDS, appName, remove); }
public Group getGroupInstance(String name, String realm){ WebSecurityManagerFactory fact = getWebSecurityManagerFactory(); Group g = (Group)fact.getAdminGroup(name, realm); if(g == null){ g = new Group(name); } return g; } }
public PrincipalImpl getPrincipalInstance(String name, String realm){ WebSecurityManagerFactory fact = getWebSecurityManagerFactory(); PrincipalImpl p = (PrincipalImpl)fact.getAdminPrincipal(name, realm) ; if(p == null){ p = new PrincipalImpl(name); } return p; }
public<T> ArrayList<WebSecurityManager> getManagers(String ctxId, boolean remove) { return getManagers(SECURITY_MANAGERS, ctxId, remove); }
public WebSecurityManagerFactory() { registerPolicyHandlers(); }
public WebSecurityManager getManager(String ctxId, String name, boolean remove) { return getManager(SECURITY_MANAGERS, ctxId, name, remove); }