]> source.dussan.org Git - archiva.git/commitdiff
package move to o.a.a.r module redback-authorization-api
authorOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 20:50:23 +0000 (20:50 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 20:50:23 +0000 (20:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1310861 13f79535-47bb-0310-9956-ffa450edef68

33 files changed:
redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/AuthorizationDataSource.java [new file with mode: 0644]
redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/AuthorizationException.java [new file with mode: 0644]
redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/AuthorizationResult.java [new file with mode: 0644]
redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/Authorizer.java [new file with mode: 0644]
redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/NotAuthorizedException.java [new file with mode: 0644]
redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/RedbackAuthorization.java [new file with mode: 0644]
redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/UnauthorizedException.java [new file with mode: 0755]
redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/AuthorizationDataSource.java [deleted file]
redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/AuthorizationException.java [deleted file]
redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/AuthorizationResult.java [deleted file]
redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/Authorizer.java [deleted file]
redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/NotAuthorizedException.java [deleted file]
redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/RedbackAuthorization.java [deleted file]
redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/UnauthorizedException.java [deleted file]
redback-authorization/redback-authorization-providers/redback-authorization-open/src/main/java/org/codehaus/plexus/redback/authorization/open/OpenAuthorizer.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/filter/authorization/SimpleAuthorizationFilter.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/taglib/jsp/IfAnyAuthorizedTag.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/taglib/jsp/IfAuthorizedTag.java
redback-integrations/redback-rest/redback-rest-api/src/main/java/org/codehaus/redback/rest/api/services/LoginService.java
redback-integrations/redback-rest/redback-rest-api/src/main/java/org/codehaus/redback/rest/api/services/PasswordService.java
redback-integrations/redback-rest/redback-rest-api/src/main/java/org/codehaus/redback/rest/api/services/RoleManagementService.java
redback-integrations/redback-rest/redback-rest-api/src/main/java/org/codehaus/redback/rest/api/services/UserService.java
redback-integrations/redback-rest/redback-rest-api/src/main/java/org/codehaus/redback/rest/api/services/UtilServices.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/interceptors/AbstractInterceptor.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/interceptors/AuthenticationInterceptor.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/interceptors/PermissionsInterceptor.java
redback-integrations/redback-rest/redback-rest-services/src/test/java/org/codehaus/redback/rest/services/FakeCreateAdminService.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/interceptor/SecureActionInterceptor.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/java/org/codehaus/plexus/redback/struts2/action/admin/AssignmentsActionTest.java
redback-rbac/redback-authorization-rbac/src/main/java/org/codehaus/plexus/redback/authorization/rbac/RbacAuthorizer.java
redback-rbac/redback-rbac-providers/redback-rbac-memory/src/main/java/org/codehaus/plexus/redback/rbac/memory/MemoryAuthorizer.java
redback-system/src/main/java/org/codehaus/plexus/redback/system/DefaultSecuritySystem.java
redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySystem.java

diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/AuthorizationDataSource.java b/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/AuthorizationDataSource.java
new file mode 100644 (file)
index 0000000..73721f7
--- /dev/null
@@ -0,0 +1,91 @@
+package org.apache.archiva.redback.authorization;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.archiva.redback.users.User;
+
+/**
+ * @author Jason van Zyl
+ */
+public class AuthorizationDataSource
+{
+    Object principal;
+
+    User user;
+
+    Object permission;
+
+    Object resource;
+
+    public AuthorizationDataSource( Object principal, User user, Object permission )
+    {
+        this.principal = principal;
+        this.user = user;
+        this.permission = permission;
+    }
+
+    public AuthorizationDataSource( Object principal, User user, Object permission, Object resource )
+    {
+        this.principal = principal;
+        this.user = user;
+        this.permission = permission;
+        this.resource = resource;
+    }
+
+    public Object getPrincipal()
+    {
+        return principal;
+    }
+
+    public void setPrincipal( String principal )
+    {
+        this.principal = principal;
+    }
+
+    public User getUser()
+    {
+        return user;
+    }
+
+    public void setUser( User user )
+    {
+        this.user = user;
+    }
+
+    public Object getPermission()
+    {
+        return permission;
+    }
+
+    public void setPermission( Object permission )
+    {
+        this.permission = permission;
+    }
+
+    public Object getResource()
+    {
+        return resource;
+    }
+
+    public void setResource( Object resource )
+    {
+        this.resource = resource;
+    }
+}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/AuthorizationException.java b/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/AuthorizationException.java
new file mode 100644 (file)
index 0000000..b04acb8
--- /dev/null
@@ -0,0 +1,49 @@
+package org.apache.archiva.redback.authorization;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+
+/**
+ * EntityAuthenticationException.java
+ *
+ * @author: Jesse McConnell <jesse@codehaus.org>
+ * @version: $ID:$
+ */
+public class AuthorizationException
+    extends Exception
+{
+    /**
+     *
+     * @param message
+     */
+    public AuthorizationException( String message )
+    {
+        super( message );
+    }
+
+    /**
+     * @param message
+     * @param cause
+     */
+    public AuthorizationException( String message, Exception cause )
+    {
+        super( message, cause );
+    }
+}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/AuthorizationResult.java b/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/AuthorizationResult.java
new file mode 100644 (file)
index 0000000..fbdb41a
--- /dev/null
@@ -0,0 +1,60 @@
+package org.apache.archiva.redback.authorization;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * AuthorizationResult: wrapper object for results from the authorization system
+ *
+ * @author: Jesse McConnell <jesse@codehaus.org>
+ * @version: $ID:$
+ */
+public class AuthorizationResult
+{
+    private boolean isAuthorized;
+
+    private Object principal;
+
+    private Exception exception;
+
+
+    public AuthorizationResult( boolean authorized,
+                                Object principal,
+                                Exception exception )
+    {
+        isAuthorized = authorized;
+        this.principal = principal;
+        this.exception = exception;
+    }
+
+    public boolean isAuthorized()
+    {
+        return isAuthorized;
+    }
+
+    public Object getPrincipal()
+    {
+        return principal;
+    }
+
+    public Exception getException()
+    {
+        return exception;
+    }
+}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/Authorizer.java b/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/Authorizer.java
new file mode 100644 (file)
index 0000000..0b3051f
--- /dev/null
@@ -0,0 +1,38 @@
+package org.apache.archiva.redback.authorization;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.archiva.redback.authorization.AuthorizationDataSource;
+import org.apache.archiva.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.AuthorizationResult;
+
+/**
+ * Authorizer:
+ *
+ * @author: Jesse McConnell <jesse@codehaus.org>
+ * @todo chain of command rule processing
+ */
+public interface Authorizer
+{
+    String getId();
+
+    AuthorizationResult isAuthorized( AuthorizationDataSource source )
+        throws AuthorizationException;
+}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/NotAuthorizedException.java b/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/NotAuthorizedException.java
new file mode 100644 (file)
index 0000000..e4a9974
--- /dev/null
@@ -0,0 +1,55 @@
+package org.apache.archiva.redback.authorization;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * EntityAuthenticationException.java
+ *
+ * @author: Jesse McConnell <jesse@codehaus.org>
+ * @version: $ID:$
+ */
+public class NotAuthorizedException
+    extends Exception
+{
+    /**
+     *
+     */
+    public NotAuthorizedException()
+    {
+    }
+
+    /**
+     *
+     * @param message
+     */
+    public NotAuthorizedException( String message )
+    {
+        super( message );
+    }
+
+    /**
+     * @param message
+     * @param cause
+     */
+    public NotAuthorizedException( String message, Exception cause )
+    {
+        super( message, cause );
+    }
+}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/RedbackAuthorization.java b/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/RedbackAuthorization.java
new file mode 100644 (file)
index 0000000..c680f0f
--- /dev/null
@@ -0,0 +1,60 @@
+package org.apache.archiva.redback.authorization;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.3
+ */
+@Target( ElementType.METHOD )
+@Retention( RetentionPolicy.RUNTIME )
+public @interface RedbackAuthorization
+{
+
+    /**
+     * @return at least one of those redback roles is needed
+     */
+    String[] permissions() default ( "" );
+
+    /**
+     * @return the redback ressource karma needed
+     */
+    String resource() default ( "" );
+
+    /**
+     * @return doc
+     */
+    String description() default ( "" );
+
+    /**
+     * @return <code>true</code> if doesn't need any special permission
+     */
+    boolean noRestriction() default false;
+
+    /**
+     * @return if this service need only authentication and not special karma
+     */
+    boolean noPermission() default false;
+}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/UnauthorizedException.java b/redback-authorization/redback-authorization-api/src/main/java/org/apache/archiva/redback/authorization/UnauthorizedException.java
new file mode 100755 (executable)
index 0000000..fab7e70
--- /dev/null
@@ -0,0 +1,38 @@
+package org.apache.archiva.redback.authorization;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * The exception thrown if an entity is unauthorized to access a resource.
+ *
+ * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
+ * @since Mar 1, 2003
+ */
+public class UnauthorizedException
+    extends Exception
+{
+    /**
+     * @param message
+     */
+    public UnauthorizedException( String message )
+    {
+        super( message );
+    }
+}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/AuthorizationDataSource.java b/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/AuthorizationDataSource.java
deleted file mode 100644 (file)
index 57a82c6..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.codehaus.plexus.redback.authorization;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-import org.apache.archiva.redback.users.User;
-
-/**
- * @author Jason van Zyl
- */
-public class AuthorizationDataSource
-{
-    Object principal;
-
-    User user;
-
-    Object permission;
-
-    Object resource;
-
-    public AuthorizationDataSource( Object principal, User user, Object permission )
-    {
-        this.principal = principal;
-        this.user = user;
-        this.permission = permission;
-    }
-
-    public AuthorizationDataSource( Object principal, User user, Object permission, Object resource )
-    {
-        this.principal = principal;
-        this.user = user;
-        this.permission = permission;
-        this.resource = resource;
-    }
-
-    public Object getPrincipal()
-    {
-        return principal;
-    }
-
-    public void setPrincipal( String principal )
-    {
-        this.principal = principal;
-    }
-
-    public User getUser()
-    {
-        return user;
-    }
-
-    public void setUser( User user )
-    {
-        this.user = user;
-    }
-
-    public Object getPermission()
-    {
-        return permission;
-    }
-
-    public void setPermission( Object permission )
-    {
-        this.permission = permission;
-    }
-
-    public Object getResource()
-    {
-        return resource;
-    }
-
-    public void setResource( Object resource )
-    {
-        this.resource = resource;
-    }
-}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/AuthorizationException.java b/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/AuthorizationException.java
deleted file mode 100644 (file)
index d27b272..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.codehaus.plexus.redback.authorization;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-
-/**
- * EntityAuthenticationException.java
- *
- * @author: Jesse McConnell <jesse@codehaus.org>
- * @version: $ID:$
- */
-public class AuthorizationException
-    extends Exception
-{
-    /**
-     *
-     * @param message
-     */
-    public AuthorizationException( String message )
-    {
-        super( message );
-    }
-
-    /**
-     * @param message
-     * @param cause
-     */
-    public AuthorizationException( String message, Exception cause )
-    {
-        super( message, cause );
-    }
-}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/AuthorizationResult.java b/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/AuthorizationResult.java
deleted file mode 100644 (file)
index 8c3c7f0..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.codehaus.plexus.redback.authorization;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-/**
- * AuthorizationResult: wrapper object for results from the authorization system
- *
- * @author: Jesse McConnell <jesse@codehaus.org>
- * @version: $ID:$
- */
-public class AuthorizationResult
-{
-    private boolean isAuthorized;
-
-    private Object principal;
-
-    private Exception exception;
-
-
-    public AuthorizationResult( boolean authorized,
-                                Object principal,
-                                Exception exception )
-    {
-        isAuthorized = authorized;
-        this.principal = principal;
-        this.exception = exception;
-    }
-
-    public boolean isAuthorized()
-    {
-        return isAuthorized;
-    }
-
-    public Object getPrincipal()
-    {
-        return principal;
-    }
-
-    public Exception getException()
-    {
-        return exception;
-    }
-}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/Authorizer.java b/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/Authorizer.java
deleted file mode 100644 (file)
index 52b26ae..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.codehaus.plexus.redback.authorization;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-/**
- * Authorizer:
- *
- * @author: Jesse McConnell <jesse@codehaus.org>
- * @version: $ID:$
- * @todo chain of command rule processing
- */
-public interface Authorizer
-{
-    String getId();
-
-    AuthorizationResult isAuthorized( AuthorizationDataSource source )
-        throws AuthorizationException;
-}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/NotAuthorizedException.java b/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/NotAuthorizedException.java
deleted file mode 100644 (file)
index fd41ad1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.codehaus.plexus.redback.authorization;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-/**
- * EntityAuthenticationException.java
- *
- * @author: Jesse McConnell <jesse@codehaus.org>
- * @version: $ID:$
- */
-public class NotAuthorizedException
-    extends Exception
-{
-    /**
-     *
-     */
-    public NotAuthorizedException()
-    {
-    }
-
-    /**
-     *
-     * @param message
-     */
-    public NotAuthorizedException( String message )
-    {
-        super( message );
-    }
-
-    /**
-     * @param message
-     * @param cause
-     */
-    public NotAuthorizedException( String message, Exception cause )
-    {
-        super( message, cause );
-    }
-}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/RedbackAuthorization.java b/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/RedbackAuthorization.java
deleted file mode 100644 (file)
index 09e5352..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.codehaus.plexus.redback.authorization;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * @author Olivier Lamy
- * @since 1.3
- */
-@Target( ElementType.METHOD )
-@Retention( RetentionPolicy.RUNTIME )
-public @interface RedbackAuthorization
-{
-
-    /**
-     * @return at least one of those redback roles is needed
-     */
-    String[] permissions() default ( "" );
-
-    /**
-     * @return the redback ressource karma needed
-     */
-    String resource() default ( "" );
-
-    /**
-     * @return doc
-     */
-    String description() default ( "" );
-
-    /**
-     * @return <code>true</code> if doesn't need any special permission
-     */
-    boolean noRestriction() default false;
-
-    /**
-     * @return if this service need only authentication and not special karma
-     */
-    boolean noPermission() default false;
-}
diff --git a/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/UnauthorizedException.java b/redback-authorization/redback-authorization-api/src/main/java/org/codehaus/plexus/redback/authorization/UnauthorizedException.java
deleted file mode 100755 (executable)
index 93797f9..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.codehaus.plexus.redback.authorization;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-/**
- * The exception thrown if an entity is unauthorized to access a resource.
- *
- * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
- * @since Mar 1, 2003
- */
-public class UnauthorizedException
-    extends Exception
-{
-    /**
-     * @param message
-     */
-    public UnauthorizedException( String message )
-    {
-        super( message );
-    }
-}
index b6e5662822768b6765891c899a210539bc01e143..2a54c22662b3c69d2bd6c201debf01ce751c43c9 100644 (file)
@@ -16,10 +16,10 @@ package org.codehaus.plexus.redback.authorization.open;
  * limitations under the License.
  */
 
-import org.codehaus.plexus.redback.authorization.AuthorizationDataSource;
-import org.codehaus.plexus.redback.authorization.AuthorizationException;
-import org.codehaus.plexus.redback.authorization.AuthorizationResult;
-import org.codehaus.plexus.redback.authorization.Authorizer;
+import org.apache.archiva.redback.authorization.AuthorizationDataSource;
+import org.apache.archiva.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.AuthorizationResult;
+import org.apache.archiva.redback.authorization.Authorizer;
 import org.springframework.stereotype.Service;
 
 /**
index ef242af94cdb2f0c2c4a0fc374287118e1d0499d..3c4c8eef82e7258fb42c00371a8f0582fe572469 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.redback.integration.filter.authorization;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.AuthorizationException;
 import org.codehaus.plexus.redback.system.SecuritySession;
 import org.codehaus.plexus.redback.system.SecuritySystem;
 import org.codehaus.plexus.util.StringUtils;
index a2550263da9b3a8abab655e85b28f25f31b744a8..8f551f05e024c6c97100f095885f04133dd8b07f 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.redback.integration.taglib.jsp;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.AuthorizationException;
 import org.codehaus.plexus.redback.system.SecuritySession;
 import org.codehaus.plexus.redback.system.SecuritySystem;
 import org.codehaus.plexus.redback.system.SecuritySystemConstants;
index 213784f39918c5988404369f6459753f042511c0..a1a75eeeac9a3064e732e5cde22f7e50996bd890 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.redback.integration.taglib.jsp;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.AuthorizationException;
 import org.codehaus.plexus.redback.system.SecuritySession;
 import org.codehaus.plexus.redback.system.SecuritySystem;
 import org.codehaus.plexus.redback.system.SecuritySystemConstants;
index bbe6a5c5e2e147afe1ae1c2f9949588cb32c175d..6b488c10359ff24e5d26a1e6110b1a90ea9cf89f 100644 (file)
@@ -19,8 +19,7 @@ package org.codehaus.redback.rest.api.services;
  * under the License.
  */
 
-import org.apache.cxf.jaxrs.model.wadl.Description;
-import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.codehaus.redback.rest.api.model.User;
 
 import javax.ws.rs.GET;
index 345ac72f6ca75ab53467f4a8179c8956c1373488..4e92eb361738e515821aa1fd4da48ba870685ba3 100644 (file)
@@ -18,7 +18,7 @@ package org.codehaus.redback.rest.api.services;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.codehaus.redback.rest.api.model.User;
 
 import javax.ws.rs.GET;
index 8849ad47f7eb98c51c8c21e44480bd2dfe3d4123..4e181dd62a0fbea92b2600c61d8b4a9fa240bb7d 100644 (file)
@@ -18,7 +18,7 @@ package org.codehaus.redback.rest.api.services;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.codehaus.redback.integration.security.role.RedbackRoleConstants;
 import org.codehaus.redback.rest.api.model.Application;
 import org.codehaus.redback.rest.api.model.ApplicationRoles;
index c2bbdf9cc59c91a33a5de732837624765b9b4724..872c307a7efd1e334b63e294993e8b9a3ff96358 100644 (file)
@@ -19,7 +19,7 @@ package org.codehaus.redback.rest.api.services;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.codehaus.redback.integration.security.role.RedbackRoleConstants;
 import org.codehaus.redback.rest.api.model.Operation;
 import org.codehaus.redback.rest.api.model.Permission;
index 7d4a04a282a1aeb719e9e18795163e62b14606f8..22936e132dfbb6c5a0a989e417a5edf20a0fc8bb 100644 (file)
@@ -18,7 +18,7 @@ package org.codehaus.redback.rest.api.services;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.redback.authorization.RedbackAuthorization;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
index a4bb9736e79f5fe8779d320324f9bfad263cbd06..9801ad6dbf1ada552ebe177d523f241527785372 100644 (file)
@@ -21,7 +21,7 @@ package org.codehaus.redback.rest.services.interceptors;
 
 import org.apache.cxf.jaxrs.model.OperationResourceInfo;
 import org.apache.cxf.message.Message;
-import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index df91c39f206031d7dfbc6cc74620b58e58a65c84..1f4c1e2733cfee7f7ec4b27a68a07d5bf82850c0 100644 (file)
@@ -27,7 +27,7 @@ import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.message.Message;
 import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.system.SecuritySession;
index 86514bf6b5dd8fb3788825469840493969340b70..99092f9a322c3500f3cc8b643a503bbd1af5d3da 100644 (file)
@@ -24,8 +24,8 @@ import org.apache.cxf.jaxrs.ext.RequestHandler;
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.message.Message;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authorization.AuthorizationException;
-import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.codehaus.plexus.redback.system.SecuritySession;
 import org.codehaus.plexus.redback.system.SecuritySystem;
 import org.codehaus.redback.integration.filter.authentication.basic.HttpBasicAuthentication;
index 1ebd45a719cb8805ea89b00200e0ea1f1e4667dd..cd6312b253138df8eca639c6658cd97ae3d79451 100644 (file)
@@ -18,7 +18,7 @@ package org.codehaus.redback.rest.services;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.redback.authorization.RedbackAuthorization;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
index 55dcc761407edb531c2ec51f3f4188fada111044..7fb6c6c828b14dcbc1035962baa6ea398e38c516 100644 (file)
@@ -26,7 +26,7 @@ import com.opensymphony.xwork2.ActionInvocation;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.SystemUtils;
 import org.apache.struts2.ServletActionContext;
-import org.codehaus.plexus.redback.authorization.AuthorizationResult;
+import org.apache.archiva.redback.authorization.AuthorizationResult;
 import org.codehaus.plexus.redback.system.SecuritySession;
 import org.codehaus.plexus.redback.system.SecuritySystem;
 import org.codehaus.plexus.redback.system.SecuritySystemConstants;
index 4df377ef15ea701d0e72ea66531c56820514c6ae..9bdc2e315bd199cba4270a3167a61b38a414652e 100644 (file)
@@ -24,7 +24,7 @@ import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.ActionProxy;
 import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.authorization.AuthorizationResult;
+import org.apache.archiva.redback.authorization.AuthorizationResult;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.rbac.RbacManagerException;
index 0315380389e592b6190293b532a326c6c408bc9a..ebf18202d874d9e29c4de31e1330c53e24a24d21 100644 (file)
@@ -20,11 +20,11 @@ package org.codehaus.plexus.redback.authorization.rbac;
  */
 
 import org.apache.archiva.redback.users.UserNotFoundException;
-import org.codehaus.plexus.redback.authorization.AuthorizationDataSource;
-import org.codehaus.plexus.redback.authorization.AuthorizationException;
-import org.codehaus.plexus.redback.authorization.AuthorizationResult;
-import org.codehaus.plexus.redback.authorization.Authorizer;
-import org.codehaus.plexus.redback.authorization.NotAuthorizedException;
+import org.apache.archiva.redback.authorization.AuthorizationDataSource;
+import org.apache.archiva.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.AuthorizationResult;
+import org.apache.archiva.redback.authorization.Authorizer;
+import org.apache.archiva.redback.authorization.NotAuthorizedException;
 import org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluationException;
 import org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator;
 import org.codehaus.plexus.redback.rbac.Permission;
index 15461aeec94e7b3ed47997df6dc95f0bebc29c56..17dd4936e1a50502afa9042bd69aeb9126fdee83 100644 (file)
@@ -19,10 +19,10 @@ package org.codehaus.plexus.redback.rbac.memory;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.authorization.AuthorizationDataSource;
-import org.codehaus.plexus.redback.authorization.AuthorizationException;
-import org.codehaus.plexus.redback.authorization.AuthorizationResult;
-import org.codehaus.plexus.redback.authorization.Authorizer;
+import org.apache.archiva.redback.authorization.AuthorizationDataSource;
+import org.apache.archiva.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.AuthorizationResult;
+import org.apache.archiva.redback.authorization.Authorizer;
 import org.springframework.stereotype.Service;
 
 /**
index 53509b55f1fb717fd0b5966686b9b8814c99767e..862c66f0531f1695817d433a303c152b2b5a7e5b 100644 (file)
@@ -26,10 +26,10 @@ import org.apache.archiva.redback.authentication.AuthenticationDataSource;
 import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.authentication.AuthenticationManager;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
-import org.codehaus.plexus.redback.authorization.AuthorizationDataSource;
-import org.codehaus.plexus.redback.authorization.AuthorizationException;
-import org.codehaus.plexus.redback.authorization.AuthorizationResult;
-import org.codehaus.plexus.redback.authorization.Authorizer;
+import org.apache.archiva.redback.authorization.AuthorizationDataSource;
+import org.apache.archiva.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.AuthorizationResult;
+import org.apache.archiva.redback.authorization.Authorizer;
 import org.codehaus.plexus.redback.keys.KeyManager;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
index b288f8a6e1b374b078e58a77dc025bafe22f2353..13c5b4cecba115e72451ce2acabc327ecade9ec7 100644 (file)
@@ -22,8 +22,8 @@ package org.codehaus.plexus.redback.system;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.authentication.AuthenticationDataSource;
 import org.apache.archiva.redback.authentication.AuthenticationException;
-import org.codehaus.plexus.redback.authorization.AuthorizationException;
-import org.codehaus.plexus.redback.authorization.AuthorizationResult;
+import org.apache.archiva.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.AuthorizationResult;
 import org.codehaus.plexus.redback.keys.KeyManager;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;