You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by jm...@apache.org on 2006/09/07 18:05:48 UTC

svn commit: r441128 - in /maven/archiva/trunk/archiva-webapp: ./ src/main/resources/ src/main/resources/META-INF/plexus/ src/main/webapp/WEB-INF/jsp/ src/main/webapp/WEB-INF/jsp/decorators/

Author: jmcconnell
Date: Thu Sep  7 09:05:47 2006
New Revision: 441128

URL: http://svn.apache.org/viewvc?view=rev&rev=441128
Log:
starting to use the plexus-security bits now, the store-model.xml file will eventually going away, the login and logout actions now work and you can register a user now and login.  doing so doesn't do anything for you atm, but its the start showing the security system being used in actions.  next will come authorization implementation and usage

Added:
    maven/archiva/trunk/archiva-webapp/rbac-store-model.xml   (with props)
    maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/login.jsp   (with props)
    maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/logout.jsp   (with props)
    maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/register.jsp   (with props)
Modified:
    maven/archiva/trunk/archiva-webapp/pom.xml
    maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/plexus/application.xml
    maven/archiva/trunk/archiva-webapp/src/main/resources/xwork.xml
    maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp

Modified: maven/archiva/trunk/archiva-webapp/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/pom.xml?view=diff&rev=441128&r1=441127&r2=441128
==============================================================================
--- maven/archiva/trunk/archiva-webapp/pom.xml (original)
+++ maven/archiva/trunk/archiva-webapp/pom.xml Thu Sep  7 09:05:47 2006
@@ -109,6 +109,47 @@
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
     </dependency>
+    <!-- Plexus Security Dependencies -->
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-system</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-ui-web</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-authorization-rbac-ui-web</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-authentication-provider-memory</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-user-management-provider-memory</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-authorization-rbac-store-memory</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-authorization-api</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-authorization-rbac-authorizer</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
   </dependencies>
   <build>
     <plugins>

Added: maven/archiva/trunk/archiva-webapp/rbac-store-model.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/rbac-store-model.xml?view=auto&rev=441128
==============================================================================
--- maven/archiva/trunk/archiva-webapp/rbac-store-model.xml (added)
+++ maven/archiva/trunk/archiva-webapp/rbac-store-model.xml Thu Sep  7 09:05:47 2006
@@ -0,0 +1 @@
+<model/>

Propchange: maven/archiva/trunk/archiva-webapp/rbac-store-model.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/plexus/application.xml?view=diff&rev=441128&r1=441127&r2=441128
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/plexus/application.xml (original)
+++ maven/archiva/trunk/archiva-webapp/src/main/resources/META-INF/plexus/application.xml Thu Sep  7 09:05:47 2006
@@ -59,6 +59,42 @@
         </levels>
       </configuration>
     </component>
+
+
+    <!-- plexus security components -->
+    <component>
+      <role>org.codehaus.plexus.security.system.SecuritySystem</role>
+      <implementation>org.codehaus.plexus.security.system.DefaultSecuritySystem</implementation>
+      <role-hint>default</role-hint>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.security.authentication.Authenticator</role>
+          <role-hint>memory</role-hint>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.security.authorization.Authorizer</role>
+          <role-hint>rbac</role-hint>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.security.user.UserManager</role>
+          <role-hint>memory</role-hint>
+        </requirement>
+      </requirements>
+    </component>
+
+    <component>
+      <role>org.codehaus.plexus.security.authorization.Authorizer</role>
+      <role-hint>rbac</role-hint>
+      <implementation>org.codehaus.plexus.security.authorization.rbac.RbacAuthorizer</implementation>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.security.authorization.rbac.store.RbacStore</role>
+          <role-hint>memory</role-hint>
+        </requirement>
+      </requirements>
+    </component>
+
+
   </components>
 
   <!-- Override default configuration of components -->

Modified: maven/archiva/trunk/archiva-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/resources/xwork.xml?view=diff&rev=441128&r1=441127&r2=441128
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/resources/xwork.xml (original)
+++ maven/archiva/trunk/archiva-webapp/src/main/resources/xwork.xml Thu Sep  7 09:05:47 2006
@@ -124,6 +124,21 @@
       </result>
       <result name="notFound" type="httpheader">404</result>
     </action>
+
+    <!-- plexus security actions -->
+    <action name="login" class="session" method="login">
+      <result name="input">/WEB-INF/jsp/login.jsp</result>
+      <result name="success" type="redirect-action">browse</result>
+    </action>
+
+    <action name="logout" class="session" method="logout">
+      <result>/WEB-INF/jsp/logout.jsp</result>
+    </action>
+
+    <action name="register" class="registerUser" method="createUser">
+      <result name="input">/WEB-INF/jsp/register.jsp</result>
+      <result name="success" type="redirect-action">login</result>
+    </action>
   </package>
 
   <!-- Configuration for the admin package. -->

