You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2005/07/08 16:44:09 UTC

svn commit: r209796 - in /incubator/jackrabbit/trunk: commons/src/java/org/apache/jackrabbit/ core/src/java/org/apache/jackrabbit/core/ core/src/java/org/apache/jackrabbit/core/security/

Author: stefan
Date: Fri Jul  8 07:44:08 2005
New Revision: 209796

URL: http://svn.apache.org/viewcvs?rev=209796&view=rev
Log:
moving proprietary constants from 'commons' to 'core'

Added:
    incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/security/SecurityConstants.java   (with props)
Modified:
    incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/Constants.java
    incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/SessionImpl.java
    incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/security/SimpleLoginModule.java

Modified: incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/Constants.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/Constants.java?rev=209796&r1=209795&r2=209796&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/Constants.java (original)
+++ incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/Constants.java Fri Jul  8 07:44:08 2005
@@ -449,15 +449,4 @@
      * nt:childNodeDefinition
      */
     QName NT_CHILDNODEDEFINITION = new QName(NS_NT_URI, "childNodeDefinition");
-
-    //-------------------------------------------< security related constants >
-    /**
-     * Name of the internal <code>SimpleCredentials</code> attribute where
-     * the <code>Subject</code> of the <i>impersonating</i> <code>Session</code>
-     * is stored.
-     *
-     * @see javax.jcr.Session#impersonate(javax.jcr.Credentials)
-     */
-    String IMPERSONATOR_ATTRIBUTE =
-            "org.apache.jackrabbit.core.security.impersonator";
 }

Modified: incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/SessionImpl.java?rev=209796&r1=209795&r2=209796&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/SessionImpl.java (original)
+++ incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/SessionImpl.java Fri Jul  8 07:44:08 2005
@@ -27,6 +27,7 @@
 import org.apache.jackrabbit.core.security.AMContext;
 import org.apache.jackrabbit.core.security.AccessManager;
 import org.apache.jackrabbit.core.security.AuthContext;
+import org.apache.jackrabbit.core.security.SecurityConstants;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.SessionItemStateManager;
 import org.apache.jackrabbit.core.state.UpdatableItemStateManager;
@@ -89,7 +90,7 @@
 /**
  * A <code>SessionImpl</code> ...
  */
-public class SessionImpl implements Session, Constants {
+public class SessionImpl implements Session {
 
     private static Logger log = Logger.getLogger(SessionImpl.class);
 
@@ -673,7 +674,7 @@
         // set IMPERSONATOR_ATTRIBUTE attribute of given credentials
         // with subject of current session
         SimpleCredentials creds = (SimpleCredentials) otherCredentials;
-        creds.setAttribute(IMPERSONATOR_ATTRIBUTE, subject);
+        creds.setAttribute(SecurityConstants.IMPERSONATOR_ATTRIBUTE, subject);
 
         try {
             return rep.login(otherCredentials, getWorkspace().getName());
@@ -684,7 +685,7 @@
             throw new RepositoryException(msg, nswe);
         } finally {
             // make sure IMPERSONATOR_ATTRIBUTE is removed
-            creds.removeAttribute(IMPERSONATOR_ATTRIBUTE);
+            creds.removeAttribute(SecurityConstants.IMPERSONATOR_ATTRIBUTE);
         }
     }
 
@@ -707,7 +708,7 @@
 
         try {
             NodeImpl node = (NodeImpl) getItemManager().getItem(new NodeId(uuid));
-            if (node.isNodeType(MIX_REFERENCEABLE)) {
+            if (node.isNodeType(Constants.MIX_REFERENCEABLE)) {
                 return node;
             } else {
                 // there is a node with that uuid but the node does not expose it

Added: incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/security/SecurityConstants.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/security/SecurityConstants.java?rev=209796&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/security/SecurityConstants.java (added)
+++ incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/security/SecurityConstants.java Fri Jul  8 07:44:08 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.jackrabbit.core.security;
+
+/**
+ * This interface defines miscellaneous security related constants.
+ */
+public interface SecurityConstants {
+
+    /**
+     * Name of the internal <code>SimpleCredentials</code> attribute where
+     * the <code>Subject</code> of the <i>impersonating</i> <code>Session</code>
+     * is stored.
+     *
+     * @see javax.jcr.Session#impersonate(javax.jcr.Credentials)
+     */
+    String IMPERSONATOR_ATTRIBUTE =
+            "org.apache.jackrabbit.core.security.impersonator";
+}

Propchange: incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/security/SecurityConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/security/SimpleLoginModule.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/security/SimpleLoginModule.java?rev=209796&r1=209795&r2=209796&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/security/SimpleLoginModule.java (original)
+++ incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/security/SimpleLoginModule.java Fri Jul  8 07:44:08 2005
@@ -117,7 +117,7 @@
                     SimpleCredentials sc = (SimpleCredentials) creds;
                     // authenticate
 
-                    Object attr = sc.getAttribute(Constants.IMPERSONATOR_ATTRIBUTE);
+                    Object attr = sc.getAttribute(SecurityConstants.IMPERSONATOR_ATTRIBUTE);
                     if (attr != null && attr instanceof Subject) {
                         Subject impersonator = (Subject) attr;
                         // @todo check privileges to 'impersonate' the user represented by the supplied credentials