You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by we...@apache.org on 2004/05/11 20:45:31 UTC
cvs commit: jakarta-jetspeed-2/components/security/src/java/META-INF component.pkg
weaver 2004/05/11 11:45:31
Modified: components/security/src/java/org/apache/jetspeed/security/impl
Tag: NANOCONTAINER_DEPLOYER
SecurityProviderImpl.java
Added: components/security/src/java/org/apache/jetspeed/security/impl
Tag: NANOCONTAINER_DEPLOYER RoleManagerImpl.groovy
GroupManagerImpl.groovy RdbmsPolicy.groovy
UserManagerImpl.groovy SecurityProviderImpl.groovy
PermissionManagerImpl.groovy
components/security/src/java/META-INF Tag:
NANOCONTAINER_DEPLOYER component.pkg
Log:
- added component.pkg and groovy adapter script
- SecurityProviderImpl now implments Startable so it loads into the classloader
Revision Changes Path
No revision
No revision
1.1.2.1 +99 -81 jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/SecurityProviderImpl.java
Index: SecurityProviderImpl.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/SecurityProviderImpl.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- SecurityProviderImpl.java 10 Mar 2004 06:07:47 -0000 1.1
+++ SecurityProviderImpl.java 11 May 2004 18:45:31 -0000 1.1.2.1
@@ -1,81 +1,99 @@
-/* Copyright 2004 Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.jetspeed.security.impl;
-
-import java.io.File;
-import java.net.URL;
-import java.security.Policy;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.jetspeed.components.util.system.SystemResourceUtil;
-import org.apache.jetspeed.components.util.system.ClassLoaderSystemResourceUtilImpl;
-import org.apache.jetspeed.security.SecurityProvider;
-import org.apache.jetspeed.security.UserManager;
-
-/**
- * @author <a href="">David Le Strat</a>
- *
- */
-public class SecurityProviderImpl implements SecurityProvider
-{
-
- private static final Log log = LogFactory.getLog(SecurityProviderImpl.class);
-
- /** The {@link SecurityProvider} instance. */
- static SecurityProvider securityProvider;
-
- /** The user manager. */
- private UserManager userMgr;
-
- /**
- * <p>Constructor configuring the security service with the correct
- * <code>java.security.auth.login.config</code> and {@link Policy}.</p>
- */
- public SecurityProviderImpl(String loginConfig, Policy policy, UserManager userMgr)
- {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- SystemResourceUtil resourceUtil = new ClassLoaderSystemResourceUtilImpl(cl);
- URL loginConfigUrl = null;
- try
- {
- loginConfigUrl = resourceUtil.getURL(loginConfig);
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Could not locate the login config. Bad URL. " + e.toString());
- }
- if (null != loginConfigUrl)
- {
- File loginConfigFile = new File(loginConfigUrl.getFile());
- if (log.isDebugEnabled()) log.debug("java.security.auth.login.config = " + loginConfigFile.getAbsolutePath());
- System.setProperty("java.security.auth.login.config", loginConfigFile.getAbsolutePath());
- }
- Policy.setPolicy(policy);
- Policy.getPolicy().refresh();
- this.userMgr = userMgr;
- SecurityProviderImpl.securityProvider = this;
- }
-
- /**
- * @see org.apache.jetspeed.security.SecurityProvider#getUserManager()
- */
- public UserManager getUserManager()
- {
- return this.userMgr;
- }
-
-}
+/* Copyright 2004 Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.impl;
+
+
+
+import java.io.File;
+import java.net.URL;
+import java.security.Policy;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.components.util.system.ClassLoaderSystemResourceUtilImpl;
+import org.apache.jetspeed.components.util.system.SystemResourceUtil;
+import org.apache.jetspeed.security.SecurityProvider;
+import org.apache.jetspeed.security.UserManager;
+import org.picocontainer.Startable;
+
+/**
+ * @author <a href="">David Le Strat</a>
+ *
+ */
+public class SecurityProviderImpl implements SecurityProvider, Startable
+{
+
+ private static final Log log = LogFactory.getLog(SecurityProviderImpl.class);
+
+ /** The {@link SecurityProvider} instance. */
+ static SecurityProvider securityProvider;
+
+ /** The user manager. */
+ private UserManager userMgr;
+
+ /**
+ * <p>Constructor configuring the security service with the correct
+ * <code>java.security.auth.login.config</code> and {@link Policy}.</p>
+ */
+ public SecurityProviderImpl(String loginConfig, Policy policy, UserManager userMgr)
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ SystemResourceUtil resourceUtil = new ClassLoaderSystemResourceUtilImpl(cl);
+ URL loginConfigUrl = null;
+ try
+ {
+ loginConfigUrl = resourceUtil.getURL(loginConfig);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Could not locate the login config. Bad URL. " + e.toString());
+ }
+ if (null != loginConfigUrl)
+ {
+ File loginConfigFile = new File(loginConfigUrl.getFile());
+ if (log.isDebugEnabled()) log.debug("java.security.auth.login.config = " + loginConfigFile.getAbsolutePath());
+ System.setProperty("java.security.auth.login.config", loginConfigFile.getAbsolutePath());
+ }
+ Policy.setPolicy(policy);
+ Policy.getPolicy().refresh();
+ this.userMgr = userMgr;
+ SecurityProviderImpl.securityProvider = this;
+ }
+
+ /**
+ * @see org.apache.jetspeed.security.SecurityProvider#getUserManager()
+ */
+ public UserManager getUserManager()
+ {
+ return this.userMgr;
+ }
+
+ /* (non-Javadoc)
+ * @see org.picocontainer.Startable#start()
+ */
+ public void start()
+ {
+ // TODO Auto-generated method stub
+
+ }
+ /* (non-Javadoc)
+ * @see org.picocontainer.Startable#stop()
+ */
+ public void stop()
+ {
+ // TODO Auto-generated method stub
+
+ }
+}
No revision
Index: SecurityProviderImpl.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/SecurityProviderImpl.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- SecurityProviderImpl.java 10 Mar 2004 06:07:47 -0000 1.1
+++ SecurityProviderImpl.java 11 May 2004 18:45:31 -0000 1.1.2.1
@@ -1,81 +1,99 @@
-/* Copyright 2004 Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.jetspeed.security.impl;
-
-import java.io.File;
-import java.net.URL;
-import java.security.Policy;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.jetspeed.components.util.system.SystemResourceUtil;
-import org.apache.jetspeed.components.util.system.ClassLoaderSystemResourceUtilImpl;
-import org.apache.jetspeed.security.SecurityProvider;
-import org.apache.jetspeed.security.UserManager;
-
-/**
- * @author <a href="">David Le Strat</a>
- *
- */
-public class SecurityProviderImpl implements SecurityProvider
-{
-
- private static final Log log = LogFactory.getLog(SecurityProviderImpl.class);
-
- /** The {@link SecurityProvider} instance. */
- static SecurityProvider securityProvider;
-
- /** The user manager. */
- private UserManager userMgr;
-
- /**
- * <p>Constructor configuring the security service with the correct
- * <code>java.security.auth.login.config</code> and {@link Policy}.</p>
- */
- public SecurityProviderImpl(String loginConfig, Policy policy, UserManager userMgr)
- {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- SystemResourceUtil resourceUtil = new ClassLoaderSystemResourceUtilImpl(cl);
- URL loginConfigUrl = null;
- try
- {
- loginConfigUrl = resourceUtil.getURL(loginConfig);
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Could not locate the login config. Bad URL. " + e.toString());
- }
- if (null != loginConfigUrl)
- {
- File loginConfigFile = new File(loginConfigUrl.getFile());
- if (log.isDebugEnabled()) log.debug("java.security.auth.login.config = " + loginConfigFile.getAbsolutePath());
- System.setProperty("java.security.auth.login.config", loginConfigFile.getAbsolutePath());
- }
- Policy.setPolicy(policy);
- Policy.getPolicy().refresh();
- this.userMgr = userMgr;
- SecurityProviderImpl.securityProvider = this;
- }
-
- /**
- * @see org.apache.jetspeed.security.SecurityProvider#getUserManager()
- */
- public UserManager getUserManager()
- {
- return this.userMgr;
- }
-
-}
+/* Copyright 2004 Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.impl;
+
+
+
+import java.io.File;
+import java.net.URL;
+import java.security.Policy;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.components.util.system.ClassLoaderSystemResourceUtilImpl;
+import org.apache.jetspeed.components.util.system.SystemResourceUtil;
+import org.apache.jetspeed.security.SecurityProvider;
+import org.apache.jetspeed.security.UserManager;
+import org.picocontainer.Startable;
+
+/**
+ * @author <a href="">David Le Strat</a>
+ *
+ */
+public class SecurityProviderImpl implements SecurityProvider, Startable
+{
+
+ private static final Log log = LogFactory.getLog(SecurityProviderImpl.class);
+
+ /** The {@link SecurityProvider} instance. */
+ static SecurityProvider securityProvider;
+
+ /** The user manager. */
+ private UserManager userMgr;
+
+ /**
+ * <p>Constructor configuring the security service with the correct
+ * <code>java.security.auth.login.config</code> and {@link Policy}.</p>
+ */
+ public SecurityProviderImpl(String loginConfig, Policy policy, UserManager userMgr)
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ SystemResourceUtil resourceUtil = new ClassLoaderSystemResourceUtilImpl(cl);
+ URL loginConfigUrl = null;
+ try
+ {
+ loginConfigUrl = resourceUtil.getURL(loginConfig);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Could not locate the login config. Bad URL. " + e.toString());
+ }
+ if (null != loginConfigUrl)
+ {
+ File loginConfigFile = new File(loginConfigUrl.getFile());
+ if (log.isDebugEnabled()) log.debug("java.security.auth.login.config = " + loginConfigFile.getAbsolutePath());
+ System.setProperty("java.security.auth.login.config", loginConfigFile.getAbsolutePath());
+ }
+ Policy.setPolicy(policy);
+ Policy.getPolicy().refresh();
+ this.userMgr = userMgr;
+ SecurityProviderImpl.securityProvider = this;
+ }
+
+ /**
+ * @see org.apache.jetspeed.security.SecurityProvider#getUserManager()
+ */
+ public UserManager getUserManager()
+ {
+ return this.userMgr;
+ }
+
+ /* (non-Javadoc)
+ * @see org.picocontainer.Startable#start()
+ */
+ public void start()
+ {
+ // TODO Auto-generated method stub
+
+ }
+ /* (non-Javadoc)
+ * @see org.picocontainer.Startable#stop()
+ */
+ public void stop()
+ {
+ // TODO Auto-generated method stub
+
+ }
+}
No revision
Index: SecurityProviderImpl.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/SecurityProviderImpl.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- SecurityProviderImpl.java 10 Mar 2004 06:07:47 -0000 1.1
+++ SecurityProviderImpl.java 11 May 2004 18:45:31 -0000 1.1.2.1
@@ -1,81 +1,99 @@
-/* Copyright 2004 Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.jetspeed.security.impl;
-
-import java.io.File;
-import java.net.URL;
-import java.security.Policy;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.jetspeed.components.util.system.SystemResourceUtil;
-import org.apache.jetspeed.components.util.system.ClassLoaderSystemResourceUtilImpl;
-import org.apache.jetspeed.security.SecurityProvider;
-import org.apache.jetspeed.security.UserManager;
-
-/**
- * @author <a href="">David Le Strat</a>
- *
- */
-public class SecurityProviderImpl implements SecurityProvider
-{
-
- private static final Log log = LogFactory.getLog(SecurityProviderImpl.class);
-
- /** The {@link SecurityProvider} instance. */
- static SecurityProvider securityProvider;
-
- /** The user manager. */
- private UserManager userMgr;
-
- /**
- * <p>Constructor configuring the security service with the correct
- * <code>java.security.auth.login.config</code> and {@link Policy}.</p>
- */
- public SecurityProviderImpl(String loginConfig, Policy policy, UserManager userMgr)
- {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- SystemResourceUtil resourceUtil = new ClassLoaderSystemResourceUtilImpl(cl);
- URL loginConfigUrl = null;
- try
- {
- loginConfigUrl = resourceUtil.getURL(loginConfig);
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Could not locate the login config. Bad URL. " + e.toString());
- }
- if (null != loginConfigUrl)
- {
- File loginConfigFile = new File(loginConfigUrl.getFile());
- if (log.isDebugEnabled()) log.debug("java.security.auth.login.config = " + loginConfigFile.getAbsolutePath());
- System.setProperty("java.security.auth.login.config", loginConfigFile.getAbsolutePath());
- }
- Policy.setPolicy(policy);
- Policy.getPolicy().refresh();
- this.userMgr = userMgr;
- SecurityProviderImpl.securityProvider = this;
- }
-
- /**
- * @see org.apache.jetspeed.security.SecurityProvider#getUserManager()
- */
- public UserManager getUserManager()
- {
- return this.userMgr;
- }
-
-}
+/* Copyright 2004 Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.impl;
+
+
+
+import java.io.File;
+import java.net.URL;
+import java.security.Policy;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.components.util.system.ClassLoaderSystemResourceUtilImpl;
+import org.apache.jetspeed.components.util.system.SystemResourceUtil;
+import org.apache.jetspeed.security.SecurityProvider;
+import org.apache.jetspeed.security.UserManager;
+import org.picocontainer.Startable;
+
+/**
+ * @author <a href="">David Le Strat</a>
+ *
+ */
+public class SecurityProviderImpl implements SecurityProvider, Startable
+{
+
+ private static final Log log = LogFactory.getLog(SecurityProviderImpl.class);
+
+ /** The {@link SecurityProvider} instance. */
+ static SecurityProvider securityProvider;
+
+ /** The user manager. */
+ private UserManager userMgr;
+
+ /**
+ * <p>Constructor configuring the security service with the correct
+ * <code>java.security.auth.login.config</code> and {@link Policy}.</p>
+ */
+ public SecurityProviderImpl(String loginConfig, Policy policy, UserManager userMgr)
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ SystemResourceUtil resourceUtil = new ClassLoaderSystemResourceUtilImpl(cl);
+ URL loginConfigUrl = null;
+ try
+ {
+ loginConfigUrl = resourceUtil.getURL(loginConfig);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Could not locate the login config. Bad URL. " + e.toString());
+ }
+ if (null != loginConfigUrl)
+ {
+ File loginConfigFile = new File(loginConfigUrl.getFile());
+ if (log.isDebugEnabled()) log.debug("java.security.auth.login.config = " + loginConfigFile.getAbsolutePath());
+ System.setProperty("java.security.auth.login.config", loginConfigFile.getAbsolutePath());
+ }
+ Policy.setPolicy(policy);
+ Policy.getPolicy().refresh();
+ this.userMgr = userMgr;
+ SecurityProviderImpl.securityProvider = this;
+ }
+
+ /**
+ * @see org.apache.jetspeed.security.SecurityProvider#getUserManager()
+ */
+ public UserManager getUserManager()
+ {
+ return this.userMgr;
+ }
+
+ /* (non-Javadoc)
+ * @see org.picocontainer.Startable#start()
+ */
+ public void start()
+ {
+ // TODO Auto-generated method stub
+
+ }
+ /* (non-Javadoc)
+ * @see org.picocontainer.Startable#stop()
+ */
+ public void stop()
+ {
+ // TODO Auto-generated method stub
+
+ }
+}
1.1.2.1 +23 -0 jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/Attic/RoleManagerImpl.groovy
1.1.2.1 +26 -0 jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/Attic/GroupManagerImpl.groovy
1.1.2.1 +22 -0 jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/Attic/RdbmsPolicy.groovy
1.1.2.1 +25 -0 jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/Attic/UserManagerImpl.groovy
1.1.2.1 +24 -0 jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/Attic/SecurityProviderImpl.groovy
1.1.2.1 +24 -0 jakarta-jetspeed-2/components/security/src/java/org/apache/jetspeed/security/impl/Attic/PermissionManagerImpl.groovy
No revision
No revision
1.1.2.1 +37 -0 jakarta-jetspeed-2/components/security/src/java/META-INF/Attic/component.pkg
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org