Modified: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp?view=diff&rev=441128&r1=441127&r2=441128
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp (original)
+++ maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp Thu Sep  7 09:05:47 2006
@@ -58,7 +58,15 @@
 
 <div id="breadcrumbs">
   <div class="xleft">
-    <%-- TODO: login --%>
+    <ww:url id="loginUrl" action="login" namespace="/"/>
+    <ww:url id="logoutUrl" action="logout" namespace="/"/>
+    <ww:url id="registerUrl" action="register" namespace="/"/>
+    <ww:if test="${sessionScope.authStatus != true}">
+      <ww:a href="%{loginUrl}">Login</ww:a> or <ww:a href="%{registerUrl}">Register</ww:a> 
+    </ww:if>
+    <ww:else>
+      Welcome, <b>${sessionScope.user.username}</b> - <ww:a href="%{logoutUrl}">Logout</ww:a>
+    </ww:else>
   </div>
 
   <div class="xright">

Added: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/login.jsp
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/login.jsp?view=auto&rev=441128
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/login.jsp (added)
+++ maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/login.jsp Thu Sep  7 09:05:47 2006
@@ -0,0 +1,57 @@
+<%--
+  ~ Copyright 2005-2006 The 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.
+  --%>
+
+<%@ taglib prefix="ww" uri="/webwork" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html>
+<head>
+  <title>Login Page</title>
+  <ww:head/>
+</head>
+
+<body>
+
+<h1>Login</h1>
+
+<div id="contentArea">
+  <div id="nameColumn">
+    <ww:form action="login">
+      <table>
+        <tr>
+          <td>Username:</td>
+          <td><ww:textfield name="username"/></td>
+        </tr>
+        <tr>
+          <td>Password:</td>
+          <td><ww:password name="password"/></td>
+        </tr>
+        <tr>
+          <td><ww:submit name="Login"/></td>
+          <td></td>
+        </tr>
+      </table>
+    </ww:form>
+    <p>
+      <ww:url id="registerUrl" action="register" namespace="/"/>
+
+      New user? - <ww:a href="%{registerUrl}">Register!</ww:a>
+    </p>
+  </div>
+</div>
+
+</body>
+</html>

Propchange: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/login.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/logout.jsp
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/logout.jsp?view=auto&rev=441128
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/logout.jsp (added)
+++ maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/logout.jsp Thu Sep  7 09:05:47 2006
@@ -0,0 +1,37 @@
+<%--
+  ~ Copyright 2005-2006 The 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.
+  --%>
+
+<%@ taglib prefix="ww" uri="/webwork" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html>
+<head>
+  <title>Logout Page</title>
+  <ww:head/>
+</head>
+
+<body>
+
+<h1>Logout</h1>
+
+<div id="contentArea">
+  <div id="nameColumn">
+    You have been successfully logged out!
+  </div>
+</div>
+
+</body>
+</html>

Propchange: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/logout.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/register.jsp
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/register.jsp?view=auto&rev=441128
==============================================================================
--- maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/register.jsp (added)
+++ maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/register.jsp Thu Sep  7 09:05:47 2006
@@ -0,0 +1,60 @@
+<%--
+  ~ Copyright 2005-2006 The 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.
+  --%>
+
+<%@ taglib prefix="ww" uri="/webwork" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html>
+<head>
+  <title>Registration Page</title>
+  <ww:head/>
+</head>
+
+<body>
+
+<h1>Registration</h1>
+
+<div id="contentArea">
+  <div id="nameColumn">
+    <ww:form action="register">
+      <table>
+        <tr>
+          <td>Username:</td>
+          <td><ww:textfield name="username"/></td>
+        </tr>
+        <tr>
+          <td>Password:</td>
+          <td><ww:password name="password"/></td>
+        </tr>
+        <tr>
+          <td>Full Name:</td>
+          <td><ww:textfield name="fullName"/></td>
+        </tr>
+        <tr>
+          <td>Email Address:</td>
+          <td><ww:textfield name="email"/></td>
+        </tr>
+        <tr>
+          <td><ww:submit name="Register"/></td>
+          <td></td>
+        </tr>
+      </table>
+    </ww:form>
+  </div>
+</div>
+
+</body>
+</html>

Propchange: maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/register.jsp
------------------------------------------------------------------------------
    svn:eol-style = native